diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 68106d5..85175ec 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -253,6 +253,7 @@ bool Client::init_methods() { methods_.emplace("createinvoicelink", &Client::process_create_invoice_link_query); methods_.emplace("getstartransactions", &Client::process_get_star_transactions_query); methods_.emplace("refundstarpayment", &Client::process_refund_star_payment_query); + methods_.emplace("edituserstarsubscription", &Client::process_edit_user_star_subscription_query); methods_.emplace("getavailablegifts", &Client::process_get_available_gifts_query); methods_.emplace("sendgift", &Client::process_send_gift_query); methods_.emplace("setgamescore", &Client::process_set_game_score_query); @@ -11312,6 +11313,20 @@ td::Status Client::process_refund_star_payment_query(PromisedQueryPtr &query) { return td::Status::OK(); } +td::Status Client::process_edit_user_star_subscription_query(PromisedQueryPtr &query) { + TRY_RESULT(user_id, get_user_id(query.get())); + auto telegram_payment_charge_id = query->arg("telegram_payment_charge_id"); + auto is_canceled = to_bool(query->arg("is_canceled")); + check_user_no_fail( + user_id, std::move(query), + [this, user_id, telegram_payment_charge_id = telegram_payment_charge_id.str(), + is_canceled](PromisedQueryPtr query) { + send_request(make_object(user_id, telegram_payment_charge_id, is_canceled), + td::make_unique(std::move(query))); + }); + return td::Status::OK(); +} + td::Status Client::process_get_available_gifts_query(PromisedQueryPtr &query) { send_request(make_object(), td::make_unique(this, std::move(query))); return td::Status::OK(); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index 8044cce..500995a 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -686,6 +686,7 @@ class Client final : public WebhookActor::Callback { td::Status process_create_invoice_link_query(PromisedQueryPtr &query); td::Status process_get_star_transactions_query(PromisedQueryPtr &query); td::Status process_refund_star_payment_query(PromisedQueryPtr &query); + td::Status process_edit_user_star_subscription_query(PromisedQueryPtr &query); td::Status process_get_available_gifts_query(PromisedQueryPtr &query); td::Status process_send_gift_query(PromisedQueryPtr &query); td::Status process_set_game_score_query(PromisedQueryPtr &query);