A builder that creates API-compatible JSON data for modals.
Creates a new modal from API data.
Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APIModalInteractionResponseCallbackData> | Yes | The API data to create this modal with |
Adds action rows to this modal.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)> | No | The components to add |
Sets the action rows for this modal.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder)> | No | The components to set |
Sets the custom id of this modal.
Name | Type | Optional | Description |
---|---|---|---|
customId | string | No | The custom id to use |
Sets the title of this modal.
Name | Type | Optional | Description |
---|---|---|---|
title | string | No | The title to use |
Removes, replaces, or inserts action rows for this modal.
Remarks
This method behaves similarly to Array.prototype.splice(). The maximum amount of action rows that can be added is 5.It's useful for modifying and adjusting order of the already-existing action rows of a modal.Example
Remove the first action row:Example
Remove the first n action rows:Example
Remove the last action row:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of action rows to remove |
...rows | (ActionRowBuilder | APIActionRowComponent<APIModalActionRowComponent> | ((builder: ActionRowBuilder) => ActionRowBuilder))[] | No | The replacing action row 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 |