$addSelectMenu

Adds a select menu to this action row.

Usage

$addSelectMenu[customID;placeholder;minValues;maxValues;disabled]

This function has five parms.

ParamDescriptionTypeRequired

customID

The customID of this select menu.

String

Yes

placeholder

The select menu's placeholder.

String

Yes

minValues

The minimum amount of options that the user can select.

Integer

Yes

maxValues

The maximum amount of options that the user can select.

Integer

Yes

disabled

Whether this select menu should be disabled or not.

Boolean

Yes

  • Select menus must be sent inside an action row (refer to $addActionRow).

  • An action row can contain only one select menu.

  • An action row containing a select menu cannot also contain buttons.

Don't forget to add the onInteraction event to your main file. For example:

bot.addEvent([
    "onMessage",
    "onInteraction" //This is what you need to add
])

Example

bot.commands.add({
    type: "basicCommand",
    name: "menu", 
    code: `A menu!
    $addActionRow
    $addSelectMenu[menu_1;Hi;1;1]
    $addSelectMenuOption[hi;im uwu;hi]
    $addSelectMenuOption[fiction;nice stuff;fiction]`
})

bot.commands.add({    
    type: "selectMenuCommand",
    code: `Interaction Value: $interactionValues | Interaction ID: $interactionID`
})

Click here for more info about$addSelectMenuOption[]

Last updated