Skip to content

MessageActionRow

classe · Source

Represents an action row containing message components.

Extends: BaseMessageComponent

Constructor

new MessageActionRow(data?: MessageActionRow | MessageActionRowOptions, client?: Client)

Parameters

NameTypeDescription
data?MessageActionRow | MessageActionRowOptionsMessageActionRow to clone or raw data Default: {}.
client?ClientThe client constructing this MessageActionRow, if provided Default: null.

Properties

components

components: Array<MessageActionRowComponent>

The components in this action row Source

type

nullable

type: MessageComponentType

The type of this component Source

data

data: MessageComponentOptions

The data for this component Source

id

readonly

id: number

The id of this component Source

Methods

addComponents

addComponents(components: Array<MessageActionRowComponentResolvable>): MessageActionRow

Adds components to the action row. Parameters

NameTypeDescription
componentsArray<MessageActionRowComponentResolvable>The components to add

Returns: MessageActionRowSource

setComponents

setComponents(components: Array<MessageActionRowComponentResolvable>): MessageActionRow

Sets the components of the action row. Parameters

NameTypeDescription
componentsArray<MessageActionRowComponentResolvable>The components to set

Returns: MessageActionRowSource

spliceComponents

spliceComponents(index: number, deleteCount: number, components?: Array<MessageActionRowComponentResolvable>): MessageActionRow

Removes, replaces, and inserts components in the action row. Parameters

NameTypeDescription
indexnumberThe index to start at
deleteCountnumberThe number of components to remove
components?Array<MessageActionRowComponentResolvable>The replacing components

Returns: MessageActionRowSource

toJSON

toJSON(): APIMessageComponent

Transforms the action row to a plain object. Returns: APIMessageComponent — The raw data of this action row Source

Unofficial software. Not affiliated with or supported by Discord.