Skip to content

SelectMenuBuilder

SelectMenuBuilder

It’s a class that allows you to build a SelectMenu object that can be sent to Discord

Kind: global class

selectMenuBuilder.type : number

The type of the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: 3

selectMenuBuilder.custom_id : string

The custom ID of the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: “null”

selectMenuBuilder.placeholder : string

The placeholder text of the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: “null”

selectMenuBuilder.options : Array.<Object>

The options of the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: []

selectMenuBuilder.min_values : number

The minimum number of options that can be selected in the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: null

selectMenuBuilder.max_values : number

The maximum number of options that can be selected in the SelectMenu

Kind: instance property of SelectMenuBuilder
Default: null

selectMenuBuilder.disabled : boolean

Whether the SelectMenu is disabled or not

Kind: instance property of SelectMenuBuilder
Default: false

selectMenuBuilder.setCustomId(customId) ⇒ SelectMenuBuilder

Set the custom ID of the SelectMenu

Kind: instance method of SelectMenuBuilder

ParamTypeDescription
customIdstringThe custom ID to set

selectMenuBuilder.setPlaceholder(placeholder) ⇒ SelectMenuBuilder

Set the placeholder text of the SelectMenu

Kind: instance method of SelectMenuBuilder

ParamTypeDescription
placeholderstringThe placeholder text to set

selectMenuBuilder.addOption(label, value, [description], [emoji]) ⇒ SelectMenuBuilder

Add an option to the SelectMenu

Kind: instance method of SelectMenuBuilder

ParamTypeDefaultDescription
labelstringThe label text of the option
valuestringThe value of the option
[description]stringnullThe description of the option
[emoji]stringnullThe emoji of the option

selectMenuBuilder.setMinValues(minValues) ⇒ SelectMenuBuilder

Set the minimum number of options that can be selected in the SelectMenu

Kind: instance method of SelectMenuBuilder

ParamTypeDescription
minValuesnumberThe minimum number of options to set

selectMenuBuilder.setMaxValues(maxValues) ⇒ SelectMenuBuilder

Set the maximum number of options that can be selected in the SelectMenu

Kind: instance method of SelectMenuBuilder

ParamTypeDescription
maxValuesnumberThe maximum number of options to set

selectMenuBuilder.setDisabled(disabled) ⇒ SelectMenuBuilder

Set whether the SelectMenu is disabled or not

Kind: instance method of SelectMenuBuilder

ParamTypeDescription
disabledbooleanWhether the SelectMenu is disabled or not

selectMenuBuilder.build() ⇒ Object

Build the SelectMenu object

Kind: instance method of SelectMenuBuilder
Returns: Object - The SelectMenu object that can be sent to Discord