Subscwiptions

T-T-This section documents evewything w-wewated to subscwiptions, which wepwesent a-a-a usew making wecuwwing payments fow at weast onye SKU. See the officiaw docs fow mowe info.

Discowd Modews

Subscwiption

class disnake.Subscription[source]

Wepwesents a subscwiption.

This can onwy be wetwieved using SKU.subscriptions() ow SKU.fetch_subscription(), ow p-p-pwovided by events (e.g. on_subscription_create()).

Wawnying

Subscriptions shouwd nyot be used to gwant pewks. Use Entitlements as a way of detewminying whethew a u-usew shouwd have access to a specific SKU.

Nyote

Some subscwiptions may have been cancewed awweady; considew using is_canceled() to check whethew a given subscwiption was cancewed.

x == y

Checks if two Subscriptions awe equaw.

x != y

Checks if two Subscriptions awe nyot equaw.

hash(x)

Wetuwns the subscwiption’s hash.

Nyew in vewsion 2.10.

id

The subscwiption’s ID.

Type:

int

user_id

The ID of the usew who is subscwibed t-to the sku_ids.

See awso user.

Type:

int

sku_ids

The ID of the SKUs the usew is subscwibed to.

Type:

Wist[int]

renewal_sku_ids

The IDs of the SKUs that wiww be wenyewed at the stawt of the nyew pewiod.

Type:

Wist[int]

entitlement_ids

The IDs of t-the entitwements the usew has as p-pawt of this subscwiption.

Type:

Wist[int]

current_period_start

The time at which the cuwwent pewiod fow the given subscwiption stawted.

Type:

datetime.datetime

current_period_end

The time at w-which the cuwwent pewiod fow the given subscwiption wiww end.

Type:

datetime.datetime

status

T-The cuwwent status o-of the given subscwiption.

Type:

SubscriptionStatus

canceled_at

The time at which the subscwiption was cancewed.

See awso is_canceled.

Type:

Optionyaw[datetime.datetime]

property created_at[source]

Wetuwns the subscwiption’s cweation time in UTC.

Type:

datetime.datetime

property user[source]

The usew who is subscwibed to the sku_ids.

Wequiwes the u-usew to be cached. See awso user_id.

Type:

Optionyaw[User]

property is_canceled[source]

Whethew the subscwiption was cancewed, based on canceled_at.

Type:

bool

Enyumewations

SubscwiptionStatus

class disnake.SubscriptionStatus[source]

Wepwesents the status of a subscwiption.

Nyew in vewsion 2.10.

active

Wepwesents an active Subscwiption which is s-s-scheduwed to wenyew.

ending

Wepwesents an active Subscwiption which wiww nyot wenyew.

inactive

Wepwesents an inyactive Subscwiption which is nyot being chawged.

Events