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_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: Union[EntitlementType, int] = field(eq=False, hash=False, repr=True)
Type of entitlement
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
#
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
#
Recurring SKU purchased by a user for themselves.
Grants access to the purchasing user in every server.
difference
#
Perform a set difference with the other set.
This will return all flags in this set that are not in the other value.
Equivalent to using the subtraction -
operator.
intersection
#
Return a combination of flags that are set for both given values.
Equivalent to using the "AND" &
operator.
is_disjoint
#
is_subset
#
Return whether another set contains this set or not.
Equivalent to using the "in" operator.
is_superset
#
Return whether this set contains another set or not.
none
#
none(*flags: Self) -> bool
Check if none of the given flags are part of this value.
Note
This is essentially the opposite of hikari.internal.enums.Flag.any
.
RETURNS | DESCRIPTION |
---|---|
bool
|
split
#
split() -> Sequence[Self]
Return a list of all defined atomic values for this flag.
Any unrecognised bits will be omitted for brevity.
The result will be a name-sorted typing.Sequence
of each member
symmetric_difference
#
Return a set with the symmetric differences of two flag sets.
Equivalent to using the "XOR" ^
operator.
For a ^ b
, this can be considered the same as (a - b) | (b - a)
.