Add setMyName.

This commit is contained in:
levlam 2023-04-07 14:52:10 +03:00
parent a894cace6b
commit 38a11d1e1f
2 changed files with 10 additions and 0 deletions

View File

@ -206,6 +206,7 @@ bool Client::init_methods() {
methods_.emplace("getmydefaultadministratorrights", &Client::process_get_my_default_administrator_rights_query);
methods_.emplace("setmydefaultadministratorrights", &Client::process_set_my_default_administrator_rights_query);
methods_.emplace("getmyname", &Client::process_get_my_name_query);
methods_.emplace("setmyname", &Client::process_set_my_name_query);
methods_.emplace("getmydescription", &Client::process_get_my_description_query);
methods_.emplace("setmydescription", &Client::process_set_my_description_query);
methods_.emplace("getmyshortdescription", &Client::process_get_my_short_description_query);
@ -7911,6 +7912,14 @@ td::Status Client::process_get_my_name_query(PromisedQueryPtr &query) {
return td::Status::OK();
}
td::Status Client::process_set_my_name_query(PromisedQueryPtr &query) {
auto language_code = query->arg("language_code");
auto name = query->arg("name");
send_request(make_object<td_api::setBotName>(my_id_, language_code.str(), name.str()),
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
return td::Status::OK();
}
td::Status Client::process_get_my_description_query(PromisedQueryPtr &query) {
auto language_code = query->arg("language_code");
send_request(make_object<td_api::getBotInfoDescription>(my_id_, language_code.str()),

View File

@ -512,6 +512,7 @@ class Client final : public WebhookActor::Callback {
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_get_my_name_query(PromisedQueryPtr &query);
td::Status process_set_my_name_query(PromisedQueryPtr &query);
td::Status process_get_my_description_query(PromisedQueryPtr &query);
td::Status process_set_my_description_query(PromisedQueryPtr &query);
td::Status process_get_my_short_description_query(PromisedQueryPtr &query);