diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index db4f63d..192ae0b 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -259,6 +259,7 @@ bool Client::init_methods() { methods_.emplace("closeforumtopic", &Client::process_close_forum_topic_query); methods_.emplace("reopenforumtopic", &Client::process_reopen_forum_topic_query); methods_.emplace("deleteforumtopic", &Client::process_delete_forum_topic_query); + methods_.emplace("unpinallforumtopicmessages", &Client::process_unpin_all_forum_topic_messages_query); methods_.emplace("getchatmember", &Client::process_get_chat_member_query); methods_.emplace("getchatadministrators", &Client::process_get_chat_administrators_query); methods_.emplace("getchatmembercount", &Client::process_get_chat_member_count_query); @@ -8219,6 +8220,18 @@ td::Status Client::process_delete_forum_topic_query(PromisedQueryPtr &query) { return Status::OK(); } +td::Status Client::process_unpin_all_forum_topic_messages_query(PromisedQueryPtr &query) { + auto chat_id = query->arg("chat_id"); + auto message_thread_id = get_message_id(query.get(), "message_thread_id"); + + check_chat(chat_id, AccessRights::Write, std::move(query), + [this, message_thread_id](int64 chat_id, PromisedQueryPtr query) { + send_request(make_object(chat_id, message_thread_id), + td::make_unique(std::move(query))); + }); + return Status::OK(); +} + td::Status Client::process_get_chat_member_query(PromisedQueryPtr &query) { auto chat_id = query->arg("chat_id"); TRY_RESULT(user_id, get_user_id(query.get())); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index e283a69..555eb8f 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -544,6 +544,7 @@ class Client final : public WebhookActor::Callback { Status process_close_forum_topic_query(PromisedQueryPtr &query); Status process_reopen_forum_topic_query(PromisedQueryPtr &query); Status process_delete_forum_topic_query(PromisedQueryPtr &query); + Status process_unpin_all_forum_topic_messages_query(PromisedQueryPtr &query); Status process_get_chat_member_query(PromisedQueryPtr &query); Status process_get_chat_administrators_query(PromisedQueryPtr &query); Status process_get_chat_member_count_query(PromisedQueryPtr &query);