diff options
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r-- | discord/discord.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp index 99ffb0b..6ac2223 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -761,6 +761,17 @@ void DiscordClient::Unpin(Snowflake channel_id, Snowflake message_id, sigc::slot }); } +// i dont know if the location parameter is necessary at all but discord's thread implementation is extremely strange +// so its here just in case +void DiscordClient::LeaveThread(Snowflake channel_id, const std::string &location, sigc::slot<void(DiscordError code)> callback) { + m_http.MakeDELETE("/channels/" + std::to_string(channel_id) + "/thread-members/@me?location=" + location, [this, callback](const http::response_type& response) { + if (CheckCode(response, 204)) + callback(DiscordError::NONE); + else + callback(GetCodeFromResponse(response)); + }); +} + void DiscordClient::FetchPinned(Snowflake id, sigc::slot<void(std::vector<Message>, DiscordError code)> callback) { // return from db if we know the pins have already been requested if (m_channels_pinned_requested.find(id) != m_channels_pinned_requested.end()) { |