class GuildApplicationCommandManager
extends
ApplicationCommandManager<ApplicationCommand, {}, Guild>export class GuildApplicationCommandManager extends ApplicationCommandManager<ApplicationCommand, {}, Guild>
An extension for guild-specific application commands.
Collection<Snowflake, ApplicationCommand> cache :
The cache of this manager
readonlyClient client :
The client that instantiated this Manager
Guild guild :
The guild that this manager belongs to
readonlyConstructable<Holds> holds :
The data structure belonging to this manager.
Inherited from: DataManager
ApplicationCommandPermissionsManager permissions :
The manager for permissions of arbitrary commands on this guild
createcommand: ApplicationCommandDataResolvable) : Promise<ApplicationCommand> (
command: ApplicationCommandDataResolvable
Creates an application command.
Examples:
// Create a new command
client.application.commands.create({
name: 'test',
description: 'A test command',
})
.then(console.log)
.catch(console.error);
deletecommand: ApplicationCommandResolvable) : Promise<ApplicationCommand | null> (
command: ApplicationCommandResolvable
Deletes an application command.
Examples:
// Delete a command
guild.commands.delete('123456789012345678')
.then(console.log)
.catch(console.error);
editcommand: ApplicationCommandResolvable) : Promise<ApplicationCommand> (
command: ApplicationCommandResolvable
Edits an application command.
Examples:
// Edit an existing command
client.application.commands.edit('123456789012345678', {
description: 'New description',
})
.then(console.log)
.catch(console.error);
Overload 1
Overload 2
Overload 3
fetchid: Snowflakeoptions?: FetchGuildApplicationCommandFetchOptions) : Promise<ApplicationCommand> (
id: Snowflake
options?: FetchGuildApplicationCommandFetchOptions
Obtains one or multiple application commands from Discord, or the cache if it's already available.
Examples:
// Fetch a single command
client.application.commands.fetch('123456789012345678')
.then(command => console.log(`Fetched command ${command.name}`))
.catch(console.error);
// Fetch all commands
guild.commands.fetch()
.then(commands => console.log(`Fetched ${commands.size} commands`))
.catch(console.error);
Overload 1
Overload 2
Overload 1
Overload 2
setcommands: ApplicationCommandDataResolvable[]) : Promise<Collection<Snowflake, ApplicationCommand>> (
commands: ApplicationCommandDataResolvable[]
Sets all the commands for this application or guild.
Examples:
// Set all commands to just this one
client.application.commands.set([
{
name: 'test',
description: 'A test command',
},
])
.then(console.log)
.catch(console.error);
// Remove all commands
guild.commands.set([])
.then(console.log)
.catch(console.error);
valueOfCollection<Key, Holds> () :
Inherited from: DataManager