Connect Telegram

Your first real connection. Telegram is the only trusted channel for your bot.

TL;DR: Create a bot with BotFather → Get token → openclaw channels login telegram → Paste token → Send a test message. You're live.

Why Telegram?

Telegram is the trusted instruction channel. Only messages from your Telegram ID are executed without additional approval. Email, social DMs, web forms — all untrusted. Telegram only.

This matters for safety. Bad actors can't spoof Telegram messages (not trivially). They can spoof email. So we listen to Telegram.

Step 1: Create a Bot with BotFather

  1. Open Telegram and search for BotFather (official Telegram account)
  2. Start the chat: /start
  3. Create new bot: /newbot
  4. BotFather asks for a name. Try something like jinn_myname_bot
  5. Choose a username (must end in _bot). Try jinn_myname_bot
  6. BotFather gives you a token. Looks like: 123456789:ABCDEFGHIjklmnoPQRSTuvwxyz

Copy that token somewhere safe. You'll need it in the next step.

Keep this token private! Anyone with it can control your bot. Don't commit it to GitHub. Don't post it in screenshots.

Step 2: Register the Token with OpenClaw

openclaw channels login telegram

OpenClaw will ask for your bot token. Paste it.

Then it asks: "Allow incoming from:" — This is crucial. Enter your Telegram user ID (a number like 8638441101). Messages from only this ID will be trusted for commands.

Find your Telegram ID: Message @userinfobot on Telegram. It replies with your ID. Copy it.

Step 3: Fix the Streaming Bug

OpenClaw has one known gotcha with Telegram: by default it streams replies as they're generated. This causes double messages in some cases.

Fix it immediately:

cat ~/.openclaw/openclaw.json | python3 -m json.tool

Look for "streaming". Change it to:

"streaming": "off"

The full Telegram section should look like:

"channels": { "telegram": { "bot_token": "YOUR_TOKEN_HERE", "mode": "polling", "streaming": "off", "allowFrom": [8638441101] } }

Save it, then restart the gateway:

openclaw gateway restart

Step 4: Test It

Open Telegram. Find your bot (search for jinn_myname_bot). Send a message:

Hello, what is 2 + 2?

Your AI should respond within 5 seconds. If it doesn't:

What's Connected Now

You have:

Everything else still requires approval or is untrusted. This is intentional.

Next: API Keys & Models

Right now you're using just Anthropic (Claude). Next step is to add OpenAI and Google so you have choices for different tasks.