Skip to content

Commit 5fe7a66

Browse files
committed
Add transferBusinessAccountStars.
1 parent b1880bc commit 5fe7a66

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

telegram-bot-api/Client.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ bool Client::init_methods() {
288288
methods_.emplace("removebusinessaccountprofilephoto", &Client::process_remove_business_account_profile_photo_query);
289289
methods_.emplace("setbusinessaccountgiftsettings", &Client::process_set_business_account_gift_settings_query);
290290
methods_.emplace("getbusinessaccountstarbalance", &Client::process_get_business_account_star_balance_query);
291+
methods_.emplace("transferbusinessaccountstars", &Client::process_transfer_business_account_stars_query);
291292
methods_.emplace("getbusinessaccountgifts", &Client::process_get_business_account_gifts_query);
292293
methods_.emplace("convertgifttostars", &Client::process_convert_gift_to_stars_query);
293294
methods_.emplace("upgradegift", &Client::process_upgrade_gift_query);
@@ -12729,6 +12730,18 @@ td::Status Client::process_get_business_account_star_balance_query(PromisedQuery
1272912730
return td::Status::OK();
1273012731
}
1273112732

12733+
td::Status Client::process_transfer_business_account_stars_query(PromisedQueryPtr &query) {
12734+
auto business_connection_id = query->arg("business_connection_id").str();
12735+
auto star_count = get_integer_arg(query.get(), "star_count", 0, 0, 1000000000);
12736+
check_business_connection(
12737+
business_connection_id, std::move(query),
12738+
[this, star_count](const BusinessConnection *business_connection, PromisedQueryPtr query) {
12739+
send_request(make_object<td_api::transferBusinessAccountStars>(business_connection->id_, star_count),
12740+
td::make_unique<TdOnOkQueryCallback>(std::move(query)));
12741+
});
12742+
return td::Status::OK();
12743+
}
12744+
1273212745
td::Status Client::process_get_business_account_gifts_query(PromisedQueryPtr &query) {
1273312746
auto business_connection_id = query->arg("business_connection_id").str();
1273412747
check_business_connection(business_connection_id, std::move(query),

telegram-bot-api/Client.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ class Client final : public WebhookActor::Callback {
764764
td::Status process_remove_business_account_profile_photo_query(PromisedQueryPtr &query);
765765
td::Status process_set_business_account_gift_settings_query(PromisedQueryPtr &query);
766766
td::Status process_get_business_account_star_balance_query(PromisedQueryPtr &query);
767+
td::Status process_transfer_business_account_stars_query(PromisedQueryPtr &query);
767768
td::Status process_get_business_account_gifts_query(PromisedQueryPtr &query);
768769
td::Status process_convert_gift_to_stars_query(PromisedQueryPtr &query);
769770
td::Status process_upgrade_gift_query(PromisedQueryPtr &query);

0 commit comments

Comments
 (0)