Registers a slash command for a Discord bot in a specific guild.

This function creates and registers a new slash command for a Discord bot within a specified guild. It allows for the definition of the command's name, description, options, and permissions. The function returns a Promise that resolves to the registered command object.

post/registerSlashCommand

Request body

Response

Successfully registered the slash command

idstring required

The ID of the registered command

application_idstring required

The ID of the application the command belongs to

guild_idstring required

The ID of the guild the command is registered in

namestring required

The name of the command

descriptionstring required

The description of the command

optionsDiscordSlashCommandOptionSchema[] — unresolved $ref

The options of the command

default_member_permissionsstring

Default permissions required to use the command

dm_permissionboolean

Whether the command can be used in DMs

versionstring required

The version of the command

Changes