Discord Slash Command Builder

Design slash commands visually. Get code for discord.js, discord.py, or raw JSON.

Command

Lowercase, hyphens and underscores allowed

Options (0/25)

No options yet. Add one to get started.

2 issues found

Command name is required

Description is required

Preview

Start designing your command to see a preview

Code

{
  "name": "command",
  "description": "No description"
}

Skip the code — auto-generate slash commands

CordBase creates slash commands automatically from your database tables. Design tables in a web dashboard, and your Discord server gets a command for each table to add, query, update and rank rows instantly.

Get started for free

What is a Discord slash command builder?

A Discord slash command builder lets you design a command (its name, description, options, subcommands and choices) in a form and exports the JSON Discord expects, or the equivalent discord.js or discord.py code. Register that with Discord's API and the command appears when members type a slash.

Slash command option types

The type number goes in each option's type field.

TypeAPI nameKindNotes
1SUB_COMMANDSubcommandA nested command such as /settings view
2SUB_COMMAND_GROUPSubcommand groupGroups subcommands, such as /settings roles add. Only one level of grouping is allowed
3STRINGStringText. Optional min_length (0 to 6000) and max_length (1 to 6000)
4INTEGERIntegerA whole number from -2^53+1 to 2^53-1, with optional min_value and max_value
5BOOLEANBooleantrue or false
6USERUserA member picker
7CHANNELChannelA channel picker; restrict the kinds of channel with channel_types
8ROLERoleA role picker
9MENTIONABLEMentionableA user or a role
10NUMBERNumberA decimal number from -2^53 to 2^53, with optional min_value and max_value
11ATTACHMENTAttachmentA file the member uploads

Slash command limits

Discord rejects a command that goes over any of these. The builder flags the ones it can check as you type.

WhatLimit
Command name1 to 32 characters, lowercase, no spaces (letters, numbers, hyphens and underscores are safe)
Command description1 to 100 characters
Option name1 to 32 characters, same rules as a command name
Option description1 to 100 characters
Options per command25 (a subcommand or group also holds up to 25)
Choices per option25
Choice name1 to 100 characters
String choice valueup to 100 characters
Required optionsmust be listed before optional ones
Total size of one command8000 characters across all names, descriptions and string values
Slash commands per app100 global, plus a separate 100 in each server

Example: a /roll command as JSON

Send this to POST /applications/APP_ID/commands to register it globally, or to the same path under /guilds/GUILD_ID to try it in one server first.

{
  "name": "roll",
  "description": "Roll some dice",
  "options": [
    {
      "type": 4,
      "name": "sides",
      "description": "Sides on each die",
      "required": true,
      "min_value": 2,
      "max_value": 100
    },
    {
      "type": 4,
      "name": "count",
      "description": "How many dice to roll",
      "min_value": 1,
      "max_value": 10
    }
  ]
}

Questions

How do I create a slash command for a Discord bot?
Define the command (name, description and options), then register it by sending that JSON to Discord's application commands endpoint, or with a library such as discord.js or discord.py. The builder exports the JSON and the library code. Your bot then answers each use as an interaction.
How many options can a Discord slash command have?
Up to 25 options. A subcommand or subcommand group also holds up to 25 of its own, and every option with choices can have up to 25 choices.
What characters are allowed in a slash command name?
Names are 1 to 32 characters and must be lowercase with no spaces. Letters, numbers, hyphens and underscores are always safe.
What is the difference between a subcommand and a subcommand group?
A subcommand is one level, like /settings view. A group adds a level above it, like /settings roles add. Discord allows only that one level of grouping.
How many slash commands can a bot have?
A bot can register 100 global slash commands, plus a separate 100 in each server.
Do slash commands need the Message Content intent?
No. Discord sends the command and its options to your bot as an interaction, so the bot never has to read message text.

Last reviewed 2026-10-14 against the Discord developer docs on application commands. More free tools: all Discord tools