class ActionRowBuilder

external
declare class ActionRowBuilder extends ComponentBuilder<APIActionRowComponent<APIComponentInActionRow>>

A builder that creates API-compatible JSON data for action rows.

Constructors

Creates a new action row from API data.

Examples:Creating an action row from an API data object:
const actionRow = new ActionRowBuilder({
	components: [
		{
			custom_id: "custom id",
			label: "Type something",
			style: TextInputStyle.Short,
			type: ComponentType.TextInput,
		},
	],
});
Creating an action row using setters and API data:
const actionRow = new ActionRowBuilder({
	components: [
		{
			custom_id: "custom id",
			label: "Click me",
			style: ButtonStyle.Primary,
			type: ComponentType.Button,
		},
	],
})
	.addComponents(button2, button3);

readonlyexternal
components : readonly AnyActionRowComponentBuilder[]

The components within this action row.

protectedreadonlyexternal
data : ActionRowBuilderData

external
addChannelSelectMenuComponent() : this

Adds a channel select menu component to this action row.

external
addComponents() : this

Generically add any type of component to this action row, only takes in an instance of a component builder.

external
addDangerButtonComponents() : this

Adds danger button components to this action row.

external
addLinkButtonComponents() : this

Adds URL button components to this action row.

external
addMentionableSelectMenuComponent() : this

Adds a mentionable select menu component to this action row.

external
addPremiumButtonComponents() : this

Adds SKU id button components to this action row.

external
addPrimaryButtonComponents() : this

Adds primary button components to this action row.

external
addRoleSelectMenuComponent() : this

Adds a role select menu component to this action row.

external
addSecondaryButtonComponents() : this

Adds secondary button components to this action row.

external
addStringSelectMenuComponent() : this

Adds a string select menu component to this action row.

external
addSuccessButtonComponents() : this

Adds success button components to this action row.

external
addTextInputComponent() : this

Adds a text input component to this action row.

external
addUserSelectMenuComponent() : this

Adds a user select menu component to this action row.

external
clearId() : this

Clears the id of this component, defaulting to a default incremented id.

Inherited from: ComponentBuilder

external
setId(
id: number
) : this

Sets the id of this component.

Inherited from: ComponentBuilder

external
spliceComponents(
index: number
deleteCount: number
) : this

Removes, replaces, or inserts components for this action row.

Examples:Remove the first component:
actionRow.spliceComponents(0, 1);
Remove the first n components:
const n = 4;
actionRow.spliceComponents(0, n);
Remove the last component:
actionRow.spliceComponents(-1, 1);

external
toJSON(
validationOverride?: boolean
) : APIActionRowComponent<APIComponentInActionRow>

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.