DiscordLua
discorddiscord
v1.2.9
Install

SlashCommandOptionBuilder

Builder
On this page

SlashCommandOptionBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.

builder Module 1.2.9 Source

Constructor

SlashCommandOptionBuilder.new(optionType)

The class table is callable, so SlashCommandOptionBuilder(optionType) is the same as .new.

NameTypeRequiredBehavior
optionType any required Passed through to the implementation as written.
lua
local discord = require("discord")
local object = discord.SlashCommandOptionBuilder({})

Methods

SlashCommandOptionBuilder:addSubcommand()

#

Add Subcommand to this SlashCommandOptionBuilder.

Signature

SlashCommandOptionBuilder:addSubcommand(input)

Parameters

NameTypeRequiredBehavior
input any required Passed through to the implementation as written.

Returns

any.

Example

lua
local discord = require("discord")
-- object is a SlashCommandOptionBuilder
object:addSubcommand(input)

SlashCommandOptionBuilder:setMaxLength()

#

Set the MaxLength field. Builders return this SlashCommandOptionBuilder so setters can be chained.

Signature

SlashCommandOptionBuilder:setMaxLength(value)

Parameters

NameTypeRequiredBehavior
value any required Passed through to the implementation as written.

Returns

SlashCommandOptionBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SlashCommandOptionBuilder
object:setMaxLength(value)

SlashCommandOptionBuilder:setMinLength()

#

Set the MinLength field. Builders return this SlashCommandOptionBuilder so setters can be chained.

Signature

SlashCommandOptionBuilder:setMinLength(value)

Parameters

NameTypeRequiredBehavior
value any required Passed through to the implementation as written.

Returns

SlashCommandOptionBuilder — the same instance, for chaining.

Example

lua
local discord = require("discord")
-- object is a SlashCommandOptionBuilder
object:setMinLength(value)

Examples

lua
local discord = require("discord")
local object = discord.SlashCommandOptionBuilder({})

ActionRowBuilder · AttachmentBuilder · BaseSelectMenuBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ComponentBuilder · ContainerBuilder

Version: discord 1.2.9 · runtime 1.0.0

Search Ctrl K Navigate Open Esc