payments.BotCancelStarsSubscription

class pyrogram.raw.functions.payments.BotCancelStarsSubscription

Cancel a bot subscription

Details:
  • Layer: 223

  • ID: 6DFA0622

Parameters:
  • user_id (InputUser) – The ID of the user whose subscription should be (un)cancelled

  • charge_id (str) – The provider_charge_id from the messageActionPaymentSentMe service message sent to the bot for the first subscription payment.

  • restore (bool, optional) – If 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.

Returns:

bool

TL Schema

payments.botCancelStarsSubscription#6dfa0622
flags:#
restore:flags.0?true
user_id:InputUser
charge_id:string

= Bool

Parameter Tree

BotCancelStarsSubscription
├── restoretrue (optional)
├── user_idInputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ └── InputUserFromMessage
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── user_idlong
└── charge_idstring

Example

await app.invoke(
    BotCancelStarsSubscription(
        restore=None,
        user_id=await app.resolve_user(chat_id),
        charge_id="text",
    )
)