GramIO API Reference / @gramio/contexts/dist / SubscriptionContext
Class: SubscriptionContext<Bot>
Defined in: contexts/index.d.ts:7274
This object contains information about changes to a user payment subscription toward the current bot.
Extends
Context<Bot>.Constructor<SubscriptionContext<Bot>>.CloneMixin<Bot,SubscriptionContext<Bot>,SubscriptionContextOptions<Bot>>
Type Parameters
| Type Parameter |
|---|
Bot extends BotLike |
Constructors
Constructor
new SubscriptionContext<
Bot>(options):SubscriptionContext<Bot>
Defined in: contexts/index.d.ts:7277
Parameters
| Parameter | Type |
|---|---|
options | SubscriptionContextOptions<Bot> |
Returns
SubscriptionContext<Bot>
Overrides
Constructor
new SubscriptionContext(...
args):SubscriptionContext
Defined in: contexts/index.d.ts:7274
Parameters
| Parameter | Type |
|---|---|
...args | any[] |
Returns
SubscriptionContext
Overrides
Context<Bot>.constructor
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
bot | public | Bot | - | Context.bot | contexts/index.d.ts:5240 |
payload | public | TelegramBotSubscriptionUpdated | The raw data that is used for this Context | CloneMixin.payload | contexts/index.d.ts:7276 |
update? | public | TelegramUpdate | - | Context.update | contexts/index.d.ts:5242 |
updateId? | public | number | - | Context.updateId | contexts/index.d.ts:5241 |
updateType | protected | UpdateName | - | Context.updateType | contexts/index.d.ts:5243 |
Accessors
[toStringTag]
Get Signature
get [toStringTag]():
string
Defined in: contexts/index.d.ts:5246
Returns
string
Inherited from
invoicePayload
Get Signature
get invoicePayload():
string
Defined in: contexts/index.d.ts:7281
Bot-specified invoice payload
Returns
string
isActive
Get Signature
get isActive():
boolean
Defined in: contexts/index.d.ts:7292
Whether the subscription is active (re-enabled after a previous cancellation)
Returns
boolean
isCanceled
Get Signature
get isCanceled():
boolean
Defined in: contexts/index.d.ts:7290
Whether the subscription was canceled by the user
Returns
boolean
isFailed
Get Signature
get isFailed():
boolean
Defined in: contexts/index.d.ts:7294
Whether payment for the subscription failed
Returns
boolean
state
Get Signature
get state():
TelegramBotSubscriptionUpdatedState
Defined in: contexts/index.d.ts:7288
The new state of the subscription. Currently, it can be one of canceled if the user canceled the subscription, active if the user re-enabled a previously canceled subscription, or failed if payment for the subscription failed.
Returns
TelegramBotSubscriptionUpdatedState
user
Get Signature
get user():
User
Defined in: contexts/index.d.ts:7279
User who subscribed for payments toward the bot
Returns
Methods
clone()
clone(
options?):SubscriptionContext
Defined in: contexts/index.d.ts:5934
Parameters
| Parameter | Type |
|---|---|
options? | SubscriptionContextOptions |
Returns
SubscriptionContext
Inherited from
is()
is<
T>(rawTypes):this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})
Defined in: contexts/index.d.ts:5249
Type Parameters
| Type Parameter |
|---|
T extends UpdateName |
Parameters
| Parameter | Type |
|---|---|
rawTypes | MaybeArray<SoftString<T>> |
Returns
this is InstanceType<ContextsMapping<Bot>[T]> & GetDerives<Bot, T> & (IsAny<Bot["__Derives"]> extends true ? {} : Bot["__Derives"] extends {} ? Bot["__Derives"]["global"] & Bot["__Derives"][T] : {})