Entitlements

discord_http.entitlements module

class discord_http.entitlements.SKU(*, state, data)

Bases: PartialSKU

Represents a SKU (Stock Keeping Unit) object.

Parameters:
name: str

The name of the SKU.

slug: str

The slug of the SKU.

application: PartialUser

The application that owns the SKU.

property type: SKUType

The type of the SKU.

property flags: SKUFlags

The flags of the SKU.

async create_test_entitlement(*, owner_id, owner_type) PartialEntitlements

Create an entitlement for testing purposes.

Parameters:
Return type:

PartialEntitlements

Returns:

The created entitlement.

property created_at: datetime

The datetime of the snowflake.

id: int

The ID of the snowflake.

class discord_http.entitlements.Entitlements(*, state, data)

Bases: PartialEntitlements

Represents an entitlement object.

Parameters:
deleted: bool

Whether the entitlement is deleted or not.

type: EntitlementType

The type of the entitlement.

user: PartialUser | None

The user that owns the entitlement, if the owner type is user.

guild_id: int | None

The guild ID that owns the entitlement, if the owner type is guild.

subscription_id: int | None

The subscription ID that the entitlement belongs to, if any.

application: PartialUser

The application that owns the entitlement.

async consume() None

Mark the entitlement as consumed.

Return type:

None

property created_at: datetime

The datetime of the snowflake.

async delete_test_entitlement() None

Deletes a test entitlement.

Return type:

None

async fetch() Entitlements

Fetches the entitlement.

Return type:

Entitlements

id: int

The ID of the snowflake.

sku: PartialSKU

The SKU that the entitlement belongs to.

starts_at: datetime | None

The time the entitlement starts at, if any.

ends_at: datetime | None

The time the entitlement ends at, if any.

property guild: Guild | PartialGuild | None

Returns the guild the entitlement is in.

is_consumed() bool

Returns whether the entitlement is consumed or not.

Return type:

bool

class discord_http.entitlements.PartialEntitlements(*, state, id)

Bases: PartialBase

Represents a partial entitlement object.

Parameters:
async fetch() Entitlements

Fetches the entitlement.

Return type:

Entitlements

async consume() None

Mark the entitlement as consumed.

Return type:

None

async delete_test_entitlement() None

Deletes a test entitlement.

Return type:

None

property created_at: datetime

The datetime of the snowflake.

id: int

The ID of the snowflake.

class discord_http.entitlements.PartialSKU(*, state, id)

Bases: PartialBase

Represents a partial SKU object.

Parameters:
async create_test_entitlement(*, owner_id, owner_type) PartialEntitlements

Create an entitlement for testing purposes.

Parameters:
Return type:

PartialEntitlements

Returns:

The created entitlement.

property created_at: datetime

The datetime of the snowflake.

id: int

The ID of the snowflake.