payments.BotCancelStarsSubscription
- class pyrogram.raw.functions.payments.BotCancelStarsSubscription
Cancel a bot subscription
- Details:
Layer:
223ID:
6DFA0622
- Parameters:
user_id (
InputUser) – The ID of the user whose subscription should be (un)cancelledcharge_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
├── restore →
true (optional)├── user_id →
InputUser│ ├──
InputUserEmpty│ ├──
InputUserSelf│ ├──
InputUser│ │ ├── user_id →
long│ │ └── access_hash →
long│ └──
InputUserFromMessage│ ├── peer →
InputPeer│ │ ├──
InputPeerEmpty│ │ ├──
InputPeerSelf│ │ ├──
InputPeerChat│ │ ├──
InputPeerUser│ │ ├──
InputPeerChannel│ │ ├──
InputPeerUserFromMessage│ │ └──
InputPeerChannelFromMessage│ ├── msg_id →
int│ └── user_id →
long└── charge_id →
stringExample
await app.invoke(
BotCancelStarsSubscription(
restore=None,
user_id=await app.resolve_user(chat_id),
charge_id="text",
)
)