Build a Telegram bot with Claude Code, running 24/7

Build a Telegram bot with Claude Code and keep it answering 24/7 with your laptop closed. Paste one paragraph; your agent writes, deploys and checks it.

You can have a Telegram bot that answers around the clock, built and put online by Claude Code, Codex or Cursor from one paragraph you paste. You create the bot inside Telegram, save its key in your aidrop.it project, and your agent does the rest: it writes the bot, puts it online and connects it to Telegram. Plan on about 20 minutes, mostly waiting for the first build.

The bot lives on aidrop.it, not on your computer. Telegram passes every new message straight to the bot’s own web address, so nothing has to stay open on your side. For a deeper, more technical version, see our Telegram bot walkthrough.

What you will have at the end

  • A Telegram bot, found by its name, that replies to /start within a second or two.
  • A bot that keeps answering when your laptop is closed and after every update.
  • The bot’s code saved in a repository, so your agent can change it later.

Words you will meet

  • BotFather — Telegram’s own official bot that creates new bots for you.
  • Bot token — the key Telegram gives your bot. Anyone who has it can act as your bot, so treat it like a password.
  • Webhook — the web address Telegram calls each time someone writes to your bot.
  • Secret — a private value, like the bot token, saved in your aidrop.it project and handed to the bot when it runs. It is never written into the code.
  • Project and Service — a Project is your product on aidrop.it. A Service is one running piece of it; here, the bot.

What you need

  • A Telegram account.
  • An aidrop.it account with your agent connected. The Quickstart shows how.
  • An aidrop.it plan that runs apps. This bot is small and needs no database, so the smallest plan is enough.
  • A bot token. In Telegram, open @BotFather, send it /newbot, choose a name and a username ending in “bot”, and copy the token it gives you (Telegram’s guide).

Do not paste the token into the chat with your agent. The agent will tell you the exact name to save it under on the Project Secrets page of your aidrop.it dashboard.

Say this to your agent

Say this to your agent
Build me a Telegram bot and run it on aidrop.it, 24/7.
Use my existing aidrop.it Project, or create one called
"Telegram bot" if I have none.
What it does: when someone sends /start in a private chat, it
replies "Hello from my bot." It ignores everything else.
How it works:
- Use the official Telegram Bot API with a webhook, not polling.
- Protect the webhook with a random secret token and reject any
request that does not carry it.
- The bot registers its own webhook when it starts, using its
public aidrop.it address. After the first build, store that
address as a Project secret and build again.
- Read aidrop.it's runtime rules before writing code and follow
them. Outgoing requests must go through the proxy the platform
sets; make sure your HTTP client uses it (Node's built-in fetch
does not by default).
Secrets: before building, tell me the exact secret names to add
on the Project Secrets page (the bot token and the webhook
secret) and wait until I confirm. Never ask me to paste values
into this chat, and never log them.
Build it, check it runs, fix anything that fails, and tell me
when I can send /start. Report the bot's address and what you
checked.

What your agent does

  1. Picks your aidrop.it project, or creates one.
  2. Tells you which secrets to save, and waits while you save them.
  3. Writes the bot, including a small “I’m alive” page that aidrop.it checks to know the bot is running.
  4. Saves the code to a repository on aidrop.it and builds it there.
  5. Watches the build. If it fails, it reads the error, fixes the code and builds again.
  6. Gives the bot its public web address, and the bot tells Telegram to deliver messages there.

Check that it works

  • Your agent says the bot is running and gives you its address.
  • Open the bot in Telegram and send /start. It answers “Hello from my bot.”
  • Close your laptop and message the bot from your phone. It still answers.

When something goes wrong

What you see What to tell your agent
The agent says the build is waiting for secrets Check the names on the Project Secrets page match what the agent asked for, then say “Saved, build again.”
The build finished, but aidrop.it says the app is not running “Read the logs, find why the bot does not start or its “I’m alive” page fails, fix it and build again.”
The bot never answers /start “The bot gets no messages or cannot reply. Check the webhook is set up and that the bot’s outgoing requests can leave aidrop.it.”
The bot crashes, saying it cannot write a file “The app’s disk is read-only. Write nothing to disk; keep anything lasting in a database.”
The bot sometimes answers twice “Telegram retried a slow reply. Answer Telegram at once and skip messages you already handled.”

FAQ

Should my Telegram bot use polling or a webhook?

Both are official. With polling, the bot keeps asking Telegram for new messages. With a webhook, Telegram calls the bot whenever a message arrives, which suits a bot living at a public web address. One bot cannot do both at once: while a webhook is set, polling stops working (Telegram Bot API).

What do I do if my bot token leaks?

Open @BotFather and send it /token to get a new token for your bot (Telegram docs). Save the new token in place of the old one, then ask your agent to build the bot again so it uses the new key.

Can Claude Code build an AI Telegram bot that answers with Claude?

Yes. Ask your agent to send each message to the Claude API and reply with the answer. You will need an Anthropic API key, saved as one more secret. Ask it to answer Telegram at once and send the reply when the model is done.

Can I host a Telegram bot for free?

Telegram’s Bot API costs nothing. Keeping a bot online around the clock needs a server, and that is the part you pay for. On aidrop.it the free plan runs nothing; the smallest plan, Starter, runs a bot like this one, because it needs no database. See aidrop.it for current prices.

Search the docs