export declare class ApplicationCommandsAPI
export 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, body, { signal }?)
:
Promise<RESTPutAPIApplicationCommandsResult>
Overwrites global commands
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to overwrite commands for |
body | RESTPutAPIApplicationCommandsJSONBody | No | The data to use when overwriting commands |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
bulkOverwriteGuildCommands(applicationId, guildId, body, { signal }?)
:
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 |
body | RESTPutAPIApplicationCommandsJSONBody | No | The data to use when overwriting commands |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
createGlobalCommand(applicationId, body, { signal }?)
:
Promise<import("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 |
body | RESTPostAPIApplicationCommandsJSONBody | No | The data to use when creating the command |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
createGuildCommand(applicationId, guildId, body, { signal }?)
:
Promise<import("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 |
body | RESTPostAPIApplicationCommandsJSONBody | No | The data to use when creating the command |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
deleteGlobalCommand(applicationId, commandId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
deleteGuildCommand(applicationId, guildId, commandId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
editGlobalCommand(applicationId, commandId, body, { signal }?)
:
Promise<import("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 |
body | RESTPatchAPIApplicationCommandJSONBody | No | The data to use when editing the command |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
editGuildCommand(applicationId, guildId, commandId, body, { signal }?)
:
Promise<import("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 |
body | RESTPatchAPIApplicationCommandJSONBody | No | The data to use when editing the command |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
editGuildCommandPermissions(userToken, applicationId, guildId, commandId, body, { signal }?)
:
Promise<import("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 |
body | RESTPutAPIApplicationCommandPermissionsJSONBody | No | The data to use when editing the permissions |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGlobalCommand(applicationId, commandId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGlobalCommands(applicationId, query?, { signal }?)
:
Promise<RESTGetAPIApplicationCommandsResult>
Fetches all global commands for a application
Name | Type | Optional | Description |
---|---|---|---|
applicationId | Snowflake | No | The application id to fetch commands for |
query | RESTGetAPIApplicationCommandsQuery | Yes | The query options to use when fetching commands |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuildCommand(applicationId, guildId, commandId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuildCommandPermissions(applicationId, guildId, commandId, { signal }?)
:
Promise<import("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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuildCommands(applicationId, guildId, query?, { signal }?)
:
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 |
query | RESTGetAPIApplicationGuildCommandsQuery | Yes | The data to use when fetching commands |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |
getGuildCommandsPermissions(applicationId, guildId, { signal }?)
:
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 |
{ signal } | Pick<RequestData, 'signal'> | Yes | None |