Preview deployment

class Entitlement

extends

Base
export class Entitlement extends Base

Represents an Entitlement

applicationId : Snowflake

The id of the parent application

readonly
client : Client<true>

The client that instantiated this

Inherited from: Base

consumed : boolean

Whether this entitlement has been consumed

deleted : boolean

Whether this entitlement was deleted

readonly
endsAt : Date | null

The end date at which this entitlement is no longer valid This is only null for test entitlements

endsTimestamp : number | null

The timestamp at which this entitlement is no longer valid This is only null for test entitlements

readonly
guild : Guild | null

The guild that is granted access to this entitlement's SKU

guildId : Snowflake | null

The id of the guild that is granted access to this entitlement's SKU

The id of the entitlement

skuId : Snowflake

The id of the associated SKU

readonly
startsAt : Date | null

The start date at which this entitlement is valid This is only null for test entitlements

startsTimestamp : number | null

The timestamp at which this entitlement is valid This is only null for test entitlements

The type of this entitlement

userId : Snowflake

The id of the user that is granted access to this entitlement's SKU

consume() : Promise<void>

Marks this entitlement as consumed Only available for One-Time Purchase consumable SKUs.

fetchUser() : Promise<User>

Fetches the user that is granted access to this entitlement's SKU

isActive() : boolean

Indicates whether this entitlement is active

isGuildSubscription() : this is this & { guildId: Snowflake; guild: Guild }

Indicates whether this entitlement is a guild subscription

isTest() : this is this & { startsTimestamp: null; endsTimestamp: null; get startsAt(): null; get endsAt(): null; }

Indicates whether this entitlement is a test entitlement

isUserSubscription() : this is this & { guildId: null; get guild(): null }

Indicates whether this entitlement is a user subscription

toJSON(
...props: Record<string, boolean | string>[]
) : unknown

Inherited from: Base

valueOf() : string

Inherited from: Base