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
export interface Subscription extends DiscordBase, ObjectToLower<APISubscription>Properties
19Methods
1Properties
status: SubscriptionStatus;isActiveGetterget isActive(): boolean;isInactiveGetterget isInactive(): boolean;isEndingGetterget isEnding(): boolean;currentPeriodStartAtGetterget currentPeriodStartAt(): Date;currentPeriodEndAtGetterget currentPeriodEndAt(): Date;canceledAtDateGetterget canceledAtDate(): Date | null;id: string;createdTimestampGetterget createdTimestamp(): number;Create a timestamp for the current object.
createdAtGetterget createdAt(): Date;createdAt gets the creation Date instace of the current object.
readonly client: UsingClient;userId: string;skuIds: string[];entitlementIds: string[];renewalSkuIds: string[] | null;currentPeriodStart: string;currentPeriodEnd: string;canceledAt: string | null;country?: string | undefined;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