Add reopenForumTopic method.

This commit is contained in:
levlam 2022-10-31 19:13:57 +03:00
parent 82ec9dc608
commit 807c353fc0
2 changed files with 14 additions and 0 deletions

View File

@ -257,6 +257,7 @@ bool Client::init_methods() {
methods_.emplace("createforumtopic", &Client::process_create_forum_topic_query);
methods_.emplace("editforumtopic", &Client::process_edit_forum_topic_query);
methods_.emplace("closeforumtopic", &Client::process_close_forum_topic_query);
methods_.emplace("reopenforumtopic", &Client::process_reopen_forum_topic_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);
@ -8193,6 +8194,18 @@ td::Status Client::process_close_forum_topic_query(PromisedQueryPtr &query) {
return Status::OK();
}
td::Status Client::process_reopen_forum_topic_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<td_api::toggleForumTopicIsClosed>(chat_id, message_thread_id, false),
td::make_unique<TdOnOkQueryCallback>(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()));

View File

@ -542,6 +542,7 @@ class Client final : public WebhookActor::Callback {
Status process_create_forum_topic_query(PromisedQueryPtr &query);
Status process_edit_forum_topic_query(PromisedQueryPtr &query);
Status process_close_forum_topic_query(PromisedQueryPtr &query);
Status process_reopen_forum_topic_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);