SelectMenu
Represents a base class for building Select Menus.
Signature
export declare class SelectMenu<Select extends APISelectMenuComponent = APISelectMenuComponent> extends BaseComponentBuilder<Select>JSDoc
Examples
const selectMenu = new SelectMenu<APIUserSelectComponent>();
selectMenu.setCustomId("user-select-menu");
selectMenu.setPlaceholder("Select a user");@templateSelect - The type of APISelectMenuComponent.@templateInteraction - The type of interaction.
Properties
0No properties.
Methods
5Methods
setCustomId(id: string): this;Sets the custom ID for the select menu.
Parameters
id- The custom ID for the select menu.
Returns
The current SelectMenu instance.
setPlaceholder(placeholder: string): this;Sets the placeholder text for the select menu.
Parameters
placeholder- The placeholder text.
Returns
The current SelectMenu instance.
setValuesLength({ max, min }: Partial<OptionValuesLength>): this;Sets the maximum and minimum number of selected values for the select menu.
Parameters
options- The maximum and minimum values.
Returns
The current SelectMenu instance.
setDisabled(disabled?: boolean): this;Sets whether the select menu is disabled. [disabled=true] - Indicates whether the select menu is disabled.
Returns
The current SelectMenu instance.
setRequired(required?: boolean): this;Sets whether the select menu is required to answer in a modal. [required=true] - Indicates whether the select menu is required to answer in a modal.
Returns
The current SelectMenu instance.