VulCode

Slash command builder

Click the command options and get the JSON to register it with the API.

Category
Discord
Price
free

The tool starts in your browser.

Everything is calculated in your browser. Nothing you type is sent to our server.

How to use it in three steps

The tool as a schematic with this page's example. Each step's number stands where you take it: in the fields, at the result or outside the tool.

Slash command builder
What you enter
Name "Ticket", an optional option details and a required option topic, both text
  1. Give the command a name and description.

  2. Add options with types and requirements.

What you get
{ "name": "ticket", "description": "Open a ticket", "type": 1, "options": [ { "name": "topic", "description": "What it is about", "type": 3, "required": true }, { "name": "details", "description": "More about the ticket", "type": 3, "required": false } ] }
Registering the command with the API
  1. Copy the JSON and register the command with the API.

A /ticket command with two options

The tool fixes the name, puts the options in the order Discord requires and turns the types into the API's numbers. The result is computed by the same function the tool at the top of the page uses, every time the page is shown.

You enter

Name
Ticket
Description
Open a ticket
Option details
Text, optional
Option topic
Text, required

Name

Name
ticket
What the tool does

Discord takes only lower case letters, digits, a hyphen and an underscore in a name, up to 32 characters. The tool fixes it as you type.

Option order

options
topic, details
What the tool does

Required options must come before optional ones, or Discord rejects the registration. The tool sorts them itself.

Types as numbers

Option topic
type 3, Text
Option details
type 3, Text
What the tool does

In the API an option type is a number, not a name: 3 is text, 4 is integer, 5 is true/false, 6 is user.

The request body

  • { "name": "ticket", "description": "Open a ticket", "type": 1, "options": [ { "name": "topic", "description": "What it is about", "type": 3, "required": true }, { "name": "details", "description": "More about the ticket", "type": 3, "required": false } ] }
  • POST /applications/{application.id}/guilds/{guild.id}/commands

How the command shows up on the server

Once registered, /ticket is suggested after typing a slash, with its description and the required option topic. A command registered for one server is available right away.

Your bot
/tickettopicdetailsOpen a ticket
/tickettopictextdetailstext
topic What it is about (required)
details More about the ticket

Questions