This guide explains how to integrate OpenClaw with popular messaging platforms like Discord, Slack, and Telegram, allowing your AI agent to interact with users across multiple channels.
OpenClaw can be integrated with messaging platforms through its channel system. This allows the AI to receive messages, process them, and respond appropriately across different communication channels. Configuration is stored in ~/.openclaw/openclaw.json.
bot and permissions: Send Messages, Read Message History, View Channelschat:writechannels:readgroups:readim:readmpim:read/newbot and follow the promptsThe easiest way to configure messaging platforms is through the OpenClaw Web UI:
http://localhost:18789/?token=<your-token>Alternatively, use the CLI to add channels:
# Add Telegram channel
openclaw channels add telegram --token <your-telegram-bot-token>
# Add Discord channel
openclaw channels add discord --token <your-discord-bot-token>
# Add Slack channel
openclaw channels add slack --token <your-slack-bot-token>
# Add WhatsApp (requires QR code pairing)
openclaw channels add whatsapp
# Then scan the QR code in the Web UI
You can also edit the configuration file directly at ~/.openclaw/openclaw.json:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "your-telegram-bot-token-here"
},
"discord": {
"enabled": true,
"botToken": "your-discord-bot-token-here"
},
"slack": {
"enabled": true,
"botToken": "xoxb-your-slack-token-here",
"appToken": "xapp-your-app-token-here"
},
"whatsapp": {
"enabled": true
}
}
}
After editing, restart the gateway:
openclaw gateway restart
If running OpenClaw in Docker, you can pass channel tokens via environment variables:
version: '3.8'
services:
openclaw-gateway:
image: ${OPENCLAW_IMAGE:-openclaw:local}
container_name: openclaw-gateway
restart: unless-stopped
ports:
- "${OPENCLAW_GATEWAY_PORT:-18789}:18789"
volumes:
- ${OPENCLAW_CONFIG_DIR}:/home/node/.openclaw
- ${OPENCLAW_WORKSPACE_DIR}:/home/node/.openclaw/workspace
environment:
- HOME=/home/node
- OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN}
# Channel tokens (optional - can also configure via Web UI)
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
- SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN}
command: ["node", "dist/index.js", "gateway", "--bind", "${OPENCLAW_GATEWAY_BIND:-lan}", "--port", "18789"]
openclaw-cli:
image: ${OPENCLAW_IMAGE:-openclaw:local}
container_name: openclaw-cli
restart: unless-stopped
volumes:
- ${OPENCLAW_CONFIG_DIR}:/home/node/.openclaw
- ${OPENCLAW_WORKSPACE_DIR}:/home/node/.openclaw/workspace
environment:
- HOME=/home/node
- OPENCLAW_GATEWAY_TOKEN=${OPENCLAW_GATEWAY_TOKEN}
- BROWSER=echo
entrypoint: ["node", "dist/index.js"]
stdin_open: true
tty: true
Create a .env file:
cat > .env << EOF
# Gateway access token
OPENCLAW_GATEWAY_TOKEN=your-random-token-here
# Gateway ports
OPENCLAW_GATEWAY_PORT=18789
OPENCLAW_BRIDGE_PORT=18790
OPENCLAW_GATEWAY_BIND=lan
# Volume paths
OPENCLAW_CONFIG_DIR=/opt/openclaw/config
OPENCLAW_WORKSPACE_DIR=/opt/openclaw/workspace
# Channel tokens
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
DISCORD_BOT_TOKEN=your-discord-bot-token
SLACK_BOT_TOKEN=xoxb-your-slack-token
EOF
WhatsApp uses the Web protocol and requires QR code pairing:
openclaw gateway --port 18789http://localhost:18789Slack requires both a bot token and an app token for Socket Mode:
Send a test message to your configured channel:
# Send a test message via CLI
openclaw message send --to <channel-or-number> --message "Hello from OpenClaw"
# Check channel status
openclaw channels list
# View gateway logs for message processing
docker compose logs -f openclaw-gateway
For advanced setups with multiple channels, you can configure message routing:
{
"channels": {
"routing": {
"defaultAgent": "main",
"perChannelAgents": true,
"crossChannelMemory": true
}
}
}
This allows:
docker compose logs openclaw-gateway | grep -i "channel\|error"
openclaw.json syntax| Platform | Setup Method | Status |
|---|---|---|
| Telegram | Bot token | ✅ Fully supported |
| QR code pairing | ✅ Fully supported | |
| Discord | Bot token | ✅ Fully supported |
| Slack | Bot token + App token | ✅ Fully supported |
| iMessage | BlueBubbles (macOS) | ✅ Supported |
| Signal | signal-cli | ✅ Supported |
| Mattermost | Plugin | ✅ Via extension |
| Google Chat | API | ✅ Supported |
| Microsoft Teams | Bot framework | ✅ Supported |
| Matrix | Extension | ✅ Via extension |
Any questions?
Feel free to contact us. Find all contact information on our contact page.