better member list, role color, some fixes

This commit is contained in:
ouwou
2020-09-05 23:04:11 -04:00
parent de482d6cb7
commit af82a8df8e
10 changed files with 264 additions and 21 deletions

View File

@@ -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<Snowflake> 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<RoleData> Roles; //
std::vector<RoleData> Roles; //
// std::vector<EmojiData> Emojis; //
std::vector<std::string> 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 {