Subscriptions¶
This section documents everything related to Subscription(s), which represents a user making recurring payments for at least one SKU. See the official docs for more info.
Discord Models¶
Subscription¶
- class disnake.Subscription[source]¶
Represents a subscription.
This can only be retrieved using
SKU.subscriptions()
orSKU.fetch_subscription()
, or provided by events (e.g.on_subscription_create()
).Warning
Subscription
s should not be used to grant perks. UseEntitlement
s as a way of determining whether a user should have access to a specificSKU
.Note
Some subscriptions may have been canceled already; consider using
is_canceled()
to check whether a given subscription was canceled.- x == y
Checks if two
Subscription
s are equal.
- x != y
Checks if two
Subscription
s are not equal.
- hash(x)
Returns the subscription’s hash.
New in version 2.10.
- renewal_sku_ids¶
The IDs of the SKUs that will be renewed at the start of the new period.
- Type:
List[
int
]
- entitlement_ids¶
The IDs of the entitlements the user has as part of this subscription.
- Type:
List[
int
]
- current_period_start¶
The time at which the current period for the given subscription started.
- Type:
- current_period_end¶
The time at which the current period for the given subscription will end.
- Type:
- status¶
The current status of the given subscription.
- Type:
- canceled_at¶
The time at which the subscription was canceled.
See also
is_canceled
.- Type:
Optional[
datetime.datetime
]
- property user[source]¶
The user who is subscribed to the
sku_ids
.Requires the user to be cached. See also
user_id
.- Type:
Optional[
User
]
- property is_canceled[source]¶
Whether the subscription was canceled, based on
canceled_at
.- Type:
Enumerations¶
SubscriptionStatus¶
- class disnake.SubscriptionStatus[source]¶
Represents the status of a subscription.
New in version 2.10.
- active¶
Represents an active Subscription which is scheduled to renew.
- ending¶
Represents an active Subscription which will not renew.
- inactive¶
Represents an inactive Subscription which is not being charged.