ActionRowBuilder
declare class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>
declare class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>
Represents an action row component
Extends
ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>>Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
T | AnyComponentBuilder | No | The types of components this action row holds |
constructor({ components, ...data }?)
Creates a new action row from API data
Example
Creating an action row from an API data objectconst actionRow = new ActionRowBuilder({
components: [
{
custom_id: "custom id",
label: "Type something",
style: TextInputStyle.Short,
type: ComponentType.TextInput,
},
],
});
const actionRow = new ActionRowBuilder({
components: [
{
custom_id: "custom id",
label: "Type something",
style: TextInputStyle.Short,
type: ComponentType.TextInput,
},
],
});
Example
Creating an action row using setters and API dataconst actionRow = new ActionRowBuilder({
components: [
{
custom_id: "custom id",
label: "Click me",
style: ButtonStyle.Primary,
type: ComponentType.Button,
},
],
})
.addComponents(button2, button3);
const actionRow = new ActionRowBuilder({
components: [
{
custom_id: "custom id",
label: "Click me",
style: ButtonStyle.Primary,
type: ComponentType.Button,
},
],
})
.addComponents(button2, button3);
Name | Type | Optional | Description |
---|---|---|---|
{ components, ...data } | Partial<APIActionRowComponent<APIActionRowComponentTypes>> | Yes | None |
Readonly
components
:
T[]
The components within this action row
Readonly
data
:
Partial<DataType>
The API data associated with this component
Inherited from ComponentBuilderaddComponents(components)
:
this
Adds components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
components | RestOrArray<T> | No | The components to add to this action row. |
setComponents(components)
:
this
Sets the components in this action row
Name | Type | Optional | Description |
---|---|---|---|
components | RestOrArray<T> | No | The components to set this row to |
toJSON()
:
APIActionRowComponent<ReturnType<T['toJSON']>>
Serializes this component to an API-compatible JSON object