Wiring OpenClaw to Telegram
Plan for fifteen minutes. The result is the single most useful integration in the course.
Step 1 — create the bot in BotFather
- Open
@BotFatherin Telegram - Send
/newbot - Pick a display name and a unique username ending in
bot - Copy the HTTP API token that BotFather hands back
Step 2 — add the token to OpenClaw
In your OpenClaw secrets file (the path is in the docs — typically ~/.openclaw/secrets.env):
TELEGRAM_BOT_TOKEN=123456789:AAH....
TELEGRAM_OWNER_ID=987654321
Find your owner ID by sending /start to @userinfobot. Locking the bot to your ID prevents random strangers from chatting with your agent.
Step 3 — restart OpenClaw
systemctl restart openclaw # or compose restart, or your local launcher
In the debug console, the Telegram channel should turn green.
Step 4 — first message
Find your bot in Telegram (search by the username). Send /start. The agent should reply with a short welcome built from your Soul + Identity files.
Onboarding niceties
- Set a description and "About" text via BotFather (
/setdescription,/setabouttext) — they show up when someone opens a fresh chat - Set a profile picture — your bot should look like a contact, not a bot
- Add
/helpand/sessionscommands via BotFather's/setcommandsfor quick discoverability
Common pitfalls
- "Unauthorized" error in logs — wrong token or pasted with whitespace
- Bot is silent — confirm it is enabled in OpenClaw config and that the channel is started in the debug console
- Replies arrive but are blank — usually a model error; check the event log
Try it
Send your bot a question that requires using the filesystem tool ("list the files in ~/openclaw-test"). Confirm it answers correctly from your phone.