diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index fb56c393a..4971c2ce1 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -3819,8 +3819,8 @@ premiumState state:formattedText payment_options:vector an //@class StorePaymentPurpose @description Describes a purpose of an in-store payment -//@description The user subscribed to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store -storePaymentPurposePremiumSubscription is_restore:Bool = StorePaymentPurpose; +//@description The user subscribed to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store @is_upgrade Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store +storePaymentPurposePremiumSubscription is_restore:Bool is_upgrade:Bool = StorePaymentPurpose; //@description The user gifted Telegram Premium to another user @user_id Identifier of the user for which Premium was gifted @currency ISO 4217 currency code of the payment currency @amount Paid amount, in the smallest units of the currency storePaymentPurposeGiftedPremium user_id:int53 currency:string amount:int53 = StorePaymentPurpose; diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp index 0272f35b1..9e2a64e12 100644 --- a/td/telegram/Premium.cpp +++ b/td/telegram/Premium.cpp @@ -90,6 +90,9 @@ static Result> get_input_s if (p->is_restore_) { flags |= telegram_api::inputStorePaymentPremiumSubscription::RESTORE_MASK; } + if (p->is_upgrade_) { + flags |= telegram_api::inputStorePaymentPremiumSubscription::UPGRADE_MASK; + } return make_tl_object(flags, false /*ignored*/, false /*ignored*/); } diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 5c565451e..0a51d53bb 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -2692,7 +2692,7 @@ class CliClient final : public Actor { get_args(args, user_id, currency, amount); if (currency.empty()) { send_request(td_api::make_object( - td_api::make_object(false))); + td_api::make_object(false, false))); } else { send_request(td_api::make_object( td_api::make_object(user_id, currency, amount)));