Messaging Channel Integrations
Connect Telegram, Discord, Slack, and WhatsApp to your OpenClaw agent with per-channel routing rules.
How Channels Work in OpenClaw
Every channel connects to the Gateway, not directly to an agent. The Gateway decides which agent handles an incoming message based on channel routing rules. By default, all messages on a channel route to your primary agent, but you can configure multiple agents and route to them by mention, keyword, or message type.
When you add a channel, OpenClaw creates a persistent connection to that platform's API. These connections survive Gateway restarts because credentials and session state are stored in ~/.openclaw/credentials/.
Telegram
Telegram is the recommended first channel for VPS deployments. The setup is clean, the API is reliable, and the bot ecosystem is well-documented.
1Create a Telegram Bot
Open Telegram and search for @BotFather. Send /newbot and follow the prompts. You will receive a bot token.
Important settings to configure in BotFather:
/setprivacy— Set to Disabled if you want the bot to read all messages in group chats/setjoingroups— Set to Disabled if this is a personal assistant you do not want added to groups by others
2Connect and Test
openclaw channels login --channel telegramPaste your bot token when prompted. Then open Telegram, find your bot, and send it a message.
If the bot does not respond:
# Check channel status
openclaw channels list
# View Gateway logs
journalctl --user -u openclaw -f
# Confirm VPS can reach Telegram's API
curl -s https://api.telegram.org/bot<YOUR_TOKEN>/getMe3Group Chat Configuration
Enable mention gating to prevent the bot responding to every group message:
openclaw config set channels.telegram.mention_gating trueWith mention gating, the bot only responds when tagged with @YourBotName in groups, but responds to all DMs.
Discord
1Create a Discord Bot
- Go to discord.com/developers/applications and click New Application
- Navigate to the Bot tab, click Add Bot, then Reset Token to generate a token
- Under Privileged Gateway Intents, enable Message Content Intent — without this, the bot cannot read message content
- Use OAuth2 > URL Generator with scopes
botand permissions: Send Messages, Read Message History, Read Messages/View Channels
2Connect and Configure
openclaw channels login --channel discordTo restrict the bot to specific channels:
# List available Discord channels
openclaw channels discord list-channels
# Set allowed channels by ID
openclaw config set channels.discord.allowed_channels "123456789012345678,987654321098765432"Get channel IDs by enabling Developer Mode in Discord (User Settings > Advanced > Developer Mode).
Slack
1Create a Slack App
- Go to api.slack.com/apps and click Create New App > From Scratch
- Add Bot Token Scopes:
app_mentions:read,channels:history,chat:write,im:history,im:read,im:write - Enable Event Subscriptions and subscribe to:
app_mention,message.channels,message.im - Install the app to your workspace and copy the Bot User OAuth Token and Signing Secret
2Connect Slack to OpenClaw
openclaw channels login --channel slackOpenClaw will output the webhook URL to add under Event Subscriptions > Request URL in your Slack app:
Webhook URL: https://agent.yourdomain.com/channels/slack/events⚠️ Important Caveats
- OpenClaw uses Baileys, an unofficial WhatsApp Web API. This is not an official Meta integration.
- Account bans are rare but possible, particularly at high volume.
- The session requires your phone number to remain active on WhatsApp.
- Connections occasionally drop and may require re-scanning the QR code.
1Connect WhatsApp
openclaw channels login --channel whatsappA QR code will appear in your terminal. On your phone, open WhatsApp > Settings > Linked Devices > Link a Device, then scan it.
Verify the session persists across restarts:
openclaw gateway restart
openclaw channels listMulti-Channel Routing
Route different channels to different agents — useful for separating work and personal contexts:
# Set agents per channel
openclaw channels slack set-agent work-agent
openclaw channels telegram set-agent personal-agent
# Create agents with different personalities
openclaw agents create --name work-agent \
--system-prompt "You are a professional assistant. Be concise." \
--model claude-opus-4-5
openclaw agents create --name personal-agent \
--system-prompt "You are a helpful personal assistant." \
--model claude-sonnet-4-5Group Chat Settings Reference
| Setting | Description | Default |
|---|---|---|
| mention_gating | Only respond when @mentioned in groups | false |
| reply_tags | Include channel-specific reply metadata | true |
| chunking | Split long responses into multiple messages | true |
| max_chunk_size | Maximum characters per chunk | 4000 |
Troubleshooting Channel Connections
Bot connected but not responding: Check that the agent has a valid model provider. Run openclaw agents list and confirm the model field is set.
Telegram "Unauthorized" error: The bot token is invalid or has been regenerated. Re-run openclaw channels login --channel telegram.
Discord bot online but not reading messages: Message Content Intent is not enabled in the Developer Portal.
Slack events not arriving: The webhook URL in your Slack app settings doesn't match. Check openclaw channels slack webhook-url.
WhatsApp session expired: Re-run openclaw channels login --channel whatsapp and scan a new QR code.
