The Messenger Integration: WhatsApp, Telegram & Discord
/** Take your AI everywhere. Learn how to connect OpenClaw to your favorite messaging platforms. */
#I. The Psychology of the Always-Ready Intern
In the previous era of computing, your desktop was your "Workplace." If you wanted to do something, you sat down at your desk, opened your laptop, and began. With the advent of OpenClaw Messenger Integration, the desk becomes irrelevant.
By connecting your self-hosted AI to your pocket (WhatsApp or Telegram), you shift the paradigm from "I am working" to "My intern is working." This allows for Asynchronous Intelligence. You can spawn a task while standing in line for a sandwich and receive the results five minutes later while walking to your next meeting.
This guide provides a deep-dive into the technical and tactical implementation of the OpenClaw Messenger Gateway.
#II. Telegram: The Power User’s Playground
Telegram is the gold standard for AI integration. Unlike other platforms, Telegram has a native, official Bot API that is generous, fast, and built specifically for automation.
1. Creating Your Intelligence Hub (@BotFather)
To start, you must register your bot with Telegram's central registry.
- Open Telegram and search for
@BotFather. - Send
/newbotand follow the prompts to name your intern. - Crucial: BotFather will provide an
API Token. This is the password to your bot. Do not share this.
2. Deep Configuration
Once you have your token, you tell OpenClaw how to talk to it.
Set your bot's identity
$ clawdbot config set telegram.token "74839210:ABC-DefGhi..."
Enable the service
$ clawdbot config set telegram.enabled true
Set the data format (MarkdownV2 recommended)
$ clawdbot config set telegram.parse_mode "MarkdownV2"
3. Voice & Multimedia Handling
Telegram allows OpenClaw to "Hear" and "See." If you send a voice message, OpenClaw will use its integrated transcription engine (often OpenAl Whisper) to understand you. If you send an image of a receipt, it uses Vision models to extract the data.
- Tip: Use the
/setcommandsfeature in BotFather to add quick shortcuts like/status,/clean, or/search.
#III. WhatsApp: The Reality Interfacer
WhatsApp is the most used messaging app in the world. Integrating OpenClaw here means your AI feels like a "Real Person" in your contact list. However, because WhatsApp lacks a free official API for individuals, OpenClaw uses a Gateway Architecture.
1. How the Gateway Works
The openclaw-messenger-gateway creates a virtual browser instance (Chromium) that logs into WhatsApp Web on your behalf. It "bridges" the messages coming into WhatsApp to the OpenClaw agent running on your Mac Mini.
2. Setting it up
Initialize the session
$ clawdbot gateway init whatsapp
A QR code will appear in your terminal. Scan this with your phone’s WhatsApp (Settings > Linked Devices). Your Mac Mini is now a "linked device," just like your laptop.
3. The "Second Number" Strategy
Safety First: We strongly recommend using a dedicated SIM card or a VoIP number (like Google Voice) for your WhatsApp intern. If your automation triggers a "Spam" filter, you don't want your primary personal account to be flagged.
#IV. The Asynchronous Workflow: A New Way to Work
Why bother with messengers at all? The answer is Flow.
In a traditional AI interaction, you have to wait for the bot to finish. "OpenClaw, find me 10 flight options." You wait 30 seconds. You copy the text.
In a Messenger-First workflow:
- Request (10:00 AM): You (on Telegram): "OpenClaw, scrape the top 5 threads on r/LocalLLaMA from the last 24 hours. Summarize the benchmarks for the M4 Pro."
- Recognition: OpenClaw replies: "Got it. I'm on it. I'll message you when it's done."
- Execution: Your Mac Mini at home spins up, opens a headless browser, navigates Reddit, extracts the data, and runs it through a local LLM for summary.
- Delivery (10:04 AM): While you are in an elevator, your phone buzzes with a perfectly formatted Markdown briefing.
#V. Security: The "Digital Gate"
Giving an AI access to your WhatsApp means anyone who knows your bot's number could potentially talk to it. Since OpenClaw has system-level access, this is a massive security risk.
1. Mandatory Whitelisting
OpenClaw comes with a strict Access Control List (ACL). By default, it will ignore messages from anyone not on the list.
{ "messenger": { "whitelisted_ids": [ "your_unique_telegram_id", "12345678@c.us" ], "block_unauthorized": true } }
2. Identifying your ID
To find your ID, send a message to your bot after enabling it. OpenClaw will log: [SECURITY] Unauthorized message from ID: 987654321. Copy that ID and add it to your config.
#VI. Troubleshooting & Persistence
Running a 24/7 gateway requires stability.
- Session Deaths: If your Mac Mini reboots, the WhatsApp session might die. We recommend using a process manager like PM2 to ensure
openclaw gatewayalways restarts. - Media Timeouts: Telegram has file size limits (20MB for bots). If you are asking OpenClaw to analyze a 1GB database, move the file to a local directory instead of sending it via chat.
#VII. Conclusion: The Pocket Employee
Messenger integration is the "Final Form" of the personal AI journey. It takes the power of a world-class LLM, the agency of a local Mac Mini, and the convenience of a mobile app, and fuses them into a single, seamless experience.
Your assistant is no longer a tool you "Go to." It is a partner that "Goes with you."
"An assistant you can't reach in the moment of need isn't an assistant; it's a library."
#Next Steps
Ready to take your AI to the next level? Explore Custom Skills to learn how to teach your messenger-intern to perform company-specific tasks.