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

Create a Telegram bot on Cloudflare Workers (free)

Telegram bots are a great first back-end project: one webhook, a few commands, real users. You will define commands, generate a Cloudflare Worker that verifies Telegram’s secret header, deploy it free and register the webhook — no always-on server needed.

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

You will practise

  • How webhooks work
  • Keeping tokens in secrets, not code
  • Deploying a serverless function

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 sentences naming what the bot can do
    3–6 commands like /hours - reply text
    none: fallback reply · groq: AI reply using YOUR Groq key stored as a Worker secret
  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 a /contact command yourself, redeploy with npx wrangler deploy, and test it in Telegram.
    • 5Ship

      Cloudflare Workers free plan (100,000 requests/day). You need a free Cloudflare account and Node.js for the wrangler CLI. Step-by-step instructions are inside README.md.

    Questions people ask

    Why Cloudflare Workers instead of a server?

    A webhook bot only runs when a message arrives, so a free serverless plan fits perfectly — no server to keep alive or pay for.

    Is my bot token safe?

    It lives only in a Cloudflare secret. The generated code never contains it, and the webhook rejects requests without your secret header.

    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