2
0
mirror of https://github.com/tdlib/telegram-bot-api synced 2025-08-28 21:08:01 +00:00

Add getBusinessConnection method.

This commit is contained in:
levlam 2024-03-18 18:31:52 +03:00
parent 15836d84f4
commit 5ca4a446f0
2 changed files with 13 additions and 0 deletions

View File

@ -257,6 +257,7 @@ bool Client::init_methods() {
methods_.emplace("createchatinvitelink", &Client::process_create_chat_invite_link_query);
methods_.emplace("editchatinvitelink", &Client::process_edit_chat_invite_link_query);
methods_.emplace("revokechatinvitelink", &Client::process_revoke_chat_invite_link_query);
methods_.emplace("getbusinessconnection", &Client::process_get_business_connection_query);
methods_.emplace("getchat", &Client::process_get_chat_query);
methods_.emplace("setchatphoto", &Client::process_set_chat_photo_query);
methods_.emplace("deletechatphoto", &Client::process_delete_chat_photo_query);
@ -10331,6 +10332,17 @@ td::Status Client::process_revoke_chat_invite_link_query(PromisedQueryPtr &query
return td::Status::OK();
}
td::Status Client::process_get_business_connection_query(PromisedQueryPtr &query) {
auto business_connection_id = query->arg("business_connection_id");
check_business_connection(business_connection_id.str(), std::move(query),
[this](const td::string &business_connection_id, PromisedQueryPtr query) mutable {
const auto *connection = get_business_connection(business_connection_id);
CHECK(connection != nullptr);
answer_query(JsonBusinessConnection(connection, this), std::move(query));
});
return td::Status::OK();
}
td::Status Client::process_get_chat_query(PromisedQueryPtr &query) {
auto chat_id = query->arg("chat_id");

View File

@ -650,6 +650,7 @@ class Client final : public WebhookActor::Callback {
td::Status process_create_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_edit_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_revoke_chat_invite_link_query(PromisedQueryPtr &query);
td::Status process_get_business_connection_query(PromisedQueryPtr &query);
td::Status process_get_chat_query(PromisedQueryPtr &query);
td::Status process_set_chat_photo_query(PromisedQueryPtr &query);
td::Status process_delete_chat_photo_query(PromisedQueryPtr &query);