- Home
- Skills
- APIs & Backend
- Discord Bot Builder: Slash Commands to Deploy
Works with the AI Agents you already use
Discord Bot Builder: Slash Commands to Deploy
Discord Bot Builder makes your agent build them properly.
Free
Discord Bot Builder: Slash Commands to Deploy
Example session with this skill installed
Create a Discord bot for our customer community: /track <reference> shows shipment status, and new members get a welcome message with a menu to pick their country role. Node/TypeScript.
- Read your context and instructions
- Compiled the discord bot builder
Plan
Bot (not webhook) - needs slash commands, buttons and roles.
- Intents:
Guilds+GuildMembers(privileged, needed for the join event) -
enable it in the Developer Portal. No MessageContent.
- Invite permissions: View Channel, Send Messages, Embed Links, Manage Roles (no Administrator). Bot role must sit above the country roles.
Built (discord.js v14, TypeScript)
src/
commands/track.ts /track reference:<string> -> deferReply (ephemeral) -> your tracking API -> embed
events/guildMemberAdd.ts welcome embed in #welcome + select menu "Pick your country"
interactions/countrySelect.ts assigns 1 country role, removes others, ephemeral confirmation
deploy-commands.ts dev guild now, global for release
index.ts router + error handling
.env.example DISCORD_TOKEN, CLIENT_ID, GUILD_ID, TRACKING_API_URL
Dockerfile node:22-alpine, non-root user
/trackvalidates the reference format, replies "Not found" ephemerally, never shows other customers' data (the API is called with the member's own Discord-linked account id)- Country roles are read from config (
ES, FR, DE, IT, PT, Other) so admins can change them without code - Errors: ephemeral "Something went wrong" + logged stack
Tested on a dev server
| Case | Result |
|---|---|
| /track valid ref | embed in 1.2 s (deferred) ✔ |
| /track unknown ref | ephemeral "Not found" ✔ |
| New member joins | welcome + select menu ✔ |
| Pick FR, then ES | FR removed, ES added ✔ |
| Bot role below country roles | clear error message to admins ✔ |
tsc --noEmit | clean ✔ |
Deploy
Railway worker (always on), env vars in Railway secrets, auto-restart. Run npm run deploy:commands -- --global when ready.
Not done: posting in your real server - waiting for your OK.
Connects securely to your tools. The creator never sees your data.
About this skill
A bot that responds, scales and doesn't ask for Administrator
Discord bots built quickly tend to break the same way: "The application did not respond", commands that never show up, privileged intents and Administrator permission for no reason, tokens committed to git. Discord Bot Builder makes your agent build them properly.
What it does
- Webhook or bot? Uses a simple channel webhook when you only need to post (CI, monitoring, forms, RSS) and a real bot only when you need interaction.
- Secure setup: token in
.env, never printed or committed; invite URL with only the permissions each feature needs; minimal intents (privileged ones only when truly required). - Clean structure: one file per command, events folder, a command-registration script (dev guild for instant testing, global for release).
- Interactions done right: typed options, choices and autocomplete; reply or defer within 3 seconds; ephemeral replies; buttons, selects and modals; embeds within Discord's limits.
- Permissions & errors: default member permissions plus code checks for admin commands, friendly ephemeral errors, logging, respect for rate limits.
- Test & deploy: dev-server checklist, then always-on hosting (Railway, Fly.io, VPS with systemd/Docker) or HTTP interactions for serverless.
- Troubleshooting table for the most common problems.
- Rules: no self-bots, spam, mass DMs or member scraping; asks before posting to real community channels.
Includes
- SKILL.md workflow
- references/patterns.md - webhook + GitHub Actions, discord.js v14 TypeScript (command, router, registration - typechecked against v14.28), discord.py 2.x equivalent, permissions cheat-sheet, common problems
Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI and any SKILL.md-compatible agent.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
No support for self-bots or mass DM tools. Serverless hosting is restricted to HTTP interactions. Privileged intents require manual activation in the Discord Portal.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
This skill has been used 12 times.
Trust & safety
Security scan
Security scan passed 8 days ago
- Free with an Agensi account