diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-08-30 01:59:50 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2020-08-30 01:59:50 -0400 |
commit | af4f659aaabe0d20342e386919fef13688384bc3 (patch) | |
tree | 6eb060405823a992ebfb1954d86bb80a784beeab /discord | |
parent | fbd8ed2ba74ee514e2355bf0d456f89c3f598388 (diff) | |
download | abaddon-portaudio-af4f659aaabe0d20342e386919fef13688384bc3.tar.gz abaddon-portaudio-af4f659aaabe0d20342e386919fef13688384bc3.zip |
add DiscordClient::DeleteMessage
Diffstat (limited to 'discord')
-rw-r--r-- | discord/discord.cpp | 5 | ||||
-rw-r--r-- | discord/discord.hpp | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 7d0ca23..481e193 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -159,6 +159,11 @@ void DiscordClient::SendChatMessage(std::string content, Snowflake channel) { m_http.MakePOST("/channels/" + std::to_string(channel) + "/messages", j.dump(), [](auto) {}); } +void DiscordClient::DeleteMessage(Snowflake channel_id, Snowflake id) { + std::string path = "/channels/" + std::to_string(channel_id) + "/messages/" + std::to_string(id); + m_http.MakeDELETE(path, [](auto) {}); +} + void DiscordClient::UpdateToken(std::string token) { m_token = token; m_http.SetAuth(token); diff --git a/discord/discord.hpp b/discord/discord.hpp index 10ea95a..fed5ffe 100644 --- a/discord/discord.hpp +++ b/discord/discord.hpp @@ -74,6 +74,7 @@ public: const ChannelData *GetChannel(Snowflake id) const; void SendChatMessage(std::string content, Snowflake channel); + void DeleteMessage(Snowflake channel_id, Snowflake id); void UpdateToken(std::string token); |