Skip to content

Subscription

A recurring payment for at least one SKU. Status flips around a lot (failed payments, refunds) so Discord says not to gate perks on it. Use entitlements for access and read this structure for display and bookkeeping instead. https://docs.discord.com/developers/resources/subscription#subscription-object

Signature

@Mixins(DiscordBase)export declare class Subscription extends DiscordBase<APISubscription>

Properties

get createdTimestamp(): number;

Create a timestamp for the current object.

get createdAt(): Date;

createdAt gets the creation Date instace of the current object.

Methods

fetch(skuId?: string): Promise<SubscriptionStructure>;

Refetches this subscription from Discord. The subscription payload does not carry its SKU, it only lists sku ids, so callers need to pass which SKU row they listed through. Defaults to the first sku id on the payload.

@throwsWhen the payload carries no sku ids and no skuId was passed. https://docs.discord.com/developers/resources/subscription#get-sku-subscription