discord-slash-commands
Skill37 starsChanged 9 months agoMITView on GitHub
Generate Discord slash command definitions for discli. Creates the JSON file used by `discli serve --slash-commands`. Supports string, integer, number, boolean params with descriptions and optional flags.
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- discord-agentSkill
- discord-botSkill
- discord-loggerSkill
- discord-moderationSkill
- discord-support-botSkill
- discord-welcomeSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use this skill when the user wants to:
- Distinctive: line 13
Create slash commands for their Discord bot
- Distinctive: line 15
Add new commands to an existing slash commands file
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Discord Slash Command Generator
Generate slash command JSON definitions for use with discli serve --slash-commands commands.json.
When to Use
Use this skill when the user wants to:
- Create slash commands for their Discord bot
- Generate the JSON file for
discli serve --slash-commands - Add new commands to an existing slash commands file
- Understand the slash command format
JSON Format
[
{
"name": "command-name",
"description": "What this command does (shown in Discord UI)",
"params": [
{
"name": "param_name",
"type": "string",
"description": "Shown as placeholder text",
"required": true
}
]
}
]Rules
name: lowercase, no spaces, max 32 chars. Use hyphens:my-commanddescription: max 100 chars. Shown in Discord's command pickerparams: optional array. Each param hasname,type,descriptiontype: one ofstring,integer,number,booleanrequired: defaults totrue. Setfalsefor optional params- Max 25 commands per bot, max 25 params per command
Common Patterns
Simple command (no params)
{"name": "ping", "description": "Check if the bot is alive"}Single required param
{"name": "ask", "description": "Ask the bot a question", "params": [
{"name": "question", "type": "string", "description": "Your question"}
]}Multiple params, some optional
{"name": "remind", "description": "Set a reminder", "params": [
{"name": "message", "type": "string", "description": "What to remind you about"},
{"name": "minutes", "type": "integer", "description": "Minutes from now", "required": false}
]}Boolean flag
{"name": "search", "description": "Search messages", "params": [
{"name": "query", "type": "string", "description": "Search terms"},
{"name": "include-bots", "type": "boolean", "description": "Include bot messages", "required": false}
]}Example: Full Bot Command Set
[
{"name": "help", "description": "Show available commands"},
{"name": "ask", "description": "Ask the AI a question", "params": [
{"name": "question", "type": "string", "description": "Your question"}
]},
{"name": "summarize", "description": "Summarize recent conversation", "params": [
{"name": "messages", "type": "integer", "description": "Number of messages to summarize", "required": false}
]},
{"name": "translate", "description": "Translate text", "params": [
{"name": "text", "type": "string", "description": "Text to translate"},
{"name": "language", "type": "string", "description": "Target language"}
]},
{"name": "poll", "description": "Create a quick poll", "params": [
{"name": "question", "type": "string", "description": "Poll question"},
{"name": "option1", "type": "string", "description": "First option"},
{"name": "option2", "type": "string", "description": "Second option"},
{"name": "option3", "type": "string", "description": "Third option (optional)", "required": false}
]},
{"name": "config", "description": "Configure bot settings", "params": [
{"name": "setting", "type": "string", "description": "Setting name"},
{"name": "value", "type": "string", "description": "New value", "required": false}
]},
{"name": "stats", "description": "Show server statistics"},
{"name": "clear", "description": "Clear conversation history"}
]Handling in Python
async def on_slash_command(event: dict, send) -> None:
command = event["command"]
args = event.get("args", {})
token = event["interaction_token"]
if command == "ask":
question = args.get("question", "")
# ... process question ...
await send("interaction_followup", interaction_token=token, content=answer)
elif command == "help":
await send("interaction_followup", interaction_token=token,
content="Available commands: /ask, /help, /stats")Usage
Save the JSON to a file, then:
discli serve --slash-commands commands.jsonCommands sync to all servers on bot startup. The slash_commands_synced event confirms completion.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

