Skip to content

SelectMenu

Implementation of the Discord SelectMenu class in Luau

https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure

SelectMenu.type  :: number

The type of select menu component. This will be a number that represents the type of select menu.

SelectMenu.customId  :: string

A developer-defined identifier for the select menu, max 100 characters.

SelectMenu.options  :: Option}?

Array of select menu options that users can choose from. Maximum of 25 items.

SelectMenu.apiTypes  :: ChannelType}?

List of channel types to include in the select menu. Only applicable for channel select menus.

SelectMenu.placeholder  :: string?

Custom placeholder text shown when no option is selected, max 150 characters.

SelectMenu.defaultValues  :: SelectMenuDefaultValue}?

Array of default values for auto-populated select menus.

SelectMenu.minValues  :: number?

The minimum number of items that must be chosen. Default 1, min 0, max 25.

SelectMenu.maxValues  :: number?

The maximum number of items that can be chosen. Default 1, max 25.

SelectMenu.disabled  :: boolean?

Whether this select menu is disabled. Defaults to false if not set.

SelectMenu : sync ( selectMenuData )  -> ()

Responsible for syncing data to this select menu object. This is typically called by the API when this object is created or updated.

Parameters

selectMenuData: SelectMenuComponentObject
SelectMenu . new ( selectMenuData )  -> SelectMenu

Responsible for constructing this class.

Parameters

selectMenuData: SelectMenuComponentObject

Returns

SelectMenu