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

@@ -141,3 +141,17 @@ void from_json(const nlohmann::json &j, GuildMemberUpdateMessage &m) {
JS_ON("nick", m.Nick);
JS_D("joined_at", m.JoinedAt);
}
void from_json(const nlohmann::json &j, ClientStatus &m) {
JS_O("desktop", m.Desktop);
JS_O("mobile", m.Mobile);
JS_O("web", m.Web);
}
void from_json(const nlohmann::json &j, PresenceUpdateMessage &m) {
m.User = j.at("user");
JS_D("guild_id", m.GuildID);
JS_D("status", m.Status);
// JS_D("activities", m.Activities);
JS_D("client_status", m.ClientStatus);
}