From 9b1bc8f14590db0cf460fd62a7eb856e02a531db Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 30 Aug 2020 22:55:36 -0400 Subject: add ability to edit messages --- discord/objects.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'discord/objects.cpp') diff --git a/discord/objects.cpp b/discord/objects.cpp index ed556f4..1a8355e 100644 --- a/discord/objects.cpp +++ b/discord/objects.cpp @@ -295,6 +295,18 @@ void to_json(nlohmann::json &j, const CreateMessageObject &m) { j["content"] = m.Content; } +void to_json(nlohmann::json &j, const MessageEditObject &m) { + if (m.Content.size() > 0) + j["content"] = m.Content; + + // todo EmbedData to_json + // if (m.Embeds.size() > 0) + // j["embeds"] = m.Embeds; + + if (m.Flags != -1) + j["flags"] = m.Flags; +} + Snowflake::Snowflake() : m_num(Invalid) {} -- cgit v1.2.3