summaryrefslogtreecommitdiff
path: root/discord/discord.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'discord/discord.cpp')
-rw-r--r--discord/discord.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/discord/discord.cpp b/discord/discord.cpp
index d1c4c2a..ab5ab9f 100644
--- a/discord/discord.cpp
+++ b/discord/discord.cpp
@@ -710,6 +710,15 @@ void DiscordClient::PutRelationship(Snowflake id, sigc::slot<void(bool success,
});
}
+void DiscordClient::Unpin(Snowflake channel_id, Snowflake message_id, sigc::slot<void(DiscordError code)> callback) {
+ m_http.MakeDELETE("/channels/" + std::to_string(channel_id) + "/pins/" + std::to_string(message_id), [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) {
m_http.MakeGET("/channels/" + std::to_string(id) + "/pins", [this, callback](const http::response_type &response) {
if (!CheckCode(response)) {