SKUs

This section documents everything related to SKUs, which represent items being sold on Discord, like application subscriptions. See the official docs for more info.

Discord Models

SKU

class disnake.SKU[source]

Represents an SKU.

This can be retrieved using Client.skus().

x == y

Checks if two SKUs are equal.

x != y

Checks if two SKUs are not equal.

hash(x)

Returns the SKU’s hash.

str(x)

Returns the SKU’s name.

New in version 2.10.

id

The SKU’s ID.

Type:

int

type

The SKU’s type.

Type:

SKUType

application_id

The parent application’s ID.

Type:

int

name

The SKU’s name.

Type:

str

slug

The SKU’s URL slug, system-generated based on name.

Type:

str

property created_at[source]

Returns the SKU’s creation time in UTC.

Type:

datetime.datetime

property flags[source]

Returns the SKU’s flags.

Type:

SKUFlags

Data Classes

SKUFlags

class disnake.SKUFlags[source]

Wraps up Discord SKU flags.

x == y

Checks if two SKUFlags instances are equal.

x != y

Checks if two SKUFlags instances are not equal.

x <= y

Checks if an SKUFlags instance is a subset of another SKUFlags instance.

x >= y

Checks if an SKUFlags instance is a superset of another SKUFlags instance.

x < y

Checks if an SKUFlags instance is a strict subset of another SKUFlags instance.

x > y

Checks if an SKUFlags instance is a strict superset of another SKUFlags instance.

x | y, x |= y

Returns a new SKUFlags instance with all enabled flags from both x and y. (Using |= will update in place).

x & y, x &= y

Returns a new SKUFlags instance with only flags enabled on both x and y. (Using &= will update in place).

x ^ y, x ^= y

Returns a new SKUFlags instance with only flags enabled on one of x or y, but not both. (Using ^= will update in place).

~x

Returns a new SKUFlags instance with all flags from x inverted.

hash(x)

Returns the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.

Additionally supported are a few operations on class attributes.

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

Returns a SKUFlags instance with all provided flags enabled.

~SKUFlags.y

Returns a SKUFlags instance with all flags except y inverted from their default value.

New in version 2.10.

value

The raw value. You should query flags via the properties rather than using this raw value.

Type:

int

available

Returns True if the SKU can be purchased.

Type:

bool

guild_subscription

Returns True if the SKU is an application subscription applied to a guild.

Type:

bool

user_subscription

Returns True if the SKU is an application subscription applied to a user.

Type:

bool

Enumerations

SKUType

class disnake.SKUType[source]

Represents the type of an SKU.

New in version 2.10.

subscription

Represents a recurring subscription.

subscription_group

Represents a system-generated group for each subscription SKU.