DiscordLua
discorddiscord
v1.2.4
Install

ApplicationCommand

Class
On 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.

class Module 1.2.4 Source

Properties

ApplicationCommand.applicationId

# readonly
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.

ApplicationCommand.client

# readonly
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.

ApplicationCommand.contexts

# readonly
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.

ApplicationCommand.defaultMemberPermissions

# mutable
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.

ApplicationCommand.description

# mutable
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.

ApplicationCommand.descriptionLocalizations

# mutable
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.

ApplicationCommand.descriptionLocalized

# readonly
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.

ApplicationCommand.dmPermission

# readonly
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.

ApplicationCommand.guildId

# readonly
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.

ApplicationCommand.handler

# readonly
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.

ApplicationCommand.id

# readonly
Name
id
Type
any
Access
readonly
Description
Snowflake id of this ApplicationCommand.
Availability
Populated from the Gateway/REST payload or constructor for this ApplicationCommand.

ApplicationCommand.integrationTypes

# readonly
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.

ApplicationCommand.name

# mutable
Name
name
Type
any
Access
mutable
Description
Display name of this ApplicationCommand.
Availability
Populated from the Gateway/REST payload or constructor for this ApplicationCommand.

ApplicationCommand.nameLocalizations

# mutable
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.

ApplicationCommand.nameLocalized

# readonly
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.

ApplicationCommand.nsfw

# readonly
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.

ApplicationCommand.options

# mutable
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.

ApplicationCommand.permissions

# readonly
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.new and remains valid for the lifetime of the ApplicationCommand.
Related
ApplicationCommandPermissionsManager

ApplicationCommand.raw

# readonly
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.

ApplicationCommand.type

# readonly
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.

ApplicationCommand.version

# readonly
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

lua
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

lua
local discord = require("discord")
-- object is a ApplicationCommand
object:createdTimestamp()

ApplicationCommand:delete()

#

Permanently delete this resource through REST.

Signature

ApplicationCommand:delete(callback)

Parameters

NameTypeRequiredBehavior
callback function optional Optional completion callback function(err, result). If omitted, failures raise a DiscordLua error.

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

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

Returns

any.

Example

lua
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

lua
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

lua
local discord = require("discord")
-- object is a ApplicationCommand
object:manager()

ApplicationCommand.optionsEqual()

# static

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

NameTypeRequiredBehavior
a any required Passed through to the implementation as written.
b any required Passed through to the implementation as written.

Returns

any.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

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

Returns

ApplicationCommand — the same instance, for chaining.

Example

lua
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

NameTypeRequiredBehavior
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

lua
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

lua
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.

ActionRow · Activity · ActivityInstance · ActivityLocation · AnonymousGuild · ApplicationRoleConnectionMetadata · Attachment · AuthorizingIntegrationOwners

Version: discord 1.2.4 · runtime 1.0.0

Search Ctrl K Navigate Open Esc