Skip to content

ApplicationCommand

ApplicationCommand ⇐ Base

Represents an application command.

Kind: global class
Extends: Base

new ApplicationCommand([data], guildId, client)

Create an application command object.

ParamTypeDescription
[data]ObjectThe data object containing the command information.
guildIdstringThe ID of the guild the command belongs to.
clientClientThe client instance.

applicationCommand.guild ⇒

Get the guild object if it exists, otherwise return null.

Kind: instance property of ApplicationCommand
Returns: The guild object or null.

applicationCommand.fetch([options]) ⇒ Promise

Fetches the commands for a guild or the global application.

Kind: instance method of ApplicationCommand
Returns: Promise - - A promise that resolves with the fetched commands.

ParamTypeDescription
[options]ObjectOptional parameters for the fetch operation.

applicationCommand.edit(options) ⇒ Promise

Edits the command with the specified options. If the command is associated with a guild, it will edit the guild command. Otherwise, it will edit the global command.

Kind: instance method of ApplicationCommand
Returns: Promise - A promise that resolves when the command is successfully edited.

ParamTypeDescription
optionsObjectThe options to edit the command with.

applicationCommand.delete() ⇒ Promise.<void>

Deletes the command from the guild or the global application.

Kind: instance method of ApplicationCommand
Returns: Promise.<void> - - A promise that resolves when the command is successfully deleted.