SharedSlashCommandOptions
ClassOn this page
SharedSlashCommandOptions is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Methods
SharedSlashCommandOptions:addAttachmentOption()
#Add AttachmentOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addAttachmentOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addAttachmentOption(input)SharedSlashCommandOptions:addBooleanOption()
#Add BooleanOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addBooleanOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addBooleanOption(input)SharedSlashCommandOptions:addChannelOption()
#Add ChannelOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addChannelOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addChannelOption(input)SharedSlashCommandOptions:addIntegerOption()
#Add IntegerOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addIntegerOption(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 SharedSlashCommandOptions
object:addIntegerOption(input)SharedSlashCommandOptions:addMentionableOption()
#Add MentionableOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addMentionableOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addMentionableOption(input)SharedSlashCommandOptions:addNumberOption()
#Add NumberOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addNumberOption(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 SharedSlashCommandOptions
object:addNumberOption(input)SharedSlashCommandOptions:addRoleOption()
#Add RoleOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addRoleOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addRoleOption(input)SharedSlashCommandOptions:addStringOption()
#Add StringOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addStringOption(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 SharedSlashCommandOptions
object:addStringOption(input)SharedSlashCommandOptions:addUserOption()
#Add UserOption to this SharedSlashCommandOptions.
Signature
SharedSlashCommandOptions:addUserOption(input) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
input |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommandOptions — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommandOptions
object:addUserOption(input)Examples
Obtain this object from a manager, wrap helper, or event payload — it is not constructed directly in typical bot code.
Related APIs
ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationCommand · ApplicationCommandNumericOptionMinMaxValueMixin · ApplicationCommandOptionBase
Version: discord 1.2.9 · runtime 1.0.0