DiscordLua
discorddiscord
v1.2.4
Install

Component

Class
On 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.

class Module 1.2.4 Source

Properties

Component.accentColor

# readonly
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.

Component.accessory

# readonly
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.

Component.channelTypes

# readonly
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.

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

Component.component

# readonly
Name
component
Type
Component
Access
readonly
Description
Instance field Component.component. 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.
Related
Component

Component.components

# readonly
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.

Component.content

# readonly
Name
content
Type
any
Access
readonly
Description
Text content of this Component.
Availability
Populated from the Gateway/REST payload or constructor for this Component.

Component.customId

# readonly
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.

Component.data

# readonly
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.

Component.default

# readonly
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.

Component.description

# readonly
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.

Component.disabled

# readonly
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.

Component.divider

# readonly
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.

Component.emoji

# readonly
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.

Component.file

# readonly
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.

Component.id

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

Component.items

# readonly
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.

Component.label

# readonly
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.

Component.maxValues

# readonly
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.

Component.media

# readonly
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.

Component.minValues

# readonly
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.

Component.options

# readonly
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.

Component.placeholder

# readonly
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.

Component.required

# readonly
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.

Component.spacing

# readonly
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.

Component.spoiler

# readonly
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.

Component.style

# readonly
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.

Component.type

# readonly
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.

Component.url

# readonly
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.

Component.value

# readonly
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.

Component.values

# readonly
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

NameTypeRequiredBehavior
other any required Passed through to the implementation as written.

Returns

Component — the same instance, for chaining.

Example

lua
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

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

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

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc