SKUs

This section documents evewything wewated to SKUs, which wepwesent items being sowd on Discowd, wike appwication subscwiptions. See the officiaw docs fow m-mowe info.

Discowd Modews

SKU

class disnake.SKU[source]

Wepwesents an SKU.

This can b-b-be wetwieved using Client.skus().

x == y

Checks if two SKUs awe equaw.

x != y

Checks if two SKUs awe nyot equaw.

hash(x)

Wetuwns the SKU’s hash.

str(x)

Wetuwns the S-SKU’s nyame.

Nyew in vewsion 2.10.

id

The SKU’s ID.

Type:

int

type

The SKU’s type.

Type:

SKUType

application_id

The p-pawent appwication’s ID.

Type:

int

name

The SKU’s nyame.

Type:

str

slug

The S-SKU’s UWW swug, system-genyewated based on name.

Type:

str

property created_at[source]

Wetuwns the SKU’s cweation time in UTC.

Type:

datetime.datetime

property flags[source]

Wetuwns the SKU’s fwags.

Type:

SKUFlags

await subscriptions(user, *, limit=50, before=None, after=None)[source]

This function is a cowoutinye.

Wetwieves an AsyncIterator that enyabwes weceiving subscwiptions fow the SKU.

Aww pawametews, except user, awe optionyaw.

Pawametews:
  • usew (abc.Snowflake) – The u-u-usew to wetwieve s-subscwiptions fow.

  • wimit (Optionyaw[int]) – The nyumbew of subscwiptions to wetwieve. If None, wetwieves evewy subscwiption. Nyote, howevew, that this wouwd make it a swow opewation. Defauwts to 50.

  • befowe (Unyion[abc.Snowflake, datetime.datetime]) – Wetwieves subscwiptions c-cweated befowe this date ow object. If a datetime is pwovided, it is wecommended to use a UTC awawe datetime. If the datetime is nyaive, it is assumed to be wocaw time.

  • aftew (Unyion[abc.Snowflake, datetime.datetime]) – Wetwieve subscwiptions cweated aftew this date ow object. If a datetime is pwovided, it is wecommended to use a U-UTC awawe datetime. If the datetime is nyaive, it is assumed t-t-to be wocaw time.

Waises:

HTTPException – Wetwieving the subscwiptions faiwed.

Yiewds:

Subscription – The subscwiptions fow t-t-the given pawametews.

await fetch_subscription(subscription_id, /)[source]

This function is a cowoutinye.

Wetwieve a subscwiption fow this SKU given its ID.

Waises:

Data Cwasses

SKUFwags

class disnake.SKUFlags[source]

Wwaps up Discowd SKU fwags.

x == y

Checks if two SKUFwags instances a-a-awe equaw.

x != y

Checks if two SKUFwags instances awe nyot equaw.

x <= y

Checks if an SKUFwags instance is a subset of anyothew SKUFwags instance.

x >= y

Checks if an SKUFwags instance is a supewset of anyothew SKUFwags instance.

x < y

C-Checks if a-a-an SKUFwags instance is a-a stwict s-subset of anyothew SKUFwags instance.

x > y

Checks if an SKUFwags instance is a stwict supewset of anyothew SKUFwags instance.

x | y, x |= y

Wetuwns a nyew SKUFwags instance w-with aww enyabwed fwags fwom both x and y. (Using |= wiww update in p-p-pwace).

x & y, x &= y

Wetuwns a nyew SKUFwags instance with onwy fwags enyabwed on both x and y. (Using &= wiww update in pwace).

x ^ y, x ^= y

Wetuwns a nyew SKUFwags instance with onwy fwags enyabwed on onye of x ow y, b-b-but n-n-nyot both. (Using ^= wiww update in pwace).

~x

Wetuwns a nyew SKUFwags instance with aww fwags fwom x invewted.

hash(x)

Wetuwns the fwag’s hash.

iter(x)

W-W-Wetuwns an itewatow of (name, value) paiws. This awwows it to be, f-fow exampwe, constwucted as a dict o-ow a wist of paiws. Nyote that awiases awe nyot shown.

Additionyawwy suppowted awe a few opewations on cwass attwibutes.

SKUFlags.y | SKUFlags.z, SKUFlags(y=True) | SKUFlags.z

Wetuwns an S-S-SKUFwags instance with aww pwovided fwags enyabwed.

~SKUFlags.y

W-W-Wetuwns an SKUFwags instance with aww f-f-fwags except y invewted f-f-fwom theiw defauwt vawue.

Nyew in vewsion 2.10.

value

The waw vawue. You shouwd quewy fwags via the pwopewties wathew than using this waw vawue.

Type:

int

available

Wetuwns True if the SKU can be puwchased.

Type:

bool

guild_subscription

Wetuwns True if the SKU i-i-is an a-appwication subscwiption appwied to a guiwd.

Type:

bool

user_subscription

Wetuwns True if the SKU is an appwication subscwiption appwied to a usew.

Type:

bool

Enyumewations

S-S-SKUType

class disnake.SKUType[source]

Wepwesents the type of an SKU.

Nyew in vewsion 2.10.

durable

Wepwesents a duwabwe onye-time puwchase.

consumable

Wepwesents a consumabwe onye-time puwchase.

subscription

Wepwesents a-a wecuwwing subscwiption.

subscription_group

Wepwesents a system-genyewated gwoup fow each subscription SKU.