SelectMenu
Represents a base class for building Select Menus.
Example
1const selectMenu = new SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction>();2selectMenu.setCustomId("user-select-menu");3selectMenu.setPlaceholder("Select a user");4selectMenu.run((interaction) => {5 // Handle select menu interaction6});
Extends
BaseComponentBuilder
<Select
>
Type parameters
Type parameter | Value | Description |
---|---|---|
Select extends APISelectMenuComponent | APISelectMenuComponent | The type of APISelectMenuComponent. |
Interaction | ComponentInteraction | The type of interaction. |
Constructors
new SelectMenu(data)
1new SelectMenu<Select, Interaction>(data: Partial<Select>): SelectMenu<Select, Interaction>
Parameters
Parameter | Type |
---|---|
data | Partial <Select > |
Returns
SelectMenu
<Select
, Interaction
>
Inherited from
BaseComponentBuilder
.constructor
Source
seyfert/src/builders/Base.ts:6
Properties
Property | Modifier | Type | Inherited from |
---|---|---|---|
data | public | Partial <Select > | BaseComponentBuilder .data |
Methods
setCustomId()
1setCustomId(id: string): this
Sets the custom ID for the select menu.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The custom ID for the select menu. |
Returns
this
The current SelectMenu instance.
Source
seyfert/src/builders/SelectMenu.ts:71
setDisabled()
1setDisabled(disabled: boolean): this
Sets whether the select menu is disabled. [disabled=true] - Indicates whether the select menu is disabled.
Parameters
Parameter | Type | Default value |
---|---|---|
disabled | boolean | true |
Returns
this
The current SelectMenu instance.
Source
seyfert/src/builders/SelectMenu.ts:102
setPlaceholder()
1setPlaceholder(placeholder: string): this
Sets the placeholder text for the select menu.
Parameters
Parameter | Type | Description |
---|---|---|
placeholder | string | The placeholder text. |
Returns
this
The current SelectMenu instance.
Source
seyfert/src/builders/SelectMenu.ts:81
setValuesLength()
1setValuesLength(options: Partial<OptionValuesLength>): this
Sets the maximum and minimum number of selected values for the select menu.
Parameters
Parameter | Type | Description |
---|---|---|
options | Partial <OptionValuesLength > | The maximum and minimum values. |
Returns
this
The current SelectMenu instance.
Source
seyfert/src/builders/SelectMenu.ts:91
toJSON()
1toJSON(): Select
Returns
Select