Module 2: Connecting Your Apps
Add Telegram, WhatsApp, Slack, and other messaging channels to your OpenClaw agent.
- Create a Telegram bot and connect it to OpenClaw
- Understand DM policies and when to use each one
- Pair your account with the agent
- Troubleshoot common channel connection issues
Why this matters
Right now your agent only works through the CLI. In this module, you connect it to a real messaging app so you can chat with it from your phone — just like texting a friend.
Why Telegram first
Telegram is the fastest channel to set up:
- No phone number pairing required
- Official Bot API (free, stable)
- Works on any device
- Takes about 2 minutes
You can add WhatsApp, Slack, Discord, and more later. See the Channels guide for all supported platforms.
Step 1: Create your bot
- Open Telegram and search for @BotFather
- Send
/newbot - Choose a display name (e.g., "My OpenClaw")
- Choose a username ending in
bot(e.g.,my_openclaw_bot) - Copy the bot token BotFather gives you
Keep this token private — anyone with it can control your bot.
Step 2: Add the channel config
Open your OpenClaw configuration:
openclaw config editAdd the Telegram channel to your configuration:
{
"channels": {
"telegram": {
"token": "YOUR_BOT_TOKEN_HERE",
"dmPolicy": "pairing"
}
}
}Add to existing config
Do not replace your entire configuration file. Add the channels block
alongside your existing settings.
Step 3: Understand DM policies
The dmPolicy setting controls who can message your agent:
| Policy | Who can message | Best for |
|---|---|---|
pairing | Users you approve one by one | Getting started (default) |
allowlist | Only specific user IDs you list | Production use |
open | Anyone who finds your bot | Never recommended |
Start with pairing — it lets you approve yourself easily, then switch to
allowlist once you know your Telegram user ID.
To find your Telegram user ID, message @userinfobot — it replies with your numeric ID.
For allowlist mode:
{
"channels": {
"telegram": {
"token": "YOUR_BOT_TOKEN_HERE",
"dmPolicy": "allowlist",
"allowedUsers": [123456789]
}
}
}Step 4: Restart and pair
Apply your changes:
openclaw gateway restartCheck that the channel is connected:
openclaw gateway statusNow open Telegram and send /start to your bot. With pairing mode, you need
to approve the request:
openclaw channels pairThis shows pending requests. Approve yours, and you are connected.
Step 5: Test it
Send a message to your bot in Telegram:
Hello! What can you do?
You should get a response within a few seconds. The agent reads your SOUL.md and USER.md on each message, sends the request to your AI provider, and streams the response back.
Troubleshooting
| Problem | Fix |
|---|---|
| Bot not responding | Run openclaw gateway status — is the gateway running? |
| "Not paired" error | Run openclaw channels pair and approve your request |
| Slow responses | Check your AI model — cloud models need network access |
| Connection dropped | Run openclaw gateway restart |
Check logs for more detail:
openclaw logs --filter telegramValidate your config file syntax:
openclaw config validateAdding more channels
Once Telegram is working, you can add other channels the same way. Each channel gets its own section in the config with its own DM policy.
See the Channels guide for setup instructions for WhatsApp, Slack, Discord, iMessage, and more. If you hit issues connecting a channel, the troubleshooting guide covers the most common errors.
Finished this module?
Tracks your progress across all 10 modules