A builder that creates API-compatible JSON data for action rows.
Creates a new action row from API data.
Example
Creating an action row from an API data object:Example
Creating an action row using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APIActionRowComponent<APIActionRowComponentTypes>> | Yes | The API data to create this action row with |
Adds a channel select menu component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APIChannelSelectComponent | ChannelSelectMenuBuilder | ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Generically add any type of component to this action row, only takes in an instance of a component builder.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<AnyActionRowComponentBuilder> | No | None |
Adds danger button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithCustomId | DangerButtonBuilder | ((builder: DangerButtonBuilder) => DangerButtonBuilder)> | No | None |
Adds URL button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithURL | LinkButtonBuilder | ((builder: LinkButtonBuilder) => LinkButtonBuilder)> | No | The buttons to add |
Adds a mentionable select menu component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APIMentionableSelectComponent | MentionableSelectMenuBuilder | ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Adds SKU id button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithSKUId | PremiumButtonBuilder | ((builder: PremiumButtonBuilder) => PremiumButtonBuilder)> | No | The buttons to add |
Adds primary button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithCustomId | PrimaryButtonBuilder | ((builder: PrimaryButtonBuilder) => PrimaryButtonBuilder)> | No | The buttons to add |
Adds a role select menu component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Adds secondary button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithCustomId | SecondaryButtonBuilder | ((builder: SecondaryButtonBuilder) => SecondaryButtonBuilder)> | No | The buttons to add |
Adds a string select menu component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APIStringSelectComponent | StringSelectMenuBuilder | ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Adds success button components to this action row.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIButtonComponentWithCustomId | SuccessButtonBuilder | ((builder: SuccessButtonBuilder) => SuccessButtonBuilder)> | No | The buttons to add |
Adds a text input component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder) | No | A function that returns a component builder or an already built builder |
Adds a user select menu component to this action row.
Name | Type | Optional | Description |
---|---|---|---|
input | APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder) | No | A function that returns a component builder or an already built builder |
Removes, replaces, or inserts components for this action row.
Remarks
This method behaves similarly to Array.prototype.splice().It's useful for modifying and adjusting order of the already-existing components of an action row.Example
Remove the first component:Example
Remove the first n components:Example
Remove the last component:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of components to remove |
...components | AnyActionRowComponentBuilder[] | No | The replacing component objects |
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
Name | Type | Optional | Description |
---|---|---|---|
validationOverride | boolean | Yes | Force validation to run/not run regardless of your global preference |