Component
ClassOn this page
Component 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
accentColor- Type
any- Access
- readonly
- Description
- Instance field
Component.accentColor. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
accessory- Type
any- Access
- readonly
- Description
- Instance field
Component.accessory. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
channelTypes- Type
any- Access
- readonly
- Description
- Instance field
Component.channelTypes. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- 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 Component.
- Name
components- Type
any- Access
- readonly
- Description
- Instance field
Component.components. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
content- Type
any- Access
- readonly
- Description
- Text content of this Component.
- Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
customId- Type
any- Access
- readonly
- Description
- Instance field
Component.customId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
data- Type
any- Access
- readonly
- Description
- Instance field
Component.data. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
default- Type
any- Access
- readonly
- Description
- Instance field
Component.default. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
description- Type
any- Access
- readonly
- Description
- Instance field
Component.description. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
disabled- Type
any- Access
- readonly
- Description
- Instance field
Component.disabled. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
divider- Type
any- Access
- readonly
- Description
- Instance field
Component.divider. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
emoji- Type
any- Access
- readonly
- Description
- Instance field
Component.emoji. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
file- Type
any- Access
- readonly
- Description
- Instance field
Component.file. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this Component.
- Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
items- Type
any- Access
- readonly
- Description
- Instance field
Component.items. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
label- Type
any- Access
- readonly
- Description
- Instance field
Component.label. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
maxValues- Type
any- Access
- readonly
- Description
- Instance field
Component.maxValues. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
media- Type
any- Access
- readonly
- Description
- Instance field
Component.media. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
minValues- Type
any- Access
- readonly
- Description
- Instance field
Component.minValues. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
options- Type
any- Access
- readonly
- Description
- Instance field
Component.options. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
placeholder- Type
any- Access
- readonly
- Description
- Instance field
Component.placeholder. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
required- Type
any- Access
- readonly
- Description
- Instance field
Component.required. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
spacing- Type
any- Access
- readonly
- Description
- Instance field
Component.spacing. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
spoiler- Type
any- Access
- readonly
- Description
- Instance field
Component.spoiler. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
style- Type
any- Access
- readonly
- Description
- Instance field
Component.style. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
type- Type
any- Access
- readonly
- Description
- Instance field
Component.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 Component.
- Name
url- Type
any- Access
- readonly
- Description
- Instance field
Component.url. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
value- Type
any- Access
- readonly
- Description
- Instance field
Component.value. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
- Name
values- Type
any- Access
- readonly
- Description
- Instance field
Component.values. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this Component.
Methods
Component:equals()
#Return whether this Component refers to the same resource as the argument.
Signature
Component:equals(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
Component — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Component
object:equals(other)Component:toJSON()
#Serialize this Component into a Lua table suitable for REST or debugging.
Signature
Component:toJSON() Parameters
No parameters.
Returns
Component — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a Component
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