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 #
ID of the parent application
ends_at class-attribute instance-attribute #
Date at which the entitlement is no longer valid. Not present when using test entitlements.
guild_id class-attribute instance-attribute #
ID of the guild that is granted access to the entitlement's SKU
id class-attribute instance-attribute #
ID of the entitlement
is_consumed class-attribute instance-attribute #
For consumable items, whether the entitlement has been consumed
is_deleted class-attribute instance-attribute #
Whether the entitlement has been deleted
sku_id class-attribute instance-attribute #
ID of the SKU
starts_at class-attribute instance-attribute #
Start date at which the entitlement is valid. Not present when using test entitlements.
subscription_id class-attribute instance-attribute #
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
EntitlementOwnerType #
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
TEST_MODE_PURCHASE class-attribute instance-attribute #
TEST_MODE_PURCHASE = 4
Entitlement was purchased by a dev in application test mode
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 #
The ID of the parent application
flags class-attribute instance-attribute #
The flags for the SKU
id class-attribute instance-attribute #
The ID of the SKU
name class-attribute instance-attribute #
Customer-facing name of the SKU
slug class-attribute instance-attribute #
Discord-generated URL slug based on the SKU's name
SKUFlags #
Bases: Flag
Represents the flags of a SKU.
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.
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.