Skip to main content
Chapter 4 Remote Control: Telegram, WhatsApp, Slack & iMessage

Setting Up the Telegram Bot: BotFather to Onboarding

9 min read Lesson 22 / 65 Preview

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

  1. Open @BotFather in Telegram
  2. Send /newbot
  3. Pick a display name and a unique username ending in bot
  4. 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 /help and /sessions commands via BotFather's /setcommands for 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.

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support