diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 18e68a9..fbe056b 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -257,6 +257,7 @@ bool Client::init_methods() { methods_.emplace("getavailablegifts", &Client::process_get_available_gifts_query); methods_.emplace("sendgift", &Client::process_send_gift_query); methods_.emplace("verifyuser", &Client::process_verify_user_query); + methods_.emplace("verifychat", &Client::process_verify_chat_query); methods_.emplace("setgamescore", &Client::process_set_game_score_query); methods_.emplace("getgamehighscores", &Client::process_get_game_high_scores_query); methods_.emplace("answerwebappquery", &Client::process_answer_web_app_query_query); @@ -11409,6 +11410,18 @@ td::Status Client::process_verify_user_query(PromisedQueryPtr &query) { return td::Status::OK(); } +td::Status Client::process_verify_chat_query(PromisedQueryPtr &query) { + auto chat_id = query->arg("chat_id"); + auto custom_description = query->arg("custom_description"); + check_chat(chat_id, AccessRights::Read, std::move(query), + [this, custom_description = custom_description.str()](int64 chat_id, PromisedQueryPtr query) { + send_request(make_object( + 0, make_object(chat_id), custom_description), + td::make_unique(std::move(query))); + }); + return td::Status::OK(); +} + td::Status Client::process_set_game_score_query(PromisedQueryPtr &query) { auto chat_id = query->arg("chat_id"); auto message_id = get_message_id(query.get()); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 799927d..fe1d491 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -691,6 +691,7 @@ class Client final : public WebhookActor::Callback { td::Status process_get_available_gifts_query(PromisedQueryPtr &query); td::Status process_send_gift_query(PromisedQueryPtr &query); td::Status process_verify_user_query(PromisedQueryPtr &query); + td::Status process_verify_chat_query(PromisedQueryPtr &query); td::Status process_set_game_score_query(PromisedQueryPtr &query); td::Status process_get_game_high_scores_query(PromisedQueryPtr &query); td::Status process_answer_web_app_query_query(PromisedQueryPtr &query);