mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-02 16:42:56 +01:00
Add editForumTopic method.
This commit is contained in:
parent
1e68d49193
commit
1f7cd2cba5
@ -255,6 +255,7 @@ bool Client::init_methods() {
|
|||||||
methods_.emplace("deletechatstickerset", &Client::process_delete_chat_sticker_set_query);
|
methods_.emplace("deletechatstickerset", &Client::process_delete_chat_sticker_set_query);
|
||||||
methods_.emplace("getforumtopiciconstickers", &Client::process_get_forum_topic_icon_stickers_query);
|
methods_.emplace("getforumtopiciconstickers", &Client::process_get_forum_topic_icon_stickers_query);
|
||||||
methods_.emplace("createforumtopic", &Client::process_create_forum_topic_query);
|
methods_.emplace("createforumtopic", &Client::process_create_forum_topic_query);
|
||||||
|
methods_.emplace("editforumtopic", &Client::process_edit_forum_topic_query);
|
||||||
methods_.emplace("getchatmember", &Client::process_get_chat_member_query);
|
methods_.emplace("getchatmember", &Client::process_get_chat_member_query);
|
||||||
methods_.emplace("getchatadministrators", &Client::process_get_chat_administrators_query);
|
methods_.emplace("getchatadministrators", &Client::process_get_chat_administrators_query);
|
||||||
methods_.emplace("getchatmembercount", &Client::process_get_chat_member_count_query);
|
methods_.emplace("getchatmembercount", &Client::process_get_chat_member_count_query);
|
||||||
@ -8165,6 +8166,20 @@ td::Status Client::process_create_forum_topic_query(PromisedQueryPtr &query) {
|
|||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
td::Status Client::process_edit_forum_topic_query(PromisedQueryPtr &query) {
|
||||||
|
auto chat_id = query->arg("chat_id");
|
||||||
|
auto message_thread_id = get_message_id(query.get(), "message_thread_id");
|
||||||
|
auto name = query->arg("name");
|
||||||
|
auto icon_custom_emoji_id = td::to_integer<int64>(query->arg("icon_custom_emoji_id"));
|
||||||
|
|
||||||
|
check_chat(chat_id, AccessRights::Write, std::move(query),
|
||||||
|
[this, message_thread_id, name = name.str(), icon_custom_emoji_id](int64 chat_id, PromisedQueryPtr query) {
|
||||||
|
send_request(make_object<td_api::editForumTopic>(chat_id, message_thread_id, name, icon_custom_emoji_id),
|
||||||
|
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
|
||||||
|
});
|
||||||
|
return Status::OK();
|
||||||
|
}
|
||||||
|
|
||||||
td::Status Client::process_get_chat_member_query(PromisedQueryPtr &query) {
|
td::Status Client::process_get_chat_member_query(PromisedQueryPtr &query) {
|
||||||
auto chat_id = query->arg("chat_id");
|
auto chat_id = query->arg("chat_id");
|
||||||
TRY_RESULT(user_id, get_user_id(query.get()));
|
TRY_RESULT(user_id, get_user_id(query.get()));
|
||||||
|
@ -540,6 +540,7 @@ class Client final : public WebhookActor::Callback {
|
|||||||
Status process_delete_chat_sticker_set_query(PromisedQueryPtr &query);
|
Status process_delete_chat_sticker_set_query(PromisedQueryPtr &query);
|
||||||
Status process_get_forum_topic_icon_stickers_query(PromisedQueryPtr &query);
|
Status process_get_forum_topic_icon_stickers_query(PromisedQueryPtr &query);
|
||||||
Status process_create_forum_topic_query(PromisedQueryPtr &query);
|
Status process_create_forum_topic_query(PromisedQueryPtr &query);
|
||||||
|
Status process_edit_forum_topic_query(PromisedQueryPtr &query);
|
||||||
Status process_get_chat_member_query(PromisedQueryPtr &query);
|
Status process_get_chat_member_query(PromisedQueryPtr &query);
|
||||||
Status process_get_chat_administrators_query(PromisedQueryPtr &query);
|
Status process_get_chat_administrators_query(PromisedQueryPtr &query);
|
||||||
Status process_get_chat_member_count_query(PromisedQueryPtr &query);
|
Status process_get_chat_member_count_query(PromisedQueryPtr &query);
|
||||||
|
Loading…
Reference in New Issue
Block a user