ApplicationCommand
ClassOn this page
ApplicationCommand is a DiscordLua class representing a Discord resource. Obtain it from a manager, an event payload, or the constructor when one is documented below.
Properties
- Name
applicationId- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.applicationId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
client- Type
any- Access
- readonly
- Description
- Owning Client instance used for REST, cache, and event dispatch.
- Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
contexts- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.contexts. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
defaultMemberPermissions- Type
any- Access
- mutable
- Description
- Instance field
ApplicationCommand.defaultMemberPermissions. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
description- Type
any- Access
- mutable
- Description
- Instance field
ApplicationCommand.description. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
descriptionLocalizations- Type
any- Access
- mutable
- Description
- Instance field
ApplicationCommand.descriptionLocalizations. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
descriptionLocalized- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.descriptionLocalized. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
dmPermission- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.dmPermission. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
guildId- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.guildId. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
handler- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.handler. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
id- Type
any- Access
- readonly
- Description
- Snowflake id of this ApplicationCommand.
- Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
integrationTypes- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.integrationTypes. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
name- Type
any- Access
- mutable
- Description
- Display name of this ApplicationCommand.
- Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
nameLocalizations- Type
any- Access
- mutable
- Description
- Instance field
ApplicationCommand.nameLocalizations. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
nameLocalized- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.nameLocalized. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
nsfw- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.nsfw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
options- Type
any- Access
- mutable
- Description
- Instance field
ApplicationCommand.options. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
permissions- Type
- ApplicationCommandPermissionsManager
- Access
- readonly
- Description
- Cache and REST facade for applicationcommandpermissions objects owned by this ApplicationCommand. Use it to fetch, create, resolve, and mutate those resources.
- Availability
- Created in
ApplicationCommand.newand remains valid for the lifetime of the ApplicationCommand. - Related
- ApplicationCommandPermissionsManager
- Name
raw- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.raw. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
type- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.type. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
- Name
version- Type
any- Access
- readonly
- Description
- Instance field
ApplicationCommand.version. Read it after the object is constructed or wrapped from Gateway/REST data. - Availability
- Populated from the Gateway/REST payload or constructor for this ApplicationCommand.
Methods
ApplicationCommand:createdAt()
#Create dAt through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
ApplicationCommand:createdAt() Parameters
No parameters.
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:createdAt()ApplicationCommand:createdTimestamp()
#Create dTimestamp through REST and cache the result when the request succeeds. Pass function(err, result) to handle failures without raising.
Signature
ApplicationCommand:createdTimestamp() Parameters
No parameters.
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:createdTimestamp()ApplicationCommand:delete()
#Permanently delete this resource through REST.
Signature
ApplicationCommand:delete(callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:delete(function(err, result)
if err then error(err) end
end)ApplicationCommand:edit()
#Apply a REST update to this resource.
Signature
ApplicationCommand:edit(options, callback) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
callback |
function |
optional | Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:edit({}, function(err, result)
if err then error(err) end
end)ApplicationCommand:equals()
#Return whether this ApplicationCommand refers to the same resource as the argument.
Signature
ApplicationCommand:equals(other) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
other |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:equals(other)ApplicationCommand:guild()
#Performs guild on this ApplicationCommand. Call it from bot code when you need that operation on the current object.
Signature
ApplicationCommand:guild() Parameters
No parameters.
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:guild()ApplicationCommand:manager()
#Performs manager on this ApplicationCommand. Call it from bot code when you need that operation on the current object.
Signature
ApplicationCommand:manager() Parameters
No parameters.
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:manager()Performs options equal on this ApplicationCommand. Call it from bot code when you need that operation on the current object.
Signature
ApplicationCommand.optionsEqual(a, b) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
a |
any |
required | Passed through to the implementation as written. |
b |
any |
required | Passed through to the implementation as written. |
Returns
any.
Example
local discord = require("discord")
-- object is a ApplicationCommand
ApplicationCommand.optionsEqual(a, b)ApplicationCommand:setDefaultMemberPermissions()
#Set the DefaultMemberPermissions field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setDefaultMemberPermissions(permissions) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
permissions |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setDefaultMemberPermissions(permissions)ApplicationCommand:setDescription()
#Set the Description field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setDescription(description) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
description |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setDescription(description)ApplicationCommand:setDescriptionLocalizations()
#Set the DescriptionLocalizations field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setDescriptionLocalizations(localizations) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
localizations |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setDescriptionLocalizations(localizations)ApplicationCommand:setDMPermission()
#Set the DMPermission field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setDMPermission(enabled) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
enabled |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setDMPermission(enabled)ApplicationCommand:setName()
#Set the Name field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setName(name) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
name |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setName(name)ApplicationCommand:setNameLocalizations()
#Set the NameLocalizations field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setNameLocalizations(localizations) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
localizations |
any |
required | Passed through to the implementation as written. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setNameLocalizations(localizations)ApplicationCommand:setOptions()
#Set the Options field. Builders return this ApplicationCommand so setters can be chained.
Signature
ApplicationCommand:setOptions(options) Parameters
| Name | Type | Required | Behavior |
|---|---|---|---|
options |
table |
optional | Lua option table. Field names match the corresponding DiscordLua option type when one exists. |
Returns
ApplicationCommand — the same instance, for chaining.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:setOptions({})ApplicationCommand:toJSON()
#Serialize this ApplicationCommand into a Lua table suitable for REST or debugging.
Signature
ApplicationCommand:toJSON() Parameters
No parameters.
Returns
any.
Example
local discord = require("discord")
-- object is a ApplicationCommand
object:toJSON()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 · ApplicationRoleConnectionMetadata · Attachment · AuthorizingIntegrationOwners
Version: discord 1.2.4 · runtime 1.0.0