From 6e75c4a95dcf0e601aba324ab5ae5f34ebd1a00d Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 23 Jun 2021 02:24:24 -0400 Subject: add pin menu item to messages --- discord/discord.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'discord/discord.cpp') diff --git a/discord/discord.cpp b/discord/discord.cpp index a56481e..ef93360 100644 --- a/discord/discord.cpp +++ b/discord/discord.cpp @@ -710,6 +710,15 @@ void DiscordClient::PutRelationship(Snowflake id, sigc::slot callback) { + m_http.MakePUT("/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::Unpin(Snowflake channel_id, Snowflake message_id, sigc::slot 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)) -- cgit v1.2.3