Skip to content

ActionRow

Represents an Action Row component in a message.

Extends

Type parameters

Type parameterDescription
T extends BuilderComponentsThe type of components in the Action Row.

Constructors

new ActionRow(data)

1
new ActionRow<T>(data: Partial<APIActionRowComponent<APIActionRowComponentTypes>>): ActionRow<T>

Creates a new instance of the ActionRow class.

Parameters

ParameterTypeDescription
dataPartial<APIActionRowComponent<APIActionRowComponentTypes>>Optional data to initialize the Action Row.

Returns

ActionRow<T>

Overrides

BaseComponentBuilder.constructor

Example

1
const actionRow = new ActionRow<Button>({ components: [buttonRawJSON] });

Source

seyfert/src/builders/ActionRow.ts:25

Properties

PropertyModifierTypeInherited from
componentspublicFixedComponents<T>[]-
datapublicPartial<APIActionRowComponent<APIActionRowComponentTypes>>BaseComponentBuilder.data

Methods

addComponents()

1
addComponents(...component: RestOrArray<FixedComponents<T>>): this

Adds one or more components to the Action Row.

Parameters

ParameterTypeDescription
componentRestOrArray<FixedComponents<T>>The component(s) to add.

Returns

this

The updated Action Row instance.

Example

1
actionRow.addComponents(buttonComponent);
2
actionRow.addComponents(buttonComponent1, buttonComponent2);
3
actionRow.addComponents([buttonComponent1, buttonComponent2]);

Source

seyfert/src/builders/ActionRow.ts:41


setComponents()

1
setComponents(component: FixedComponents<T>[]): this

Sets the components of the Action Row.

Parameters

ParameterTypeDescription
componentFixedComponents<T>[]The components to set.

Returns

this

The updated Action Row instance.

Example

1
actionRow.setComponents([buttonComponent1, buttonComponent2]);

Source

seyfert/src/builders/ActionRow.ts:53


toJSON()

1
toJSON(): APIActionRowComponent<APIMessageActionRowComponent>

Converts the Action Row to its JSON representation.

Returns

APIActionRowComponent<APIMessageActionRowComponent>

The JSON representation of the Action Row.

Overrides

BaseComponentBuilder.toJSON

Source

seyfert/src/builders/ActionRow.ts:62