Skip to content

SelectMenuOption

Implementation of discords Option object as a Luau builder.

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

SelectMenuOption.label  :: string?

The user-facing name of the option.

SelectMenuOption.value  :: string?

The dev-defined value of the option.

SelectMenuOption.description  :: string?

An additional description of the option.

SelectMenuOption.emoji  :: Emoji?

The emoji to display alongside the option.

SelectMenuOption.default  :: boolean?

Whether this option is selected by default.

SelectMenuOption : setLabel ( label )  -> Option

Sets the user-facing name of the option.

Parameters

label: string

Returns

Option
SelectMenuOption : setValue ( value )  -> Option

Sets the dev-defined value of the option.

Parameters

value: string

Returns

Option
SelectMenuOption : setDescription ( description )  -> Option

Sets an additional description of the option.

Parameters

description: string

Returns

Option
SelectMenuOption : setEmoji ( emoji )  -> Option

Sets an emoji to display alongside the option.

Parameters

emoji: JSON

Returns

Option
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
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