How to Connect Your AI Agent to WhatsApp and Telegram

"Unable to connect to WhatsApp or Telegram."
We see this error constantly. Messaging integration is the most common pain point for new OpenClaw users — and the most rewarding once it works.
Here's the complete guide to getting your AI agent connected to the messaging platforms you actually use.
Quick Comparison
| Platform | Difficulty | Stability | Notes |
|---|---|---|---|
| Telegram | Easy | Excellent | Bot token never expires. Recommended starting point. |
| Discord | Easy | Excellent | Great for teams. Bot setup straightforward. |
| Medium | Good* | Session drops possible. Needs phone link. | |
| Signal | Medium | Good | Privacy-focused option. |
| iMessage | Hard | Varies | Requires Mac, more complex setup. |
Telegram Setup (Recommended First)
Telegram is the easiest and most stable option. Start here.
Step 1: Create Your Bot
- Open Telegram and search for
@BotFather - Send
/newbot - Choose a name (e.g., "My AI Assistant")
- Choose a username (must end in "bot", e.g.,
myai_assistant_bot) - BotFather gives you a token like:
123456789:ABCdefGHI... - Save this token — you'll need it next
Step 2: Configure OpenClaw
Add to your openclaw.json:
{
"channels": {
"telegram": {
"token": "YOUR_BOT_TOKEN_HERE"
}
}
}Step 3: Restart and Test
- Restart OpenClaw:
openclaw gateway restart - Open Telegram and find your bot
- Send a message — your AI should respond
That's it. Telegram setup takes about 5 minutes.
WhatsApp Setup
WhatsApp is trickier because it wasn't designed for bots. There are two approaches:
Option A: WhatsApp Web Link (Simpler)
This links your personal WhatsApp account to OpenClaw via WhatsApp Web.
- Add to
openclaw.json:
{
"channels": {
"whatsapp": {}
}
}- Restart OpenClaw
- A QR code appears in your terminal/logs
- Scan with WhatsApp on your phone (Settings → Linked Devices)
- Connection established
Common Issues:
- Session drops: WhatsApp may disconnect after days/weeks. Re-scan QR code to reconnect.
- QR not appearing: Check logs for errors. May need to delete old session files.
- Phone offline: Your phone must have internet for WhatsApp Web to work.
Option B: WhatsApp Business API (More Stable)
For production use, consider the official WhatsApp Business API via:
- Twilio — easiest to set up, costs per message
- Meta Business API — direct, but more complex
This requires a business account and has message costs, but won't randomly disconnect.
📬 Get practical AI insights weekly
One email/week. Real tools, real setups, zero fluff.
No spam. Unsubscribe anytime. + free AI playbook.
Discord Setup
Great for teams or communities.
Step 1: Create Discord Application
- Go to Discord Developer Portal
- Click "New Application"
- Go to "Bot" section
- Click "Add Bot"
- Copy the token
- Enable "Message Content Intent" under Privileged Intents
Step 2: Invite Bot to Server
- Go to OAuth2 → URL Generator
- Select scopes:
bot - Select permissions: Send Messages, Read Message History, etc.
- Copy the generated URL and open it
- Select your server and authorize
Step 3: Configure OpenClaw
{
"channels": {
"discord": {
"token": "YOUR_DISCORD_BOT_TOKEN"
}
}
}Multi-Channel Setup
Want your AI on multiple platforms? Just add them all:
{
"channels": {
"telegram": {
"token": "TELEGRAM_TOKEN"
},
"discord": {
"token": "DISCORD_TOKEN"
},
"whatsapp": {}
}
}Your AI will respond on all channels. Messages are separate — a Telegram conversation doesn't know about Discord messages (unless you configure shared memory).
Troubleshooting
"Bot not responding"
- Check OpenClaw is running:
openclaw status - Check logs for errors:
openclaw gateway logs - Verify token is correct (no extra spaces)
- For Telegram: make sure you're messaging the bot, not BotFather
"WhatsApp keeps disconnecting"
- Keep your phone online and charged
- Don't use WhatsApp Web on another device simultaneously
- Delete session files and re-link if persistent
- Consider Business API for critical use cases
"Discord bot offline"
- Verify Message Content Intent is enabled
- Check bot has permission to read/send in the channel
- Regenerate token if you suspect it leaked
"Rate limited"
- You're sending too many messages too fast
- Add delays between messages
- Telegram and Discord have generous limits; WhatsApp is stricter
Security Tips
- Never share your tokens — treat them like passwords
- Regenerate if exposed — if you accidentally commit a token, regenerate immediately
- Use environment variables — don't hardcode tokens in config files you share
- Restrict bot permissions — only grant what's needed
Which Should You Use?
- Personal use: Telegram (easiest, most stable)
- Team/work: Discord or Slack
- Existing WhatsApp users: WhatsApp (accepts the quirks)
- Privacy-focused: Signal
- Apple ecosystem: iMessage (if you're technical)
Most people start with Telegram, get comfortable, then add other channels as needed.
Skip the Setup?
Messaging integration is where most people get stuck. Tokens, permissions, session management — there's a lot that can go wrong.
We handle all of this. Your AI agent, connected to your messaging platforms, fully configured and tested before you start using it.
This is just the basics.
We handle the full setup — AI assistant on your hardware, connected to your email, calendar, and tools. No cloud, no subscriptions. Just message us.
Get Your AI Assistant Set UpRelated Articles
OpenClaw Complete Setup Guide 2026 (Kept Up-to-Date)
The definitive guide to installing and configuring OpenClaw. From zero to a working AI assistant in 20-45 minutes. Installation, authentication, channels, cost optimization, and troubleshooting.
OpenClaw Just Solved the Biggest Problem with AI Agents
OpenClaw's new human-in-the-loop approval system means AI agents can act autonomously but still need your OK for critical decisions. Supervised autonomy explained.
Meta Just Bought the Social Network Where AI Bots Talk to Each Other
Meta acquires Moltbook, the AI-to-AI social network built on OpenClaw. What this means for multi-agent systems.