Constructor
new SelectMenu()
- Source
Example
const { SelectMenu, SelectMenuTypes, SelectMenuOption } = require("interactions.js");
const select = new SelectMenu()
.setType(SelectMenuTypes.Text) // Set the type of the select menu
.setCustomId('customId') // Set the custom id of the select menu
.setPlaceholder('Cool Placeholder') // Set the placeholder of the select menu
.setMinValues(1) // Set the minimum values of the select menu
.setMaxValues(1) // Set the maximum values of the select menu
.addOptions([
new SelectMenuOption()
.setLabel('Option 1')
.setValue('option1')
.setDescription('Option 1 Description')
.setEmoji('👍')
.setDefault(true),
]) // Add options to the select menu
.setDisabled() // Set the disabled state of the select menu
Methods
addOption(option) → {SelectMenu}
add a single option to the select menu
Parameters:
Name | Type | Description |
---|---|---|
option | object |
- Source
Returns:
- Type:
- SelectMenu
addOptions(options) → {SelectMenu}
add options to the select menu
Parameters:
Name | Type | Description |
---|---|---|
options | array |
- Source
Returns:
- Type:
- SelectMenu
setChannelTypes(channelTypes) → {SelectMenu}
set the channel types that select menu is available in (only available for channel select menu)
Parameters:
Name | Type | Description |
---|---|---|
channelTypes | array |
- Source
Returns:
- Type:
- SelectMenu
setCustomId(customId) → {SelectMenu}
Set the custom id of the select menu
Parameters:
Name | Type | Description |
---|---|---|
customId | string |
- Source
Returns:
- Type:
- SelectMenu
setDefaultValues(defaultValues) → {SelectMenu}
set the default values of the select menu
Parameters:
Name | Type | Description |
---|---|---|
defaultValues | array |
- Source
Returns:
- Type:
- SelectMenu
setDisabled(disabled) → {SelectMenu}
set the disabled state of the select menu
Parameters:
Name | Type | Description |
---|---|---|
disabled | boolean |
- Source
Returns:
- Type:
- SelectMenu
setMaxValues(maxValues) → {SelectMenu}
set the maximum number of options that can be selected
Parameters:
Name | Type | Description |
---|---|---|
maxValues | number |
- Source
Returns:
- Type:
- SelectMenu
setMinValues(minValues) → {SelectMenu}
set the minimum number of options that must be selected
Parameters:
Name | Type | Description |
---|---|---|
minValues | number |
- Source
Returns:
- Type:
- SelectMenu
setOptions(options) → {SelectMenu}
set the options of the select menu
Parameters:
Name | Type | Description |
---|---|---|
options | array |
- Source
Returns:
- Type:
- SelectMenu
setPlaceholder(placeholder) → {SelectMenu}
set the placeholder of the select menu
Parameters:
Name | Type | Description |
---|---|---|
placeholder | string |
- Source
Returns:
- Type:
- SelectMenu
setType(type) → {SelectMenu}
Set the type of the select menu
Parameters:
Name | Type | Description |
---|---|---|
type | number |
- Source
Returns:
- Type:
- SelectMenu