Skip to content

SelectMenu

Implementation of discords SelectMenu object as a Luau builder.

https://discord.com/developers/docs/interactions/message-components#SelectMenus

SelectMenu.defaultValues  :: SelectMenuDefaultValue}

Array of default values for auto-populated select menu components

SelectMenu.options  :: SelectMenuOption}

Array of select menu options

SelectMenu.apiTypes  :: ChannelType}

Array of channel types that can be selected

SelectMenu : setType ( selectMenuType )  -> SelectMenu

Sets the type of select menu component to be created.

Parameters

selectMenuType: SelectMenuType

Returns

SelectMenu
SelectMenu : setCustomId ( customId )  -> SelectMenu

Sets a developer-defined identifier for the select menu.

Parameters

customId: string

Returns

SelectMenu
SelectMenu : setPlaceholder ( placeholder )  -> SelectMenu

Sets custom placeholder text shown when no option is selected.

Parameters

placeholder: string

Returns

SelectMenu
SelectMenu : setMinValues ( minValueCount )  -> SelectMenu

Sets the minimum number of items that must be selected.

Parameters

minValueCount: number

Returns

SelectMenu
SelectMenu : setMaxValues ( maxValueCount )  -> SelectMenu

Sets the maximum number of items that can be selected.

Parameters

maxValueCount: number

Returns

SelectMenu
SelectMenu : setDisabled ( disabled )  -> SelectMenu

Sets whether the select menu is disabled or not.

Parameters

disabled: boolean

Returns

SelectMenu
SelectMenu : addDefaultValue ( defaultValue )  -> SelectMenu

Adds a default value to the select menu.

Parameters

defaultValue: JSON

Returns

SelectMenu
SelectMenu : addChannelType ( channelType )  -> SelectMenu

Adds a channel type that can be selected in the menu.

Parameters

channelType: ChannelType

Returns

SelectMenu
SelectMenu : addOption ( option )  -> SelectMenu

Adds an option to the select menu.

Parameters

option: JSON

Returns

SelectMenu
SelectMenu : build ( )  -> JSON

Responsible for building the SelectMenu JSON that can be parsed by the Discord API.

Returns

JSON
SelectMenu . new ( resource )  -> SelectMenu

Responsible for creating a new SelectMenu.

Parameters

resource: {
type: apiTypes.SelectMenuType?,
customId: string?,
options: { option.JSON,
}

Returns

SelectMenu