From faf2f9b60b80bde42a66c2c7258325141d22c7f5 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 31 Dec 2024 00:21:04 +0300 Subject: [PATCH] Add removeUserVerification. --- telegram-bot-api/Client.cpp | 11 +++++++++++ telegram-bot-api/Client.h | 1 + 2 files changed, 12 insertions(+) diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index fbe056b..ecfdcaf 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -258,6 +258,7 @@ bool Client::init_methods() { 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("removeuserverification", &Client::process_remove_user_verification_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); @@ -11422,6 +11423,16 @@ td::Status Client::process_verify_chat_query(PromisedQueryPtr &query) { return td::Status::OK(); } +td::Status Client::process_remove_user_verification_query(PromisedQueryPtr &query) { + TRY_RESULT(user_id, get_user_id(query.get())); + check_user(user_id, std::move(query), [this, user_id](PromisedQueryPtr query) { + send_request( + make_object(0, make_object(user_id)), + 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 fe1d491..3bbcd74 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -692,6 +692,7 @@ class Client final : public WebhookActor::Callback { 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_remove_user_verification_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);