SelectMenu
Implementation of discords SelectMenu object as a Luau builder.
https://discord.com/developers/docs/interactions/message-components#SelectMenus
Summary
Properties
SelectMenu.defaultValues :: {Builders.Message.SelectMenuDefaultValue}SelectMenu.options :: {Builders.Message.SelectMenuOption}SelectMenu.apiTypes :: {api_types.ChannelType}Methods
SelectMenu:setType(selectMenuType: apiTypes.SelectMenuType) → SelectMenuSelectMenu:setCustomId(customId: string) → SelectMenuSelectMenu:setPlaceholder(placeholder: string) → SelectMenuSelectMenu:setMinValues(minValueCount: number) → SelectMenuSelectMenu:setMaxValues(maxValueCount: number) → SelectMenuSelectMenu:setDisabled(disabled: boolean) → SelectMenuSelectMenu:addDefaultValue(defaultValue: defaultValue.JSON) → SelectMenuSelectMenu:addChannelType(channelType: apiTypes.ChannelType) → SelectMenuSelectMenu:addOption(option: option.JSON) → SelectMenuSelectMenu:build() → JSONProperties
Section titled “Properties”defaultValues
Section titled “defaultValues”Array of default values for auto-populated select menu components
options
Section titled “options”Array of select menu options
apiTypes
Section titled “apiTypes”Array of channel types that can be selected
Methods
Section titled “Methods”setType
Section titled “setType”SelectMenu : setType ( selectMenuType ) -> SelectMenu
Sets the type of select menu component to be created.
Parameters
| selectMenuType: SelectMenuType |
Returns
| SelectMenu |
setCustomId
Section titled “setCustomId”SelectMenu : setCustomId ( customId ) -> SelectMenu
Sets a developer-defined identifier for the select menu.
Parameters
| customId: string |
Returns
| SelectMenu |
setPlaceholder
Section titled “setPlaceholder”SelectMenu : setPlaceholder ( placeholder ) -> SelectMenu
Sets custom placeholder text shown when no option is selected.
Parameters
| placeholder: string |
Returns
| SelectMenu |
setMinValues
Section titled “setMinValues”SelectMenu : setMinValues ( minValueCount ) -> SelectMenu
Sets the minimum number of items that must be selected.
Parameters
| minValueCount: number |
Returns
| SelectMenu |
setMaxValues
Section titled “setMaxValues”SelectMenu : setMaxValues ( maxValueCount ) -> SelectMenu
Sets the maximum number of items that can be selected.
Parameters
| maxValueCount: number |
Returns
| SelectMenu |
setDisabled
Section titled “setDisabled”SelectMenu : setDisabled ( disabled ) -> SelectMenu
Sets whether the select menu is disabled or not.
Parameters
| disabled: boolean |
Returns
| SelectMenu |
addDefaultValue
Section titled “addDefaultValue”SelectMenu : addDefaultValue ( defaultValue ) -> SelectMenu
Adds a default value to the select menu.
Parameters
| defaultValue: JSON |
Returns
| SelectMenu |
addChannelType
Section titled “addChannelType”SelectMenu : addChannelType ( channelType ) -> SelectMenu
Adds a channel type that can be selected in the menu.
Parameters
| channelType: ChannelType |
Returns
| SelectMenu |
addOption
Section titled “addOption”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 |
Functions
Section titled “Functions”SelectMenu . new ( resource ) -> SelectMenu
Responsible for creating a new SelectMenu.
Parameters
| resource: { type: apiTypes.SelectMenuType?, customId: string?, options: { option.JSON, } |
Returns
| SelectMenu |