Subscription
ClassOn 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.
Properties
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Subscription.
- Availability
- Populated from the Gateway/REST payload or constructor for this Subscription.
- 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.
- 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.
- 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.
- 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.
- 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
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
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
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
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.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationRoleConnectionMetadata · Attachment
Version: discord 1.2.4 · runtime 1.0.0