SelectMenuOption
Implementation of discords Option object as a Luau builder.
https://discord.com/developers/docs/interactions/message-components#Options
Summary
Properties
SelectMenuOption.label :: string?SelectMenuOption.value :: string?SelectMenuOption.description :: string?SelectMenuOption.emoji :: Builders.Emoji?SelectMenuOption.default :: boolean?Methods
SelectMenuOption:setLabel(label: string) → OptionSelectMenuOption:setValue(value: string) → OptionSelectMenuOption:setDescription(description: string) → OptionSelectMenuOption:setEmoji(emoji: emoji.JSON) → OptionSelectMenuOption:setDefault(default: boolean) → OptionSelectMenuOption:build() → JSONProperties
Section titled “Properties”The user-facing name of the option.
The dev-defined value of the option.
description
Section titled “description”An additional description of the option.
The emoji to display alongside the option.
default
Section titled “default”Whether this option is selected by default.
Methods
Section titled “Methods”setLabel
Section titled “setLabel”SelectMenuOption : setLabel ( label ) -> Option
Sets the user-facing name of the option.
Parameters
| label: string |
Returns
| Option |
setValue
Section titled “setValue”SelectMenuOption : setValue ( value ) -> Option
Sets the dev-defined value of the option.
Parameters
| value: string |
Returns
| Option |
setDescription
Section titled “setDescription”SelectMenuOption : setDescription ( description ) -> Option
Sets an additional description of the option.
Parameters
| description: string |
Returns
| Option |
setEmoji
Section titled “setEmoji”SelectMenuOption : setEmoji ( emoji ) -> Option
Sets an emoji to display alongside the option.
Parameters
| emoji: JSON |
Returns
| Option |
setDefault
Section titled “setDefault”SelectMenuOption : setDefault ( default ) -> Option
Sets whether this option is selected by default.
Parameters
| default: boolean |
Returns
| Option |
SelectMenuOption : build ( ) -> JSON
Responsible for building the Option JSON that can be parsed by the Discord API.
Returns
| JSON |
Functions
Section titled “Functions”SelectMenuOption . new ( resource ) -> Option
Responsible for creating a new Option.
local option = Option.new({ label = "My Option", value = "option_value", description = "A description", default = false})Parameters
| resource: { label: string?, value: string?, description: string?, emoji: emoji.JSON?, default: boolean?, } |
Returns
| Option |