payments.botCancelStarsSubscription #

Cancel a bot subscription

Layer 223

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;
---functions---
payments.botCancelStarsSubscription#6dfa0622 flags:# restore:flags.0?true user_id:InputUser charge_id:string = Bool;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
restoreflags.0?trueIf not set, disables autorenewal of the subscriptions, and prevents the user from reactivating the subscription once the current period expires: a subscription cancelled by the bot will have the starsSubscription.bot_canceled flag set.
The bot can can partially undo this operation by setting this flag: this will allow the user to reactivate the subscription.
user_idInputUserThe ID of the user whose subscription should be (un)cancelled
charge_idstringThe provider_charge_id from the messageActionPaymentSentMe service message sent to the bot for the first subscription payment.

Result #

Bool

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHARGE_ID_INVALIDThe specified charge_id is invalid.
400USER_ID_INVALIDThe provided user ID is invalid.

starsSubscription #

Represents a Telegram Star subscription ».

messageActionPaymentSentMe #

A user just sent a payment to me (a bot)

Star subscriptions #

Bots and channels may create subscriptions, periodically charging users a certain amount of Telegram Stars in exchange for content and services.