Skip to content

Choice

Implementation of the Application Command Option Choice Structure in Luau.

https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure

Properties

The Choice instance has no set properties!

Methods

The Choice instance has no set methods!

Functions

setName

Choice . setName (

     self: Choice
     name: string
)  -> ()

Responsible for setting the name of the choice. Name must be kebab case, with 1-100 characters.

setNameLocalization

Choice . setNameLocalization (

     self: Choice
     localization: apiTypes.LanguageLocales
     name: string
)  -> ()

Adding localization to the Name of the choice, enabling developers to create milti-language support.

setValue

Choice . setValue (

     self: Choice
     value: string | number
)  -> ()

Set the value of the choice, value can only be either a string or number.

build

Choice . build (

     self: Choice
)  -> ()

Responsible for buillding the default reaction object that the Discord API can understand.

new

Choice . new (

     resource: {
       name: string?,
       nameLocalizations: { [apiTypes.LanguageLocales],
    } | number?, }?
)  -> ()

Constructor for the Discord Default Reaction Builder.

local defaultReaction = Choice.new({
name = "example-choice",
value = "example-value",
}):build()