Represents a string select menu component
Creates a new select menu from API data
Example
Creating a select menu from an API data objectExample
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 |
The API data associated with this component
Inherited from ComponentBuilderAdds options to this select menu
Returns
| Name | Type | Optional | Description |
|---|---|---|---|
| options | RestOrArray<APISelectMenuOption | StringSelectMenuOptionBuilder> | No | The options to add to this select menu |
Sets the custom id for this select menu
| Name | Type | Optional | Description |
|---|---|---|---|
| customId | string | No | The custom id to use for this select menu |
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 on this select menu
| Name | Type | Optional | Description |
|---|---|---|---|
| options | RestOrArray<APISelectMenuOption | StringSelectMenuOptionBuilder> | No | The options to set on this select menu |
Sets the placeholder for this select menu
| Name | Type | Optional | Description |
|---|---|---|---|
| placeholder | string | No | The placeholder to use for this select menu |
Removes, replaces, or inserts options in the string select menu.
Remarks
This method behaves similarly to Array.prototype.splice.It's useful for modifying and adjusting order of the already-existing options of a string select menu.Example
Remove the first optionExample
Remove the first n optionExample
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 | RestOrArray<APISelectMenuOption | StringSelectMenuOptionBuilder> | No | The replacing option objects or builders |
Serializes this component to an API-compatible JSON object