From af82a8df8e469739765918b1627de20948186eb4 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 5 Sep 2020 23:04:11 -0400 Subject: better member list, role color, some fixes --- discord/objects.hpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'discord/objects.hpp') diff --git a/discord/objects.hpp b/discord/objects.hpp index bbca342..065e040 100644 --- a/discord/objects.hpp +++ b/discord/objects.hpp @@ -92,6 +92,20 @@ enum class ChannelType : int { GUILD_STORE = 6, }; +struct RoleData { + Snowflake ID; + std::string Name; + int Color; + bool IsHoisted; + int Position; + int PermissionsLegacy; + uint64_t Permissions; + bool IsManaged; + bool IsMentionable; + + friend void from_json(const nlohmann::json &j, RoleData &m); +}; + struct UserData { Snowflake ID; // std::string Username; // @@ -116,6 +130,18 @@ struct UserData { friend void from_json(const nlohmann::json &j, UserData &m); }; +struct GuildMemberData { + UserData User; // opt + std::string Nickname; // null + std::vector Roles; // + std::string JoinedAt; // + std::string PremiumSince; // opt, null + bool IsDeafened; // + bool IsMuted; // + + friend void from_json(const nlohmann::json &j, GuildMemberData &m); +}; + struct ChannelData { Snowflake ID; // ChannelType Type; // @@ -159,7 +185,7 @@ struct GuildData { int VerificationLevel; // int DefaultMessageNotifications; // int ExplicitContentFilter; // - // std::vector Roles; // + std::vector Roles; // // std::vector Emojis; // std::vector Features; // int MFALevel; // @@ -396,7 +422,12 @@ struct GuildMemberListUpdateMessage { std::string HoistedRole; // null bool IsDefeaned; // + GuildMemberData GetAsMemberData() const; + friend void from_json(const nlohmann::json &j, MemberItem &m); + + private: + GuildMemberData m_member_data; }; struct OpObject { -- cgit v1.2.3