Discord bot builder: a slash-command bot for your server
Your community needs a few things a bot does best: welcome new members, hand out roles, post event reminders, answer the same five questions. Describe what you want and your todo.is agent writes the bot in discord.py or discord.js, tests the command logic in its workspace and walks you through creating the app in the Developer Portal and keeping it online.
The prompt
- Build a Discord bot for my server [SERVER TOPIC] in [LANGUAGE]. Slash commands: [COMMANDS]. Automatic actions: [EVENTS TO REACT TO]. Who can use admin commands: [ROLES]. Use slash commands, the fewest gateway intents possible, store the token in a .env file, and handle errors with a friendly reply. Test the command logic in your workspace, then send me a zip with the code, a README with Developer Portal setup steps, the exact bot permissions to tick in the invite link, and options to host it 24/7 at [HOSTING BUDGET].
What to change
- [SERVER TOPIC]: E.g. "a 600-member book club", "a Minecraft server community", "a study group".
- [LANGUAGE]: "Python (discord.py)" or "JavaScript (discord.js)". Or "you pick".
- [COMMANDS]: E.g. "/role pick a genre role, /event list upcoming meetups, /faq answers from a list".
- [EVENTS TO REACT TO]: E.g. "welcome new members in #welcome", "remind #general 1 hour before each event". Or "none".
- [ROLES]: E.g. "Moderators and Admins only".
- [HOSTING BUDGET]: E.g. "free", "under 5 dollars a month", "my own Raspberry Pi".
Example result
- Chapter Bot for the Paper Lanterns book club (discord.py)
- Commands
- • /role genre: pick a genre role (Fantasy, Mystery, Sci-fi, Romance, Non-fiction) from a dropdown; picking again removes it
- • /event list: next 3 meetups from events.json, with date, time and voice channel
- • /event add (Moderators): add a meetup with title, date and time
- • /faq topic: answers from faq.json, e.g. "How do I suggest a book?"
- Automatic
- • New member joins: a welcome message in #welcome that mentions /role
- • 1 hour before each event: a reminder in #general with the event title and channel
- Core of bot.py
- @bot.tree.command(name="role", description="Pick or remove a genre role")
- @app_commands.choices(genre=[app_commands.Choice(name=g, value=g) for g in GENRES])
- async def role(inter: discord.Interaction, genre: app_commands.Choice[str]):
- r = discord.utils.get(inter.guild.roles, name=genre.value)
- if r in inter.user.roles:
- await inter.user.remove_roles(r)
- await inter.response.send_message(f"Removed {r.name}.", ephemeral=True)
- else:
- await inter.user.add_roles(r)
- await inter.response.send_message(f"You now have {r.name}.", ephemeral=True)
- Setup (in the README)
- • discord.com/developers > New Application > Bot > Reset Token, then paste it in .env as DISCORD_TOKEN
- • Turn on the Server Members Intent (needed for welcome messages); Message Content intent stays off
- • OAuth2 > URL Generator: scopes bot and applications.commands; permissions Manage Roles, Send Messages, Embed Links
- • In Server Settings > Roles, drag the bot's role above the genre roles, or it can't assign them
- • pip install -r requirements.txt, then python bot.py
- Tested in the workspace
- • Role toggle, event sorting, reminder timing (time zone Europe/Berlin) and FAQ matching, with a fake Discord client
- • Not tested: a live server, since the bot needs your token
- Keeping it online on a free budget
- • A free tier on a small cloud host or an old laptop or Raspberry Pi at home
- • Use a process manager (systemd or pm2) so it restarts after crashes
How to do it with todo.is
- Copy the prompt and list your commands, automatic actions and who can do what.
- Send it in todo.is or to your agent on Discord, Telegram or WhatsApp.
- Your agent writes and tests the bot logic, then sends the code zip and setup guide.
- Create the bot in the Developer Portal, add your token to .env and run it.
- Ask for new commands any time; your agent updates the code and README.
Tips for a better result
- Ask only for the intents you need. Message Content is privileged and not needed for slash commands.
- Never share your bot token, and reset it in the Developer Portal if it ever leaks.
- Put the bot's role above the roles it manages, or role commands fail with "Missing Permissions".
- Register slash commands to one test server first; global commands can take a while to appear.
- If you only need scheduled posts or reminders, a recurring todo.is to-do that messages Discord might be simpler than running a bot.
Discord bot builder: FAQ
- Do I need to host a Discord bot somewhere? Yes. A bot must run on a computer or server that's online whenever you want it to respond. The README lists low-cost options; todo.is doesn't host it for you.
- discord.py or discord.js: which should I pick? Both are mature. Pick the language you or a friend can read. Python is often easier for beginners; JavaScript fits if you already use Node.
- What permissions should my bot have? Only the ones its commands need. Avoid Administrator; a role bot needs Manage Roles, and most bots need Send Messages and Embed Links.
- Why don't my slash commands show up? They must be synced. Guild commands appear almost instantly, global ones can take longer. Also check that the invite used the applications.commands scope.
JavaScript is required to use the todo.is app.