From 51cf8fd2df3cf7a602d05540627a5ad8af6baa58 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 9 Sep 2020 23:17:26 -0400 Subject: rename and reorder a bunch of discord stuff --- discord/guild.hpp | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 discord/guild.hpp (limited to 'discord/guild.hpp') diff --git a/discord/guild.hpp b/discord/guild.hpp new file mode 100644 index 0000000..d90c3e8 --- /dev/null +++ b/discord/guild.hpp @@ -0,0 +1,67 @@ +#pragma once +#include "json.hpp" +#include "snowflake.hpp" +#include "role.hpp" +#include "channel.hpp" +#include +#include + +// a bot is apparently only supposed to receive the `id` and `unavailable` as false +// but user tokens seem to get the full objects (minus users) +struct Guild { + Snowflake ID; // + std::string Name; // + std::string Icon; // null + std::string Splash; // null + std::string DiscoverySplash; // opt, null (docs wrong) + bool IsOwner = false; // opt + Snowflake OwnerID; // + int Permissions = 0; // opt + std::string PermissionsNew; // opt + std::string VoiceRegion; // opt + Snowflake AFKChannelID; // null + int AFKTimeout; // + bool IsEmbedEnabled = false; // opt, deprecated + Snowflake EmbedChannelID; // opt, null, deprecated + int VerificationLevel; // + int DefaultMessageNotifications; // + int ExplicitContentFilter; // + std::vector Roles; // + // std::vector Emojis; // + std::vector Features; // + int MFALevel; // + Snowflake ApplicationID; // null + bool IsWidgetEnabled = false; // opt + Snowflake WidgetChannelID; // opt, null + Snowflake SystemChannelID; // null + int SystemChannelFlags; // + Snowflake RulesChannelID; // null + std::string JoinedAt; // opt* + bool IsLarge = false; // opt* + bool IsUnavailable = false; // opt* + int MemberCount = 0; // opt* + // std::vector VoiceStates; // opt* + // std::vector Members; // opt* - incomplete anyways + std::vector Channels; // opt* + // std::vector Presences; // opt* + int MaxPresences = 0; // opt, null + int MaxMembers = 0; // opt + std::string VanityURL; // null + std::string Description; // null + std::string BannerHash; // null + int PremiumTier; // + int PremiumSubscriptionCount = 0; // opt + std::string PreferredLocale; // + Snowflake PublicUpdatesChannelID; // null + int MaxVideoChannelUsers = 0; // opt + int ApproximateMemberCount = 0; // opt + int ApproximatePresenceCount = 0; // opt + + // undocumented + // std::map GuildHashes; + bool IsLazy = false; + + // * - documentation says only sent in GUILD_CREATE, but these can be sent anyways in the READY event + + friend void from_json(const nlohmann::json &j, Guild &m); +}; -- cgit v1.2.3