SelectMenuBuilder

Represents a select menu component
export declare class SelectMenuBuilder extends ComponentBuilder<APISelectMenuComponent> 

constructor(data?)

Constructs a new instance of the SelectMenuBuilder class
NameTypeOptionalDescription
dataPartial<APISelectMenuComponent>YesNone
Readonly

data

:

Partial<DataType>

The API data associated with this component
Inherited from ComponentBuilder
Readonly
The options within this select menu

addOptions(options)

:

this

Adds options to this select menu
NameTypeOptionalDescription
optionsRestOrArray<SelectMenuOptionBuilder | APISelectMenuOption>No
The options to add to this select menu

setCustomId(customId)

:

this

Sets the custom id for this select menu
NameTypeOptionalDescription
customIdstringNo
The custom id to use for this select menu

setDisabled(disabled?)

:

this

Sets whether this select menu is disabled
NameTypeOptionalDescription
disabledbooleanYes
Whether this select menu is disabled

setMaxValues(maxValues)

:

this

Sets the maximum values that must be selected in the select menu
NameTypeOptionalDescription
maxValuesnumberNo
The maximum values that must be selected

setMinValues(minValues)

:

this

Sets the minimum values that must be selected in the select menu
NameTypeOptionalDescription
minValuesnumberNo
The minimum values that must be selected

setOptions(options)

:

this

Sets the options on this select menu
NameTypeOptionalDescription
optionsRestOrArray<SelectMenuOptionBuilder | APISelectMenuOption>No
The options to set on this select menu

setPlaceholder(placeholder)

:

this

Sets the placeholder for this select menu
NameTypeOptionalDescription
placeholderstringNo
The placeholder to use for this select menu
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.