Add setMyDescription.

This commit is contained in:
levlam 2023-02-27 02:19:10 +03:00
parent ab54061365
commit f25e81c015
2 changed files with 10 additions and 0 deletions

View File

@ -205,6 +205,7 @@ bool Client::init_methods() {
methods_.emplace("deletemycommands", &Client::process_delete_my_commands_query); methods_.emplace("deletemycommands", &Client::process_delete_my_commands_query);
methods_.emplace("getmydefaultadministratorrights", &Client::process_get_my_default_administrator_rights_query); methods_.emplace("getmydefaultadministratorrights", &Client::process_get_my_default_administrator_rights_query);
methods_.emplace("setmydefaultadministratorrights", &Client::process_set_my_default_administrator_rights_query); methods_.emplace("setmydefaultadministratorrights", &Client::process_set_my_default_administrator_rights_query);
methods_.emplace("setmydescription", &Client::process_set_my_description_query);
methods_.emplace("getchatmenubutton", &Client::process_get_chat_menu_button_query); methods_.emplace("getchatmenubutton", &Client::process_get_chat_menu_button_query);
methods_.emplace("setchatmenubutton", &Client::process_set_chat_menu_button_query); methods_.emplace("setchatmenubutton", &Client::process_set_chat_menu_button_query);
methods_.emplace("getuserprofilephotos", &Client::process_get_user_profile_photos_query); methods_.emplace("getuserprofilephotos", &Client::process_get_user_profile_photos_query);
@ -7794,6 +7795,14 @@ td::Status Client::process_set_my_default_administrator_rights_query(PromisedQue
return td::Status::OK(); return td::Status::OK();
} }
td::Status Client::process_set_my_description_query(PromisedQueryPtr &query) {
auto language_code = query->arg("language_code");
auto description = query->arg("description");
send_request(make_object<td_api::setBotInfoDescription>(language_code.str(), description.str()),
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
return td::Status::OK();
}
td::Status Client::process_get_chat_menu_button_query(PromisedQueryPtr &query) { td::Status Client::process_get_chat_menu_button_query(PromisedQueryPtr &query) {
if (query->has_arg("chat_id")) { if (query->has_arg("chat_id")) {
TRY_RESULT(user_id, get_user_id(query.get(), "chat_id")); TRY_RESULT(user_id, get_user_id(query.get(), "chat_id"));

View File

@ -505,6 +505,7 @@ class Client final : public WebhookActor::Callback {
td::Status process_delete_my_commands_query(PromisedQueryPtr &query); td::Status process_delete_my_commands_query(PromisedQueryPtr &query);
td::Status process_get_my_default_administrator_rights_query(PromisedQueryPtr &query); td::Status process_get_my_default_administrator_rights_query(PromisedQueryPtr &query);
td::Status process_set_my_default_administrator_rights_query(PromisedQueryPtr &query); td::Status process_set_my_default_administrator_rights_query(PromisedQueryPtr &query);
td::Status process_set_my_description_query(PromisedQueryPtr &query);
td::Status process_get_chat_menu_button_query(PromisedQueryPtr &query); td::Status process_get_chat_menu_button_query(PromisedQueryPtr &query);
td::Status process_set_chat_menu_button_query(PromisedQueryPtr &query); td::Status process_set_chat_menu_button_query(PromisedQueryPtr &query);
td::Status process_get_user_profile_photos_query(PromisedQueryPtr &query); td::Status process_get_user_profile_photos_query(PromisedQueryPtr &query);