A builder that creates API-compatible JSON data for string select menus.
Creates a new select menu from API data.
Example
Creating a select menu from an API data object:Example
Creating a select menu using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APIStringSelectComponent> | Yes | The API data to create this select menu with |
Adds options to this select menu.
Name | Type | Optional | Description |
---|---|---|---|
...options | RestOrArray<APISelectMenuOption | StringSelectMenuOptionBuilder | ((builder: StringSelectMenuOptionBuilder) => StringSelectMenuOptionBuilder)> | No | The options to add |
Clears the placeholder for this select menu.
Inherited from BaseSelectMenuBuilderSets the custom id for this select menu.
Name | Type | Optional | Description |
---|---|---|---|
customId | string | No | The custom id to use |
Sets whether this select menu is disabled.
Name | Type | Optional | Description |
---|---|---|---|
disabled | boolean | Yes | Whether this select menu is disabled |
Sets the maximum values that must be selected in the select menu.
Name | Type | Optional | Description |
---|---|---|---|
maxValues | number | No | The maximum values that must be selected |
Sets the minimum values that must be selected in the select menu.
Name | Type | Optional | Description |
---|---|---|---|
minValues | number | No | The minimum values that must be selected |
Sets the options for this select menu.
Name | Type | Optional | Description |
---|---|---|---|
...options | RestOrArray<APISelectMenuOption | StringSelectMenuOptionBuilder | ((builder: StringSelectMenuOptionBuilder) => StringSelectMenuOptionBuilder)> | No | The options to set |
Sets the placeholder for this select menu.
Name | Type | Optional | Description |
---|---|---|---|
placeholder | string | No | The placeholder to use |
Removes, replaces, or inserts options for this select menu.
Remarks
This method behaves similarly to Array.prototype.splice(). It's useful for modifying and adjusting the order of existing options.Example
Remove the first option:Example
Remove the first n option:Example
Remove the last option:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of options to remove |
...options | (APISelectMenuOption | StringSelectMenuOptionBuilder | ((builder: StringSelectMenuOptionBuilder) => StringSelectMenuOptionBuilder))[] | No | The replacing option objects or builders |
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 |