diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 465c33f..62a334f 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -276,6 +276,7 @@ bool Client::init_methods() { methods_.emplace("revokechatinvitelink", &Client::process_revoke_chat_invite_link_query); methods_.emplace("getbusinessconnection", &Client::process_get_business_connection_query); methods_.emplace("readbusinessmessage", &Client::process_read_business_message_query); + methods_.emplace("deletebusinessmessages", &Client::process_delete_business_messages_query); methods_.emplace("setuseremojistatus", &Client::process_set_user_emoji_status_query); methods_.emplace("getchat", &Client::process_get_chat_query); methods_.emplace("setchatphoto", &Client::process_set_chat_photo_query); @@ -12075,6 +12076,19 @@ td::Status Client::process_read_business_message_query(PromisedQueryPtr &query) return td::Status::OK(); } +td::Status Client::process_delete_business_messages_query(PromisedQueryPtr &query) { + auto business_connection_id = query->arg("business_connection_id").str(); + TRY_RESULT(message_ids, get_message_ids(query.get(), 100)); + check_business_connection( + business_connection_id, std::move(query), + [this, message_ids = std::move(message_ids)](const BusinessConnection *business_connection, + PromisedQueryPtr query) mutable { + send_request(make_object(business_connection->id_, std::move(message_ids)), + td::make_unique(std::move(query))); + }); + return td::Status::OK(); +} + td::Status Client::process_set_user_emoji_status_query(PromisedQueryPtr &query) { TRY_RESULT(user_id, get_user_id(query.get())); auto emoji_status_custom_emoji_id = td::to_integer(query->arg("emoji_status_custom_emoji_id")); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 1ac27a3..762e656 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -721,6 +721,7 @@ class Client final : public WebhookActor::Callback { td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query); td::Status process_get_business_connection_query(PromisedQueryPtr &query); td::Status process_read_business_message_query(PromisedQueryPtr &query); + td::Status process_delete_business_messages_query(PromisedQueryPtr &query); td::Status process_set_user_emoji_status_query(PromisedQueryPtr &query); td::Status process_get_chat_query(PromisedQueryPtr &query); td::Status process_set_chat_photo_query(PromisedQueryPtr &query);