diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-22 21:18:39 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-12-22 21:18:39 -0500 |
commit | 2e2ed5fc8f5192f082603f108fbe9a1fdaf39707 (patch) | |
tree | 4d5e43e83b4b93f679d16e806aec2f85a2d005c3 /discord/message.cpp | |
parent | 09f40cf9a9799916ff5d062f3de3f92a14d1f2c5 (diff) | |
download | abaddon-portaudio-2e2ed5fc8f5192f082603f108fbe9a1fdaf39707.tar.gz abaddon-portaudio-2e2ed5fc8f5192f082603f108fbe9a1fdaf39707.zip |
show slash command/APPLICATION_COMMAND messages
Diffstat (limited to 'discord/message.cpp')
-rw-r--r-- | discord/message.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/discord/message.cpp b/discord/message.cpp index c0e91c1..d3ba762 100644 --- a/discord/message.cpp +++ b/discord/message.cpp @@ -164,6 +164,25 @@ void to_json(nlohmann::json &j, const ReactionData &m) { j["emoji"] = m.Emoji; } +void from_json(const nlohmann::json &j, MessageApplicationData &m) { + JS_D("id", m.ID); + JS_O("cover_image", m.CoverImage); + JS_D("description", m.Description); + JS_N("icon", m.Icon); + JS_D("name", m.Name); +} + +void to_json(nlohmann::json &j, const MessageApplicationData &m) { + j["id"] = m.ID; + JS_IF("cover_image", m.CoverImage); + j["description"] = m.Description; + if (m.Icon == "") + j["icon"] = nullptr; + else + j["icon"] = m.Icon; + j["name"] = m.Name; +} + void from_json(const nlohmann::json &j, Message &m) { JS_D("id", m.ID); JS_D("channel_id", m.ChannelID); @@ -188,7 +207,7 @@ void from_json(const nlohmann::json &j, Message &m) { JS_O("webhook_id", m.WebhookID); JS_D("type", m.Type); // JS_O("activity", m.Activity); - // JS_O("application", m.Application); + JS_O("application", m.Application); JS_O("message_reference", m.MessageReference); JS_O("flags", m.Flags); JS_O("stickers", m.Stickers); @@ -212,6 +231,8 @@ void Message::from_json_edited(const nlohmann::json &j) { JS_O("pinned", IsPinned); JS_O("webhook_id", WebhookID); JS_O("type", Type); + JS_O("application", Application); + JS_O("message_reference", MessageReference); JS_O("flags", Flags); JS_O("stickers", Stickers); } |