From 99597a80d2eb9752882791d458036c2c17969767 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 13 Oct 2020 02:35:02 -0400 Subject: add PRESENCE_UPDATE handling (for user object only) --- discord/user.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'discord/user.cpp') diff --git a/discord/user.cpp b/discord/user.cpp index 2e136e1..c7858d5 100644 --- a/discord/user.cpp +++ b/discord/user.cpp @@ -32,3 +32,22 @@ void from_json(const nlohmann::json &j, User &m) { JS_ON("nsfw_allowed", m.IsNSFWAllowed); JS_ON("phone", m.Phone); } + +void User::update_from_json(const nlohmann::json &j, User &m) { + JS_ON("username", m.Username); + JS_ON("discriminator", m.Discriminator); + JS_ON("avatar", m.Avatar); + JS_ON("bot", m.IsBot); + JS_ON("system", m.IsSystem); + JS_ON("mfa_enabled", m.IsMFAEnabled); + JS_ON("locale", m.Locale); + JS_ON("verified", m.IsVerified); + JS_ON("email", m.Email); + JS_ON("flags", m.Flags); + JS_ON("premium_type", m.PremiumType); + JS_ON("public_flags", m.PublicFlags); + JS_ON("desktop", m.IsDesktop); + JS_ON("mobile", m.IsMobile); + JS_ON("nsfw_allowed", m.IsNSFWAllowed); + JS_ON("phone", m.Phone); +} -- cgit v1.2.3