You are reading the documentation for the next version of discord.js. Documentation for v13/v14+ has been moved to old.discordjs.dev

ApplicationCommandsAPI

export declare class ApplicationCommandsAPI
export declare class ApplicationCommandsAPI

No summary provided.

constructor(rest)
Constructs a new instance of the ApplicationCommandsAPI class
NameTypeOptionalDescription
restRESTNoNone
bulkOverwriteGlobalCommands(applicationId, body, options?):Promise<RESTPutAPIApplicationCommandsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to overwrite commands for
bodyRESTPutAPIApplicationCommandsJSONBodyNoThe data for overwriting commands
optionsPick<RequestData, 'signal'>YesThe options for overwriting commands
bulkOverwriteGuildCommands(applicationId, guildId, body, options?):Promise<RESTPutAPIApplicationGuildCommandsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to overwrite commands for
guildIdSnowflakeNoThe guild id to overwrite commands for
bodyRESTPutAPIApplicationGuildCommandsJSONBodyNoThe data for overwriting commands
optionsPick<RequestData, 'signal'>YesThe options for overwriting the commands
createGlobalCommand(applicationId, body, options?):Promise<APIApplicationCommand>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to create the command for
bodyRESTPostAPIApplicationCommandsJSONBodyNoThe data for creating the command
optionsPick<RequestData, 'signal'>YesThe options for creating the command
createGuildCommand(applicationId, guildId, body, options?):Promise<RESTPostAPIApplicationGuildCommandsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to create the command for
guildIdSnowflakeNoThe guild id to create the command for
bodyRESTPostAPIApplicationGuildCommandsJSONBodyNoThe data for creating the command
optionsPick<RequestData, 'signal'>YesThe options for creating the command
deleteGlobalCommand(applicationId, commandId, options?):Promise<void>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
commandIdSnowflakeNoThe id of the command to delete
optionsPick<RequestData, 'signal'>YesThe options for deleting a command
deleteGuildCommand(applicationId, guildId, commandId, options?):Promise<void>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe id of the command to delete
optionsPick<RequestData, 'signal'>YesThe options for deleting the command
editGlobalCommand(applicationId, commandId, body, options?):Promise<APIApplicationCommand>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
commandIdSnowflakeNoThe id of the command to edit
bodyRESTPatchAPIApplicationCommandJSONBodyNoThe data for editing the command
optionsPick<RequestData, 'signal'>YesThe options for editing the command
editGuildCommand(applicationId, guildId, commandId, body, options?):Promise<RESTPatchAPIApplicationGuildCommandResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe command id to edit
bodyRESTPatchAPIApplicationGuildCommandJSONBodyNoThe data for editing the command
optionsPick<RequestData, 'signal'>YesThe options for editing the command
editGuildCommandPermissions(userToken, applicationId, guildId, commandId, body, options?):Promise<APIGuildApplicationCommandPermissions>
NameTypeOptionalDescription
userTokenstringNoThe token of the user to edit permissions on behalf of
applicationIdSnowflakeNoThe application id to edit the permissions for
guildIdSnowflakeNoThe guild id to edit the permissions for
commandIdSnowflakeNoThe id of the command to edit the permissions for
bodyRESTPutAPIApplicationCommandPermissionsJSONBodyNoThe data for editing the permissions
optionsPick<RequestData, 'signal'>YesThe options for editing the permissions
getGlobalCommand(applicationId, commandId, options?):Promise<APIApplicationCommand>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch the command from
commandIdSnowflakeNoThe command id to fetch
optionsPick<RequestData, 'signal'>YesThe options for fetching the command
getGlobalCommands(applicationId, query?, options?):Promise<RESTGetAPIApplicationCommandsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch commands for
queryRESTGetAPIApplicationCommandsQueryYesThe query options for fetching commands
optionsPick<RequestData, 'signal'>YesThe options for fetching commands
getGuildCommand(applicationId, guildId, commandId, options?):Promise<RESTGetAPIApplicationGuildCommandResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch the command from
guildIdSnowflakeNoThe guild id to fetch the command from
commandIdSnowflakeNoThe command id to fetch
optionsPick<RequestData, 'signal'>YesThe options for fetching the command
getGuildCommandPermissions(applicationId, guildId, commandId, options?):Promise<APIGuildApplicationCommandPermissions>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to get the permissions for
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe command id to get the permissions for
optionsPick<RequestData, 'signal'>YesThe option for fetching the command
getGuildCommands(applicationId, guildId, query?, options?):Promise<RESTGetAPIApplicationGuildCommandsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch commands for
guildIdSnowflakeNoThe guild id to fetch commands for
queryRESTGetAPIApplicationGuildCommandsQueryYesThe data for fetching commands
optionsPick<RequestData, 'signal'>YesThe options for fetching commands
getGuildCommandsPermissions(applicationId, guildId, options?):Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to get the permissions for
guildIdSnowflakeNoThe guild id to get the permissions for
optionsPick<RequestData, 'signal'>YesThe options for fetching permissions