LogoAntiRaid

@discord-types/builders/message/components/selectMenu/option

API reference for @discord-types/builders/message/components/selectMenu/option

@discord-types/builders/message/components/selectMenu/option

Types

Option

Raw Type
type Option = Option.Prototype, & {
	type: interactionTypes.ApplicationCommandOptionType?,

	name: string?,

	nameLocalizations: {
		[apiTypes.LanguageLocales]: string
	},

	description: string?,

	descriptionLocalizations: {
		[apiTypes.LanguageLocales]: string
	},

	required: boolean?,

	choices: {interactionChoice.JSON},

	options: {JSON},

	channelTypes: {channelTypes.ChannelType},

	minValue: number?,

	maxValue: number?,

	minLength: number?,

	maxLength: number?,

	autocomplete: boolean?
}

Intersection with variants:

Variant 2
PropTypeDescription
type?
-
name?
-
nameLocalizations
{[apiTypes.LanguageLocales]: string}
-
description?
-
descriptionLocalizations
{[apiTypes.LanguageLocales]: string}
-
required?
-
choices
-
options
-
channelTypes
-
minValue?
-
maxValue?
-
minLength?
-
maxLength?
-
autocomplete?
-

JSON

Raw Type
type JSON = Option.Prototype.build(nil :: any),

Functions

Option.Prototype.setType

[[ Set the Type of option that will be built. ]]

Function Signature
--[[
	Set the Type of option that will be built.
]]
function Option.Prototype.setType(self: Option, type: interactionTypes.ApplicationCommandOptionType) -> Option end

Arguments

type

interactionTypes.ApplicationCommandOptionType

Returns

ret1

Option

Option.Prototype.setName

[[ Set the name of this option, option name needs to be kebab case. ]]

Function Signature
--[[
	Set the name of this option, option name needs to be kebab case.
]]
function Option.Prototype.setName(self: Option, name: string) -> Option end

Arguments

name

string

Returns

ret1

Option

Option.Prototype.setNameLocalization

[[ add a name localization for this option. ]]

Function Signature
--[[
	add a name localization for this option.
]]
function Option.Prototype.setNameLocalization(self: Option, localization: apiTypes.LanguageLocales, name: string) -> Option end

Arguments

localization

apiTypes.LanguageLocales

name

string

Returns

ret1

Option

Option.Prototype.setDescription

[[ set the description of this option. ]]

Function Signature
--[[
	set the description of this option.
]]
function Option.Prototype.setDescription(self: Option, description: string) -> Option end

Arguments

description

string

Returns

ret1

Option

Option.Prototype.setDescriptionLocalization

[[ add a description localization for this option. ]]

Function Signature
--[[
	add a description localization for this option.
]]
function Option.Prototype.setDescriptionLocalization(self: Option, localization: apiTypes.LanguageLocales, description: string) -> Option end

Arguments

localization

apiTypes.LanguageLocales

description

string

Returns

ret1

Option

Option.Prototype.setRequired

[[ set if the option is required, will not work on SubCommand or SubCommandGroup options. ]]

Function Signature
--[[
	set if the option is required, will not work on SubCommand or SubCommandGroup options.
]]
function Option.Prototype.setRequired(self: Option, isRequired: boolean) -> Option end

Arguments

isRequired

boolean

Returns

ret1

Option

Option.Prototype.addChoice

[[ add a choice to the option, will only work on String, Integer, or Number options. ]]

Function Signature
--[[
	add a choice to the option, will only work on String, Integer, or Number options.
]]
function Option.Prototype.addChoice(self: Option, choice: interactionChoice.JSON) -> Option end

Arguments

choice

interactionChoice.JSON

Returns

ret1

Option

Option.Prototype.addOption

[[ add an option to the option, will only work on SubCommand or SubCommandGroup options. ]]

Function Signature
--[[
	add an option to the option, will only work on SubCommand or SubCommandGroup options.
]]
function Option.Prototype.addOption(self: Option, option: JSON) -> Option end

Arguments

option

JSON

Returns

ret1

Option

Option.Prototype.addChannelType

[[ add supported channel types, will only work on Channel options. ]]

Function Signature
--[[
	add supported channel types, will only work on Channel options.
]]
function Option.Prototype.addChannelType(self: Option, channelType: channelTypes.ChannelType) -> Option end

Arguments

channelType

channelTypes.ChannelType

Returns

ret1

Option

Option.Prototype.setMinValue

[[ set the min value of this option, will only work on Integer or Number options. ]]

Function Signature
--[[
	set the min value of this option, will only work on Integer or Number options.
]]
function Option.Prototype.setMinValue(self: Option, value: number) -> Option end

Arguments

value

number

Returns

ret1

Option

Option.Prototype.setMaxValue

[[ set the max value of this option, will only work on Integer or Number options. ]]

Function Signature
--[[
	set the max value of this option, will only work on Integer or Number options.
]]
function Option.Prototype.setMaxValue(self: Option, value: number) -> Option end

Arguments

value

number

Returns

ret1

Option

Option.Prototype.setMinLength

[[ set the min length of this option, will only work on String options. ]]

Function Signature
--[[
	set the min length of this option, will only work on String options.
]]
function Option.Prototype.setMinLength(self: Option, value: number) -> Option end

Arguments

value

number

Returns

ret1

Option

Option.Prototype.setMaxLength

[[ set the max length of this option, will only work on String options. ]]

Function Signature
--[[
	set the max length of this option, will only work on String options.
]]
function Option.Prototype.setMaxLength(self: Option, value: number) -> Option end

Arguments

value

number

Returns

ret1

Option

Option.Prototype.setAutocompleteEnabled

[[ If autocomplete interactions are enabled for this option, will only work on String, Integer, or Number options. ]]

Function Signature
--[[
	If autocomplete interactions are enabled for this option, will only work on String, Integer, or Number options.
]]
function Option.Prototype.setAutocompleteEnabled(self: Option, autocompleteEnabled: boolean) -> Option end

Arguments

autocompleteEnabled

boolean

Returns

ret1

Option

Option.Prototype.build

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

Function Signature
--[[
	Responsible for buillding the default reaction object that the Discord API can understand.
]]
function Option.Prototype.build(self: Option) -> JSON end

Returns

ret1

JSON

Option.Interface.new

[[ Constructor for the Discord Default Reaction Builder.

```lua local defaultReaction = Option.new("000000000000000000", "secret-emoji"):build() ``` ]]

Function Signature
--[[
	Constructor for the Discord Default Reaction Builder.

	\`\`\`lua
	local defaultReaction = Option.new("000000000000000000", "secret-emoji"):build()
	\`\`\`
]]
function Option.Interface.new(resource: {
		type: interactionTypes.ApplicationCommandOptionType?,

		name: string?,

		nameLocalizations: {
			[apiTypes.LanguageLocales]: string
		}?,

		description: string?,

		descriptionLocalizations: {
			[apiTypes.LanguageLocales]: string
		}?,

		required: boolean?,

		choices: {apiTypes.ApplicationCommandOptionChoiceObject}?,

		options: {JSON}?,

		channelTypes: {apiTypes.ChannelType}?,

		minValue: number?,

		maxValue: number?,

		minLength: number?,

		maxLength: number?,

		autocomplete: boolean?
	}?) -> Option end

Arguments

resource

This field is optional and may not be specified

{type: interactionTypes.ApplicationCommandOptionType?, name: string?, nameLocalizations: {[apiTypes.LanguageLocales]: string}?, description: string?, descriptionLocalizations: {[apiTypes.LanguageLocales]: string}?, required: boolean?, choices: {apiTypes.ApplicationCommandOptionChoiceObject}?, options: {JSON}?, channelTypes: {apiTypes.ChannelType}?, minValue: number?, maxValue: number?, minLength: number?, maxLength: number?, autocomplete: boolean?}?

Returns

ret1

Option

Last updated on