diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-22 22:32:05 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-22 22:32:05 -0500 |
commit | cb18543c503320cf9d2132b0077625acb0e78e51 (patch) | |
tree | 0fc86a50ede211967658f619e4d5513d8ae033e2 /discord/user.cpp | |
parent | 2e2ed5fc8f5192f082603f108fbe9a1fdaf39707 (diff) | |
download | abaddon-portaudio-cb18543c503320cf9d2132b0077625acb0e78e51.tar.gz abaddon-portaudio-cb18543c503320cf9d2132b0077625acb0e78e51.zip |
show RECIPIENT_ADD, RECIPIENT_REMOVE messages
Diffstat (limited to 'discord/user.cpp')
-rw-r--r-- | discord/user.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/discord/user.cpp b/discord/user.cpp index 580f2ac..e4532ba 100644 --- a/discord/user.cpp +++ b/discord/user.cpp @@ -44,8 +44,24 @@ void from_json(const nlohmann::json &j, User &m) { void to_json(nlohmann::json &j, const User &m) { j["id"] = m.ID; j["username"] = m.Username; - j["avatar"] = m.Avatar; - // rest of stuff as needed im too lazy and its probably not necessary + j["discriminator"] = m.Discriminator; + if (m.Avatar == "") + j["avatar"] = nullptr; + else + j["avatar"] = m.Avatar; + JS_IF("bot", m.IsBot); + JS_IF("system", m.IsSystem); + JS_IF("mfa_enabled", m.IsMFAEnabled); + JS_IF("locale", m.Locale); + JS_IF("verified", m.IsVerified); + JS_IF("email", m.Email); + JS_IF("flags", m.Flags); + JS_IF("premium_type", m.PremiumType); + JS_IF("public_flags", m.PublicFlags); + JS_IF("desktop", m.IsDesktop); + JS_IF("mobile", m.IsMobile); + JS_IF("nsfw_allowed", m.IsNSFWAllowed); + JS_IF("phone", m.Phone); } void User::update_from_json(const nlohmann::json &j, User &m) { |