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 = field(eq=False, hash=False, repr=True)

ID of the parent application

ends_at class-attribute instance-attribute #

ends_at: Optional[datetime] = 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: Optional[Snowflake] = 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 = field(hash=True, repr=True)

ID of the entitlement

is_deleted class-attribute instance-attribute #

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

Whether the entitlement has been deleted

sku_id class-attribute instance-attribute #

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

ID of the SKU

starts_at class-attribute instance-attribute #

starts_at: Optional[datetime] = 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: Optional[Snowflake] = 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: Union[EntitlementType, int] = field(eq=False, hash=False, repr=True)

Type of entitlement

user_id class-attribute instance-attribute #

user_id: Optional[Snowflake] = 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

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 = field(eq=False, hash=False, repr=True)

The ID of the parent application

flags class-attribute instance-attribute #

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

The flags for the SKU

id class-attribute instance-attribute #

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

The ID of the SKU

name class-attribute instance-attribute #

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

Customer-facing name of the SKU

slug class-attribute instance-attribute #

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

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

type class-attribute instance-attribute #

type: Union[SKUType, int] = 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 an entitlement.

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