Select Menu

In this section you'll learn how to use the select menu component.
demonstration demonstration with options

Creating a new select menu

$newSelectMenu[interaction ID;min values to select;max values to select;placeholder;messageID(optional)]

  • interaction ID - it's used for $onInteraction[ID] callback. It works the same way as buttons
  • min values to select - minimum amount of values that can be selected
  • max values to select - maximum amount of values that can be selected
  • placeholder - it's a text that appears if no value is selected
  • messageID(optional) - ID of a message that should have select menu added to it. By default it's the bot's response.

Adding an option to select menu

$addSelectMenuOption[select menu's interaction ID;label;value;description;default (yes/no);emoji (can be left empty);messageID (optional)]

  • select menu's interaction ID - it has to be the same as the ID used in $newSelectMenu[]
  • label - the name of the option
  • value - it's the data that gets passed to $onInteraction[] callback. The value has to be unique in the select menu!
  • description - it shows up under the label
  • default (yes/no) - should the option be selected by default. There can be only one default option!
  • emoji - it shows up next to the label
  • messageID (optional) - same as in $newSelectMenu[]

Example

Select Menu code:
select menu code

Interaction code:
interaction code

Usage:
before using after using