DiscordLua
discorddiscord
v1.2.4
Install

Subscription

Class
On this page

Subscription is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.

class Module 1.2.4 Source

Properties

Subscription.canceledAt

# readonly
Name
canceledAt
Type
any
Access
readonly
Description
Instance field Subscription.canceledAt. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.canceledTimestamp

# readonly
Name
canceledTimestamp
Type
any
Access
readonly
Description
Instance field Subscription.canceledTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.client

# readonly
Name
client
Type
any
Access
readonly
Description
Owning Client instance used for REST, cache, and event dispatch.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.country

# readonly
Name
country
Type
any
Access
readonly
Description
Instance field Subscription.country. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.currentPeriodEnd

# readonly
Name
currentPeriodEnd
Type
any
Access
readonly
Description
Instance field Subscription.currentPeriodEnd. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.currentPeriodEndTimestamp

# readonly
Name
currentPeriodEndTimestamp
Type
any
Access
readonly
Description
Instance field Subscription.currentPeriodEndTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.currentPeriodStart

# readonly
Name
currentPeriodStart
Type
any
Access
readonly
Description
Instance field Subscription.currentPeriodStart. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.currentPeriodStartTimestamp

# readonly
Name
currentPeriodStartTimestamp
Type
any
Access
readonly
Description
Instance field Subscription.currentPeriodStartTimestamp. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.entitlementIds

# readonly
Name
entitlementIds
Type
any
Access
readonly
Description
Instance field Subscription.entitlementIds. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this Subscription.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.raw

# readonly
Name
raw
Type
any
Access
readonly
Description
Instance field Subscription.raw. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.renewalSkuIds

# readonly
Name
renewalSkuIds
Type
any
Access
readonly
Description
Instance field Subscription.renewalSkuIds. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.skuIds

# readonly
Name
skuIds
Type
any
Access
readonly
Description
Instance field Subscription.skuIds. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.status

# readonly
Name
status
Type
any
Access
readonly
Description
Instance field Subscription.status. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Subscription.userId

# readonly
Name
userId
Type
any
Access
readonly
Description
Instance field Subscription.userId. Read it after the object is constructed or wrapped from Gateway/REST data.
Availability
Populated from the Gateway/REST payload or constructor for this Subscription.

Methods

Subscription:currentPeriodEndAt()

#

Performs current period end at on this Subscription. Call it from bot code when you need that operation on the current object.

Signature

Subscription:currentPeriodEndAt()

Parameters

No parameters.

Returns

Subscription — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Subscription
object:currentPeriodEndAt()

Subscription:currentPeriodStartAt()

#

Performs current period start at on this Subscription. Call it from bot code when you need that operation on the current object.

Signature

Subscription:currentPeriodStartAt()

Parameters

No parameters.

Returns

Subscription — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Subscription
object:currentPeriodStartAt()

Subscription:isActive()

#

Predicate that returns whether this Subscription matches isActive. Use it to branch before calling type-specific methods.

Signature

Subscription:isActive()

Parameters

No parameters.

Returns

Subscription — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a Subscription
object:isActive()

Subscription:toJSON()

#

Serialize this Subscription into a Lua table suitable for REST or debugging.

Signature

Subscription:toJSON()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a Subscription
object:toJSON()

Examples

Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc