ApplicationCommandsAPI
declare class ApplicationCommandsAPI
declare class ApplicationCommandsAPI
No summary provided.
constructor(rest)
Constructs a new instance of the
ApplicationCommandsAPI
className | Type | Optional | Description |
---|---|---|---|
rest | REST | No | None |
bulkOverwriteGlobalCommands(applicationId, data)
:
Promise<RESTPutAPIApplicationCommandsResult>
Overwrites global commands
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to overwrite commands for |
data | RESTPutAPIApplicationCommandsJSONBody | No | The data to use when overwriting commands |
bulkOverwriteGuildCommands(applicationId, guildId, data)
:
Promise<RESTPutAPIApplicationCommandsResult>
Bulk overwrites guild commands
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to overwrite commands for |
guildId | Snowflake | No | The guild id to overwrite commands for |
data | RESTPutAPIApplicationCommandsJSONBody | No | The data to use when overwriting commands |
createGlobalCommand(applicationId, data)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Creates a new global command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to create the command for |
data | RESTPostAPIApplicationCommandsJSONBody | No | The data to use when creating the command |
createGuildCommand(applicationId, guildId, data)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Creates a new command for a guild
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to create the command for |
guildId | Snowflake | No | The guild id to create the command for |
data | RESTPostAPIApplicationCommandsJSONBody | No | The data to use when creating the command |
deleteGlobalCommand(applicationId, commandId)
:
Promise<void>
Deletes a global command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the command |
commandId | Snowflake | No | The id of the command to delete |
deleteGuildCommand(applicationId, guildId, commandId)
:
Promise<void>
Deletes a guild command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the command |
guildId | Snowflake | No | The guild id of the command |
commandId | Snowflake | No | The id of the command to delete |
editGlobalCommand(applicationId, commandId, data)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Edits a global command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the command |
commandId | Snowflake | No | The id of the command to edit |
data | RESTPatchAPIApplicationCommandJSONBody | No | The data to use when editing the command |
editGuildCommand(applicationId, guildId, commandId, data)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Edits a guild command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id of the command |
guildId | Snowflake | No | The guild id of the command |
commandId | Snowflake | No | The command id to edit |
data | RESTPatchAPIApplicationCommandJSONBody | No | The 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
Name | Type | Optional | Description |
---|---|---|---|
userToken | string | No | The token of the user to edit permissions on behalf of |
applicationId | Snowflake | No | The application id to edit the permissions for |
guildId | Snowflake | No | The guild id to edit the permissions for |
commandId | Snowflake | No | The id of the command to edit the permissions for |
data | RESTPutAPIApplicationCommandPermissionsJSONBody | No | The data to use when editing the permissions |
getGlobalCommand(applicationId, commandId)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Fetches a global command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to fetch the command from |
commandId | Snowflake | No | The command id to fetch |
getGlobalCommands(applicationId, options?)
:
Promise<RESTGetAPIApplicationCommandsResult>
Fetches all global commands for a application
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to fetch commands for |
options | RESTGetAPIApplicationCommandsQuery | Yes | The options to use when fetching commands |
getGuildCommand(applicationId, guildId, commandId)
:
Promise<discord_api_types_v10.APIApplicationCommand>
Fetches a guild command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to fetch the command from |
guildId | Snowflake | No | The guild id to fetch the command from |
commandId | Snowflake | No | The command id to fetch |
getGuildCommandPermissions(applicationId, guildId, commandId)
:
Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>
Fetches the permissions for a guild command
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to get the permissions for |
guildId | Snowflake | No | The guild id of the command |
commandId | Snowflake | No | The command id to get the permissions for |
getGuildCommands(applicationId, guildId, data?)
:
Promise<RESTGetAPIApplicationCommandsResult>
Fetches all commands for a guild
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to fetch commands for |
guildId | Snowflake | No | The guild id to fetch commands for |
data | RESTGetAPIApplicationGuildCommandsQuery | Yes | The data to use when fetching commands |
getGuildCommandsPermissions(applicationId, guildId)
:
Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>
Fetches all permissions for all commands in a guild
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to get the permissions for |
guildId | Snowflake | No | The guild id to get the permissions for |