FREE PRACTICAL AI LEARNING · LEARN BY DOINGNO SIGNUP NEEDED · YOUR WORK STAYS YOURS
Open PracticePRACTICAL AI ENGINEERING
FREE TOOL · BUILD APPS

Create a Discord slash-command bot (free, serverless)

Discord slash commands can run on a free serverless endpoint. You will define commands, generate a Worker that verifies Discord’s Ed25519 signatures, register commands with a one-off script and add the bot to a test server.

⏱ 20–40 min · Download a ZIP · Deploy free · No signup

You will practise

  • How Discord interactions and signatures work
  • Registering slash commands via the API
  • Deploying a serverless endpoint

No AI key needed. The code comes from a reviewed template.

  1. 1Brief

    Answer a few questions. The generator writes the code; you will read and change it.

    2–6 commands; names lowercase a–z, 0–9, - or _
  2. 2Make

    Generate the project, then open every file. Comments explain each part. You can edit files right here.

  3. 3Check

    Automatic checks for the mistakes that break real projects: invalid config, leaked keys, missing security steps.

    • 4Improve

      1. Run the check first.
      Your change: Add an /about command, re-run register-commands.mjs and test it in your server.
    • 5Ship

      Cloudflare Workers free plan + Discord Developer Portal (free). Step-by-step instructions are inside README.md.

    Questions people ask

    Why not a normal bot that stays online?

    Slash-command bots can use Discord’s HTTP interactions instead of a constant connection, so a free serverless function is enough.

    What if Discord will not save my endpoint URL?

    Discord sends a signed test request. Saving fails if the public key secret is wrong or missing — re-run wrangler secret put DISCORD_PUBLIC_KEY.

    Do I need an AI key to use this?

    No. The guided template teaches the same skill with no AI at all. If you add your own free key (Groq, Google Gemini, OpenRouter, Mistral or Cerebras), the tool can also draft and revise. The key stays in your browser and requests go straight to that provider.

    Where is my work saved?

    In this browser only (local storage), until you copy or download it. Nothing you type is sent to Open Practice.

    Keep building