DiscordLua
discorddiscord
v1.2.4
Install

SKU

Class
On this page

SKU 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

SKU.applicationId

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

SKU.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 SKU.

SKU.flags

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

SKU.id

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

SKU.name

# readonly
Name
name
Type
any
Access
readonly
Description
Display name of this SKU.
Availability
Populated from the Gateway/REST payload or constructor for this SKU.

SKU.raw

# readonly
Name
raw
Type
any
Access
readonly
Description
Instance field SKU.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 SKU.

SKU.slug

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

SKU.type

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

Methods

SKU:isConsumable()

#

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

Signature

SKU:isConsumable()

Parameters

No parameters.

Returns

SKU — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SKU
object:isConsumable()

SKU:isDurable()

#

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

Signature

SKU:isDurable()

Parameters

No parameters.

Returns

SKU — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SKU
object:isDurable()

SKU:isSubscription()

#

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

Signature

SKU:isSubscription()

Parameters

No parameters.

Returns

SKU — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SKU
object:isSubscription()

SKU:toJSON()

#

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

Signature

SKU:toJSON()

Parameters

No parameters.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a SKU
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