diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index a1eae2790..e68fd7b29 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -7050,6 +7050,10 @@ suggestedActionSetBirthdate = SuggestedAction; //@description Suggests the user to extend their expiring Telegram Premium subscription @manage_premium_subscription_url A URL for managing Telegram Premium subscription suggestedActionExtendPremium manage_premium_subscription_url:string = SuggestedAction; +//@description Suggests the user to extend their expiring Telegram Star subscriptions. Call getStarSubscriptions with only_expiring == true +//-to get the number of expiring subscriptions and the number of required to buy Telegram Stars +suggestedActionExtendStarSubscriptions = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; diff --git a/td/telegram/SuggestedAction.cpp b/td/telegram/SuggestedAction.cpp index e0a4bd0c9..9dd0a89b5 100644 --- a/td/telegram/SuggestedAction.cpp +++ b/td/telegram/SuggestedAction.cpp @@ -50,6 +50,8 @@ SuggestedAction::SuggestedAction(Slice action_str) { init(Type::BirthdaySetup); } else if (action_str == Slice("PREMIUM_GRACE")) { init(Type::PremiumGrace); + } else if (action_str == Slice("STARS_SUBSCRIPTION_LOW_BALANCE")) { + init(Type::StarsSubscriptionLowBalance); } } @@ -111,6 +113,9 @@ SuggestedAction::SuggestedAction(const td_api::object_ptr SuggestedAction::get_suggested_actio return td_api::make_object(); case Type::PremiumGrace: return td_api::make_object( - G()->get_option_string("premium_manage_subscription_url", "https://T.me/premiumbot?start=status")); + G()->get_option_string("premium_manage_subscription_url", "https://t.me/premiumbot?start=status")); + case Type::StarsSubscriptionLowBalance: + return td_api::make_object(); default: UNREACHABLE(); return nullptr; @@ -243,6 +252,7 @@ void dismiss_suggested_action(SuggestedAction action, Promise &&promise) { case SuggestedAction::Type::GiftPremiumForChristmas: case SuggestedAction::Type::BirthdaySetup: case SuggestedAction::Type::PremiumGrace: + case SuggestedAction::Type::StarsSubscriptionLowBalance: return send_closure_later(G()->config_manager(), &ConfigManager::dismiss_suggested_action, std::move(action), std::move(promise)); case SuggestedAction::Type::ConvertToGigagroup: diff --git a/td/telegram/SuggestedAction.h b/td/telegram/SuggestedAction.h index ac25eaf3e..ca4833c69 100644 --- a/td/telegram/SuggestedAction.h +++ b/td/telegram/SuggestedAction.h @@ -29,7 +29,8 @@ struct SuggestedAction { RestorePremium, GiftPremiumForChristmas, BirthdaySetup, - PremiumGrace + PremiumGrace, + StarsSubscriptionLowBalance }; Type type_ = Type::Empty; DialogId dialog_id_;