discord.py-message-components help_center search close
menu

Table of Contents

  • Monetization Related
    • SKU (Stock Keeping Unit)
      • SKU
    • SKUFlags
      • SKUFlags
    • Entitlement
      • Entitlement
    • Subscription
      • Subscription

Monetization Related

See also

More about app monetization

  • What Are Premium Apps?

  • Premium App Subscriptions FAQ

  • Discord API Docs

  • BaseInteraction.entitlements

  • API-Events

SKU (Stock Keeping Unit)

Attributes
  • application_id
  • flags
  • id
  • name
  • slug
  • type
class discord.SKU

Bases: object

SKUs (stock-keeping units) in Discord represent premium offerings that can be made available to your application’s users or guilds.

Added in version 2.0.

id

The ID of the SKU

Type:

int

type

The type of the SKU

Type:

SKUType

application_id

The ID of the application this SKU belongs to

Type:

int

name

Customer-facing name of the SKU

Type:

str

slug

Discord-generated URL slug based on the name

Type:

str

flags

Flags of the SKU, see SKUFlags for more info.

Note

This can be used to differentiate between a user and a server subscription.

Type:

SKUFlags

SKUFlags

Attributes
  • app_guild_subscription
  • app_user_subscription
  • available
  • available_for_subscription_gifting
  • guild_product
  • guild_role
  • has_free_premium_content
  • premium_purchase
  • value
class discord.SKUFlags

Bases: BaseFlags

Wraps up the flags of a SKU.

x == y

Checks if two SKUFlags are equal.

x != y

Checks if two SKUFlags are not equal.

hash(x)

Return 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.

value

The raw value. This value is a bit array field of a 53-bit integer representing the currently available flags. You should query flags via the properties rather than using this raw value.

Type:

int

premium_purchase

A premium purchase SKU

Type:

bool

has_free_premium_content

An SKU containing free premium content

Type:

bool

available

Whether the SKU is currently available for purchase

Type:

bool

guild_role

A role that can be purchased for a guild

Type:

bool

available_for_subscription_gifting

An SKU that can be purchased as a gift for others.

Type:

bool

app_guild_subscription

A recurring SKU that can be purchased by a user and applied to a single server. Grants access to every user in that server.

Type:

bool

app_user_subscription

Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.

Type:

bool

guild_product

A product in the guild store

Type:

bool

Entitlement

Attributes
  • application_id
  • consumed
  • deleted
  • ends_at
  • guild_id
  • id
  • sku_id
  • starts_at
  • target
  • type
  • user_id
Methods
  • asyncconsume
class discord.Entitlement

Bases: object

Entitlements represent that a user or guild has access to a premium offering in your application.

Added in version 2.0.

id

The ID of the entitlement

Type:

int

sku_id

The ID of the SKU this entitlement is for

Type:

int

application_id

The ID of the application this entitlement belongs to

Type:

int

user_id

app_user_subscription only: The ID of the user that is granted access to the entitlement’s sku

Type:

Optional[int]

guild_id

app_guild_subscription only: The ID of the guild that is granted access to the entitlement’s sku

Type:

Optional[int]

deleted

Whether this entitlement was deleted

Type:

bool

starts_at

Start date at which the entitlement is valid. None for test entitlements.

Type:

Optional[datetime]

ends_at

Time at which the entitlement is no longer valid. None for test entitlements.

Type:

Optional[datetime]

consumed

consumable entitlements only: Indicates whether the entitlement has been consumed

See also

To consume an entitlement you can use either of those

  • consume() from the Entitlement object directly

  • discord.Client.consume_entitlement() by using only the ID

Type:

Optional[bool]

property type

The type of the entitlement

Type:

EntitlementType

property target

Returns the target of the entitlement.

Note

This can be either a User or a Guild depending on the SKUFlags of the SKU this entitlement belongs to.

await consume()

This function is a coroutine.

For one-time purchase consumable SKUs, marks a given entitlement for the user as consumed. consumed will be False for this entitlement when using fetch_entitlements().

Note

This can can also be done with just the ID using consume_entitlement()

Subscription

Attributes
  • canceled_at
  • country_code
  • current_period_end
  • current_period_start
  • entitlement_ids
  • id
  • sku_ids
  • status
  • user
  • user_id
class discord.Subscription

Bases: object

Subscriptions in Discord represent a user making recurring payments for at least one SKU over an ongoing period. Successful payments grant the user access to entitlements associated with the SKU.

Added in version 2.0.

id

The ID of the subscription

Type:

int

user_id

The ID of the user that is subscribed to the SKU(s)

Type:

int

sku_ids

List of SKU IDs the user is subscribed to

Type:

List[int]

entitlement_ids

List of entitlements granted for this subscription

Type:

List[int]

current_period_start

Start date of the current subscription period

Type:

datetime

current_period_end

End date of the current subscription period

Type:

datetime

status

The status of the subscription

Type:

SubscriptionStatus

canceled_at

Time at which the subscription was canceled

Type:

Optional[datetime]

country_code

The country code of the user.

ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.

Type:

Optional[str]

property user

The user that is subscribed to the SKU(s)

© Copyright 2023, Mathieu C. aka. mccoder.py. Last updated on Apr 23 2025. Created using Sphinx 8.1.3.
close

Settings

Font

Use a serif font:

Theme

Automatic

Light

Dark

arrow_upward to top