Skip to content

SelectMenu

Represents a base class for building Select Menus.

Example

1
const selectMenu = new SelectMenu<APIUserSelectComponent, UserSelectMenuInteraction>();
2
selectMenu.setCustomId("user-select-menu");
3
selectMenu.setPlaceholder("Select a user");
4
selectMenu.run((interaction) => {
5
// Handle select menu interaction
6
});

Extends

Type parameters

Type parameterValueDescription
Select extends APISelectMenuComponentAPISelectMenuComponentThe type of APISelectMenuComponent.
InteractionComponentInteractionThe type of interaction.

Constructors

new SelectMenu(data)

1
new SelectMenu<Select, Interaction>(data: Partial<Select>): SelectMenu<Select, Interaction>

Parameters

ParameterType
dataPartial<Select>

Returns

SelectMenu<Select, Interaction>

Inherited from

BaseComponentBuilder.constructor

Source

seyfert/src/builders/Base.ts:6

Properties

PropertyModifierTypeInherited from
datapublicPartial<Select>BaseComponentBuilder.data

Methods

setCustomId()

1
setCustomId(id: string): this

Sets the custom ID for the select menu.

Parameters

ParameterTypeDescription
idstringThe custom ID for the select menu.

Returns

this

The current SelectMenu instance.

Source

seyfert/src/builders/SelectMenu.ts:71


setDisabled()

1
setDisabled(disabled: boolean): this

Sets whether the select menu is disabled. [disabled=true] - Indicates whether the select menu is disabled.

Parameters

ParameterTypeDefault value
disabledbooleantrue

Returns

this

The current SelectMenu instance.

Source

seyfert/src/builders/SelectMenu.ts:102


setPlaceholder()

1
setPlaceholder(placeholder: string): this

Sets the placeholder text for the select menu.

Parameters

ParameterTypeDescription
placeholderstringThe placeholder text.

Returns

this

The current SelectMenu instance.

Source

seyfert/src/builders/SelectMenu.ts:81


setValuesLength()

1
setValuesLength(options: Partial<OptionValuesLength>): this

Sets the maximum and minimum number of selected values for the select menu.

Parameters

ParameterTypeDescription
optionsPartial<OptionValuesLength>The maximum and minimum values.

Returns

this

The current SelectMenu instance.

Source

seyfert/src/builders/SelectMenu.ts:91


toJSON()

1
toJSON(): Select

Returns

Select

Inherited from

BaseComponentBuilder.toJSON

Source

seyfert/src/builders/Base.ts:8