SlashCommandOptionBuilder
BuilderOn this page
SlashCommandOptionBuilder is a fluent payload builder. Chain setters, then pass the builder to send, reply, or command registration.
Constructor
SlashCommandOptionBuilder.new(optionType) The class table is callable, so SlashCommandOptionBuilder(optionType) is the same as .new.
| Name | Type | Required | Behavior |
|---|---|---|---|
optionType |
any |
required | Passed through to the implementation as written. |
local discord = require("discord")
local object = discord.SlashCommandOptionBuilder({})Methods
SlashCommandOptionBuilder:addSubcommand()
#Add Subcommand to this SlashCommandOptionBuilder.
Signature
SlashCommandOptionBuilder:addSubcommand(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
SlashCommandOptionBuilder — the same instance, for chaining.
Example
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
| Name | Type | Required | Behavior |
|---|---|---|---|
value |
any |
required | Passed through to the implementation as written. |
Returns
SlashCommandOptionBuilder — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SlashCommandOptionBuilder
object:setMinLength(value)Examples
local discord = require("discord")
local object = discord.SlashCommandOptionBuilder({})Related APIs
ActionRowBuilder · AttachmentBuilder · BaseSelectMenuBuilder · ButtonBuilder · ChannelSelectMenuBuilder · CheckboxBuilder · ComponentBuilder · ContainerBuilder
Version: discord 1.2.9 · runtime 1.0.0