Connect Telegram
Your first real connection. Telegram is the only trusted channel for your bot.
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
- Open Telegram and search for BotFather (official Telegram account)
- Start the chat:
/start - Create new bot:
/newbot - BotFather asks for a name. Try something like jinn_myname_bot
- Choose a username (must end in
_bot). Try jinn_myname_bot - BotFather gives you a token. Looks like:
123456789:ABCDEFGHIjklmnoPQRSTuvwxyz
Copy that token somewhere safe. You'll need it in the next step.
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.
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:
- Check
openclaw gateway status— Is it running? - Check
openclaw status channels— Is Telegram connected? - Check the gateway logs:
openclaw gateway logs --follow
What's Connected Now
You have:
- A Telegram bot (registered with Telegram)
- OpenClaw gateway (listening for messages)
- Claude Sonnet 4.6 (the default AI model)
- Safety boundary: Only messages from your Telegram ID are executed
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.
Questions & Suggestions
Have a question about this page? Spotted something wrong? Want to suggest an improvement? We read everything and respond to all paid-tier questions.