Option
Implementation of the Application Command Option Structure in Luau.
Properties
type
The type of option (e.g., String, Integer, SubCommand).
name
The name of the option.
nameLocalizations
{ [apiTypes.LanguageLocales]: string } }
Name localizations for different language locales.
description
The description of the option.
descriptionLocalizations
{ [apiTypes.LanguageLocales]: string } }
Description localizations for different language locales.
required
Whether this option is required to be set by the user.
choices
Possible choices for this option (String, Integer, or Number types only).
options
Sub-options for this option (SubCommand or SubCommandGroup only).
apiTypes
Supported channel types for Channel option type.
minValue
Minimum value allowed for the option (Integer/Number only).
maxValue
Maximum value allowed for the option (Integer/Number only).
minLength
Minimum string length for the option (String only).
maxLength
Maximum string length for the option (String only).
autocomplete
Whether autocomplete is enabled (String, Integer, or Number types only).
Methods
The Option instance has no set methods!
Functions
setType
Option . setType () -> ()
self: Option
type: apiTypes.ApplicationCommandOptionType
Set the Type of option that will be built.
setName
Option . setName () -> ()
self: Option
name: string
Set the name of this option, option name needs to be kebab case.
setNameLocalization
Option . setNameLocalization () -> ()
self: Option
localization: apiTypes.LanguageLocales
name: string
Add a name localization for this option.
setDescription
Option . setDescription () -> ()
self: Option
description: string
Set the description of this option.
setDescriptionLocalization
Option . setDescriptionLocalization () -> ()
self: Option
localization: apiTypes.LanguageLocales
description: string
Add a description localization for this option.
setRequired
Option . setRequired () -> ()
self: Option
isRequired: boolean
Set if the option is required, will not work on SubCommand or SubCommandGroup options.
addChoice
Option . addChoice () -> ()
self: Option
choice: interactionChoice.JSON
Add a choice to the option, will only work on String, Integer, or Number options.
addOption
Option . addOption () -> ()
self: Option
option: JSON
Add an option to the option, will only work on SubCommand or SubCommandGroup options.
addChannelType
Option . addChannelType () -> ()
self: Option
channelType: apiTypes.ChannelType
Add supported channel types, will only work on Channel options.
setMinValue
Option . setMinValue () -> ()
self: Option
value: number
Set the min value of this option, will only work on Integer or Number options.
setMaxValue
Option . setMaxValue () -> ()
self: Option
value: number
Set the max value of this option, will only work on Integer or Number options.
setMinLength
Option . setMinLength () -> ()
self: Option
value: number
Set the min length of this option, will only work on String options.
setMaxLength
Option . setMaxLength () -> ()
self: Option
value: number
Set the max length of this option, will only work on String options.
setAutocompleteEnabled
Option . setAutocompleteEnabled () -> ()
self: Option
autocompleteEnabled: boolean
If autocomplete interactions are enabled for this option, will only work on String, Integer, or Number options.
build
Option . build () -> ()
self: Option
Responsible for building the option object that the Discord API can understand.
new
Option . new () -> ()
resource: {
type: apiTypes.ApplicationCommandOptionType?,
name: string?,
nameLocalizations: { [apiTypes.LanguageLocales],
}
Constructor for the Discord Default Reaction Builder.