Search...

ApplicationCommandsAPI

declare class ApplicationCommandsAPI 
declare class ApplicationCommandsAPI 

No summary provided.

constructor(rest)

Constructs a new instance of the ApplicationCommandsAPI class
NameTypeOptionalDescription
restRESTNoNone

bulkOverwriteGlobalCommands(applicationId, data)

:

Promise<RESTPutAPIApplicationCommandsResult>

Overwrites global commands
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to overwrite commands for
dataRESTPutAPIApplicationCommandsJSONBodyNoThe data to use when overwriting commands

bulkOverwriteGuildCommands(applicationId, guildId, data)

:

Promise<RESTPutAPIApplicationCommandsResult>

Bulk overwrites guild commands
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to overwrite commands for
guildIdSnowflakeNoThe guild id to overwrite commands for
dataRESTPutAPIApplicationCommandsJSONBodyNoThe data to use when overwriting commands

createGlobalCommand(applicationId, data)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Creates a new global command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to create the command for
dataRESTPostAPIApplicationCommandsJSONBodyNoThe data to use when creating the command

createGuildCommand(applicationId, guildId, data)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Creates a new command for a guild
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to create the command for
guildIdSnowflakeNoThe guild id to create the command for
dataRESTPostAPIApplicationCommandsJSONBodyNoThe data to use when creating the command

deleteGlobalCommand(applicationId, commandId)

:

Promise<void>

Deletes a global command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
commandIdSnowflakeNoThe id of the command to delete

deleteGuildCommand(applicationId, guildId, commandId)

:

Promise<void>

Deletes a guild command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe id of the command to delete

editGlobalCommand(applicationId, commandId, data)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Edits a global command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
commandIdSnowflakeNoThe id of the command to edit
dataRESTPatchAPIApplicationCommandJSONBodyNoThe data to use when editing the command

editGuildCommand(applicationId, guildId, commandId, data)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Edits a guild command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id of the command
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe command id to edit
dataRESTPatchAPIApplicationCommandJSONBodyNoThe data to use when editing the command

editGuildCommandPermissions(userToken, applicationId, guildId, commandId, data)

:

Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>

Edits the permissions for a guild command
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
dataRESTPutAPIApplicationCommandPermissionsJSONBodyNoThe data to use when editing the permissions

getGlobalCommand(applicationId, commandId)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Fetches a global command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch the command from
commandIdSnowflakeNoThe command id to fetch

getGlobalCommands(applicationId, options?)

:

Promise<RESTGetAPIApplicationCommandsResult>

Fetches all global commands for a application
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch commands for
optionsRESTGetAPIApplicationCommandsQueryYesThe options to use when fetching commands

getGuildCommand(applicationId, guildId, commandId)

:

Promise<discord_api_types_v10.APIApplicationCommand>

Fetches a guild command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch the command from
guildIdSnowflakeNoThe guild id to fetch the command from
commandIdSnowflakeNoThe command id to fetch

getGuildCommandPermissions(applicationId, guildId, commandId)

:

Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>

Fetches the permissions for a guild command
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to get the permissions for
guildIdSnowflakeNoThe guild id of the command
commandIdSnowflakeNoThe command id to get the permissions for

getGuildCommands(applicationId, guildId, data?)

:

Promise<RESTGetAPIApplicationCommandsResult>

Fetches all commands for a guild
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to fetch commands for
guildIdSnowflakeNoThe guild id to fetch commands for
dataRESTGetAPIApplicationGuildCommandsQueryYesThe data to use when fetching commands

getGuildCommandsPermissions(applicationId, guildId)

:

Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>

Fetches all permissions for all commands in a guild
NameTypeOptionalDescription
applicationIdSnowflakeNoThe application id to get the permissions for
guildIdSnowflakeNoThe guild id to get the permissions for