Search...

SelectMenuOptionBuilder

export declare class SelectMenuOptionBuilder implements JSONEncodable<APISelectMenuOption> 
export declare class SelectMenuOptionBuilder implements JSONEncodable<APISelectMenuOption> 
Represents a option within a select menu component

Implements

JSONEncodable<APISelectMenuOption>

constructor(data?)

Constructs a new instance of the SelectMenuOptionBuilder class
NameTypeOptionalDescription
dataPartial<APISelectMenuOption>YesNone

data

:

Partial<APISelectMenuOption>

setDefault(isDefault?)

:

this

Sets whether this option is selected by default
NameTypeOptionalDescription
isDefaultbooleanYesWhether this option is selected by default

setDescription(description)

:

this

Sets the description of this option
NameTypeOptionalDescription
descriptionstringNoThe description of this option

setEmoji(emoji)

:

this

Sets the emoji to display on this option
NameTypeOptionalDescription
emojiAPIMessageComponentEmojiNoThe emoji to display on this option

setLabel(label)

:

this

Sets the label of this option
NameTypeOptionalDescription
labelstringNoThe label to show on this option

setValue(value)

:

this

Sets the value of this option
NameTypeOptionalDescription
valuestringNoThe value of this option

toJSON()

:

APISelectMenuOption

Serializes this component to an API-compatible JSON object
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.