StringSelectOption
Represents an individual option for a string select menu.
Signature
export declare class StringSelectOptionJSDoc
Examples
const option = new StringSelectOption().setLabel("Option 1").setValue("option_1");Properties
1Methods
7Properties
data: Partial<APISelectMenuOption>;Methods
constructorConstructorconstructor(data?: Partial<APISelectMenuOption>);setLabel(label: string): this;Sets the label for the option. label - The label for the option.
Returns
The current StringSelectOption instance.
setValue(value: string): this;Sets the value for the option. value - The value for the option.
Returns
The current StringSelectOption instance.
setDescription(description: string): this;Sets the description for the option. description - The description for the option.
Returns
The current StringSelectOption instance.
setDefault(value?: boolean): this;Sets whether the option is the default. [value=true] - Indicates whether the option is the default.
Returns
The current StringSelectOption instance.
setEmoji(emoji: EmojiResolvable): this;Sets the emoji for the option.
Parameters
emoji- The emoji to set.
Returns
The modified option instance.
toJSON(): APISelectMenuOption;Converts the option to JSON format.
Returns
The option data in JSON format.