StringSelectMenu
Represents a Select Menu for selecting string options.
Signature
export declare class StringSelectMenu<Value extends string = string> extends SelectMenu<APIStringSelectComponent<Value>>Private types
StringSelectOptionResolvableTypeAlias
type StringSelectOptionResolvable<Value extends string = string> = StringSelectOption | APISelectMenuOption<Value>;JSDoc
Examples
const stringSelectMenu = new StringSelectMenu();
stringSelectMenu.setCustomId("string-select");
stringSelectMenu.addOption(new StringSelectOption().setLabel("Option 1").setValue("option_1"));
stringSelectMenu.setOptions([
{ label: "Option 2", value: "option_2" },
{ label: "Option 3", value: "option_3" },
]);Properties
1Methods
5Properties
data: Omit<Partial<APIStringSelectComponent<Value>>, 'options'> & { options: StringSelectOption[];};Methods
constructorConstructorconstructor(data?: Partial<APIStringSelectComponent<Value>>);addOption(...options: RestOrArray<StringSelectOptionResolvable<Value>>): this;Adds options to the string select menu.
Parameters
options- Options to be added.
Returns
The current StringSelectMenu instance.
setOptions(...options: RestOrArray<StringSelectOptionResolvable<Value>>): this;Sets the options for the string select menu. options - Options to be set.
Returns
The current StringSelectMenu instance.
setRequired(required?: boolean): this;Sets whether the string select is required to answer in a modal.
Parameters
required- Whether the string select is required to answer in a modal.
Returns
The current StringSelectMenu instance.
toJSON(): APIStringSelectComponent<Value>;