SharedSlashCommand
ClassOn this page
SharedSlashCommand 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
SharedSlashCommand:setContexts()
#Set the Contexts field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setContexts(first, ...) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
first |
any |
required | Passed through to the implementation as written. |
... |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setContexts(first, ...)SharedSlashCommand:setDefaultMemberPermissions()
#Set the DefaultMemberPermissions field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setDefaultMemberPermissions(permissions) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
permissions |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setDefaultMemberPermissions(permissions)SharedSlashCommand:setDefaultPermission()
#Set the DefaultPermission field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setDefaultPermission(enabled) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setDefaultPermission(enabled)SharedSlashCommand:setDMPermission()
#Set the DMPermission field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setDMPermission(enabled) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setDMPermission(enabled)SharedSlashCommand:setIntegrationTypes()
#Set the IntegrationTypes field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setIntegrationTypes(first, ...) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
first |
any |
required | Passed through to the implementation as written. |
... |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setIntegrationTypes(first, ...)SharedSlashCommand:setNSFW()
#Set the NSFW field. Builders return this SharedSlashCommand so setters can be chained.
Signature
SharedSlashCommand:setNSFW(nsfw) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
nsfw |
any |
required | Passed through to the implementation as written. |
Returns
SharedSlashCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a SharedSlashCommand
object:setNSFW(nsfw)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