add PRESENCE_UPDATE handling (for user object only)

This commit is contained in:
ouwou
2020-10-13 02:35:02 -04:00
parent c17842c16f
commit 99597a80d2
6 changed files with 64 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ enum class GatewayEvent : int {
GUILD_DELETE,
MESSAGE_DELETE_BULK,
GUILD_MEMBER_UPDATE,
PRESENCE_UPDATE,
};
struct GatewayMessage {
@@ -201,3 +202,21 @@ struct GuildMemberUpdateMessage {
friend void from_json(const nlohmann::json &j, GuildMemberUpdateMessage &m);
};
struct ClientStatus {
std::string Desktop; // opt
std::string Mobile; // opt
std::string Web; // opt
friend void from_json(const nlohmann::json &j, ClientStatus &m);
};
struct PresenceUpdateMessage {
nlohmann::json User; // the client updates an existing object from this data
Snowflake GuildID;
std::string Status;
// std::vector<Activity> Activities;
ClientStatus ClientStatus;
friend void from_json(const nlohmann::json &j, PresenceUpdateMessage &m);
};