Skip to content

hikari.monetization#

Models for monetized apps & premium features.

Entitlement #

Bases: Unique

An entitlement represents that a user or guild has access to a premium offering in your application.

application_id class-attribute instance-attribute #

application_id: Snowflake = attrs.field(
    eq=False, hash=False, repr=True
)

ID of the parent application

ends_at class-attribute instance-attribute #

ends_at: datetime | None = attrs.field(
    eq=False, hash=False, repr=False
)

Date at which the entitlement is no longer valid. Not present when using test entitlements.

guild_id class-attribute instance-attribute #

guild_id: Snowflake | None = attrs.field(
    eq=False, hash=False, repr=False
)

ID of the guild that is granted access to the entitlement's SKU

id class-attribute instance-attribute #

id: Snowflake = attrs.field(hash=True, repr=True)

ID of the entitlement

is_consumed class-attribute instance-attribute #

is_consumed: bool = attrs.field(
    eq=False, hash=False, repr=False
)

For consumable items, whether the entitlement has been consumed

is_deleted class-attribute instance-attribute #

is_deleted: bool = attrs.field(
    eq=False, hash=False, repr=False
)

Whether the entitlement has been deleted

sku_id class-attribute instance-attribute #

sku_id: Snowflake = attrs.field(
    eq=False, hash=False, repr=True
)

ID of the SKU

starts_at class-attribute instance-attribute #

starts_at: datetime | None = attrs.field(
    eq=False, hash=False, repr=False
)

Start date at which the entitlement is valid. Not present when using test entitlements.

subscription_id class-attribute instance-attribute #

subscription_id: Snowflake | None = attrs.field(
    eq=False, hash=False, repr=False
)

The ID of the subscription that this entitlement is associated with.

Not present when using test entitlements.

type class-attribute instance-attribute #

type: EntitlementType | int = attrs.field(
    eq=False, hash=False, repr=True
)

Type of entitlement

user_id class-attribute instance-attribute #

user_id: Snowflake | None = attrs.field(
    eq=False, hash=False, repr=True
)

ID of the user that is granted access to the entitlement's SKU

EntitlementOwnerType #

Bases: int, Enum

Represents the type of an entitlement owner.

GUILD class-attribute instance-attribute #

GUILD = 1

Entitlement is owned by a guild

USER class-attribute instance-attribute #

USER = 2

Entitlement is owned by a user

EntitlementType #

Bases: int, Enum

Represents the type of an entitlement.

APPLICATION_SUBSCRIPTION class-attribute instance-attribute #

APPLICATION_SUBSCRIPTION = 8

Entitlement was purchased as an app subscription

DEVELOPER_GIFT class-attribute instance-attribute #

DEVELOPER_GIFT = 3

Entitlement was gifted by developer

FREE_PURCHASE class-attribute instance-attribute #

FREE_PURCHASE = 5

Entitlement was granted when the SKU was free

PREMIUM_PURCHASE class-attribute instance-attribute #

PREMIUM_PURCHASE = 7

Entitlement was claimed by user for free as a Nitro Subscriber

PREMIUM_SUBSCRIPTION class-attribute instance-attribute #

PREMIUM_SUBSCRIPTION = 2

Entitlement for Discord Nitro subscription

PURCHASE class-attribute instance-attribute #

PURCHASE = 1

Entitlement was purchased by user

TEST_MODE_PURCHASE class-attribute instance-attribute #

TEST_MODE_PURCHASE = 4

Entitlement was purchased by a dev in application test mode

USER_GIFT class-attribute instance-attribute #

USER_GIFT = 6

Entitlement was gifted by another user

SKU #

Bases: Unique

Represents an SKU (stock-keeping unit).

SKUs on Discord represent premium offerings that can be made available to your application's users or guilds.

application_id class-attribute instance-attribute #

application_id: Snowflake = attrs.field(
    eq=False, hash=False, repr=True
)

The ID of the parent application

flags class-attribute instance-attribute #

flags: SKUFlags = attrs.field(
    eq=False, hash=False, repr=True
)

The flags for the SKU

id class-attribute instance-attribute #

id: Snowflake = attrs.field(hash=True, repr=True)

The ID of the SKU

name class-attribute instance-attribute #

name: str = attrs.field(eq=False, hash=False, repr=True)

Customer-facing name of the SKU

slug class-attribute instance-attribute #

slug: str = attrs.field(eq=False, hash=False, repr=True)

Discord-generated URL slug based on the SKU's name

type class-attribute instance-attribute #

type: SKUType | int = attrs.field(
    eq=False, hash=False, repr=True
)

The type of the SKU

SKUFlags #

Bases: Flag

Represents the flags of a SKU.

AVAILABLE class-attribute instance-attribute #

AVAILABLE = 1 << 2

SKU is available for purchase

GUILD_SUBSCRIPTION class-attribute instance-attribute #

GUILD_SUBSCRIPTION = 1 << 7

Recurring SKU that can be purchased by a user and applied to a single server.

Grants access to every user in that server.

NONE class-attribute instance-attribute #

NONE = 0

No flags set

USER_SUBSCRIPTION class-attribute instance-attribute #

USER_SUBSCRIPTION = 1 << 8

Recurring SKU purchased by a user for themselves.

Grants access to the purchasing user in every server.

SKUType #

Bases: int, Enum

Represents the type of a SKU.

CONSUMABLE class-attribute instance-attribute #

CONSUMABLE = 3

Consumable one-time purchase

DURABLE class-attribute instance-attribute #

DURABLE = 2

Durable one-time purchase

SUBSCRIPTION class-attribute instance-attribute #

SUBSCRIPTION = 5

Represents a recurring subscription

SUBSCRIPTION_GROUP class-attribute instance-attribute #

SUBSCRIPTION_GROUP = 6

System-generated group for each SUBSCRIPTION SKU created