declare class StringSelectMenuOptionBuilder implements JSONEncodable<APISelectMenuOption>A builder that creates API-compatible JSON data for string select menu options.
Constructors
externalconstructor(data?: Partial<APISelectMenuOption>)
data?: Partial<APISelectMenuOption>
Creates a new string select menu option.
Examples:Creating a string select menu option from an API data object:Creating a string select menu option using setters and API data:
const selectMenuOption = new SelectMenuOptionBuilder({
label: 'catchy label',
value: '1',
});const selectMenuOption = new SelectMenuOptionBuilder({
default: true,
value: '1',
})
.setLabel('woah');external setDefault(isDefault?: boolean) : this
isDefault?: boolean
Sets whether this option is selected by default.
external setDescription(description: string) : this
description: string
Sets the description for this option.
external setEmoji(emoji: APIMessageComponentEmoji) : this
emoji: APIMessageComponentEmoji
Sets the emoji to display for this option.
external setLabel(label: string) : this
label: string
Sets the label for this option.
external setValue(value: string) : this
value: string
Sets the value for this option.
external toJSON(validationOverride?: boolean) : APISelectMenuOption
validationOverride?: boolean
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.