Actions43
- Add Reaction
- Add Role to Member
- Add Thread Member
- Ban Member
- Bulk Delete Messages
- Create Channel
- Create Invite
- Create Role
- Create Scheduled Event
- Create Thread
- Create Thread From Message
- Delete Channel
- Delete Message
- Delete Role
- Delete Scheduled Event
- Delete Slash Command
- Edit Channel
- Edit Role
- Edit Scheduled Event
- Edit Thread
- Fetch Member
- Fetch Message
- Fetch Message History
- Kick Member
- List Scheduled Events
- List Slash Commands
- Pin Message
- Register Context Menu Command
- Register Slash Command
- Remove Own Reaction
- Remove Role From Member
- Remove Thread Member
- Respond to Interaction
- Send Message
- Send Message with Poll
- Send Modal
- Set Bot Activity
- Set Bot Status
- Set Member Nickname
- Timeout Member
- Unban Member
- Unpin Message
- Update Message
Register Slash Command
AI-generatedSummary
Register a slash command with Discord, optionally scoped to a specific guild or globally, by specifying the command name, description, and configurable options or by providing raw JSON for the command options.
Inputs
- Guild ID — The ID of the guild to register the slash command for; leave empty to register the command globally.
- Command Name (required) — The name of the slash command to register.
- Command Description (required) — A description of what the command does.
- Command Options — Structured options for the slash command, including each option's name, description, type, predefined choices (for string and integer types), and whether the option is required.
- Or Provide Raw JSON Instead — A JSON array representing the slash command options for advanced configuration beyond the UI builder.
Output shape
a single record containing the Discord API response for the registered slash command, including its ID and definition details
The registered command can be scoped to a specific guild if Guild ID is set, otherwise it is registered globally. The output reflects the Discord API's created command object.
Examples
Example 1: Register a global slash command named 'weather' with a description 'Get the weather forecast' and no options.
Set Command Name to 'weather', Command Description to 'Get the weather forecast', leave Guild ID empty, and leave Command Options empty.
Example 2: Register a guild-specific slash command named 'poll' with options for question (string, required) and anonymous (boolean, optional).
Set Guild ID to the target guild's ID, Command Name to 'poll', Command Description to 'Create a poll in this guild', add two Command Options: one string option named 'question' marked as required, and one boolean option named 'anonymous' marked as optional.