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() or SKU.fetch_subscription(), or provided by events (e.g. on_subscription_create()).

Warning

Subscriptions should not be used to grant perks. Use Entitlements as a way of determining whether a user should have access to a specific SKU.

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 Subscriptions are equal.

x != y

Checks if two Subscriptions are not equal.

hash(x)

Returns the subscription’s hash.

New in version 2.10.

id

The subscription’s ID.

Type:

int

user_id

The ID of the user who is subscribed to the sku_ids.

See also user.

Type:

int

sku_ids

The ID of the SKUs the user is subscribed to.

Type:

List[int]

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:

datetime.datetime

current_period_end

The time at which the current period for the given subscription will end.

Type:

datetime.datetime

status

The current status of the given subscription.

Type:

SubscriptionStatus

canceled_at

The time at which the subscription was canceled.

See also is_canceled.

Type:

Optional[datetime.datetime]

property created_at[source]

Returns the subscription’s creation time in UTC.

Type:

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:

bool

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.