ApplicationCommand
ApplicationCommand ⇐ Base
Represents an application command.
Kind: global class
Extends: Base
- ApplicationCommand ⇐
Base
- new ApplicationCommand([data], guildId, client)
- .guild ⇒
- .fetch([options]) ⇒
Promise
- .edit(options) ⇒
Promise
- .delete() ⇒
Promise.<void>
new ApplicationCommand([data], guildId, client)
Create an application command object.
Param | Type | Description |
---|---|---|
[data] | Object | The data object containing the command information. |
guildId | string | The ID of the guild the command belongs to. |
client | Client | The 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.
Param | Type | Description |
---|---|---|
[options] | Object | Optional 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.
Param | Type | Description |
---|---|---|
options | Object | The 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.