OpenClaw on Your VPS Series
    Part 3 of 6

    Messaging Channel Integrations

    Connect Telegram, Discord, Slack, and WhatsApp to your OpenClaw agent with per-channel routing rules.

    25 minutes
    4 platforms covered

    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 telegram

    Paste your bot token when prompted. Then open Telegram, find your bot, and send it a message.

    If the bot does not respond:

    Troubleshooting
    # 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>/getMe

    3Group Chat Configuration

    Enable mention gating to prevent the bot responding to every group message:

    openclaw config set channels.telegram.mention_gating true

    With mention gating, the bot only responds when tagged with @YourBotName in groups, but responds to all DMs.

    Discord

    1Create a Discord Bot

    1. Go to discord.com/developers/applications and click New Application
    2. Navigate to the Bot tab, click Add Bot, then Reset Token to generate a token
    3. Under Privileged Gateway Intents, enable Message Content Intent — without this, the bot cannot read message content
    4. Use OAuth2 > URL Generator with scopes bot and permissions: Send Messages, Read Message History, Read Messages/View Channels

    2Connect and Configure

    openclaw channels login --channel discord

    To restrict the bot to specific channels:

    Channel filtering
    # 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

    1. Go to api.slack.com/apps and click Create New App > From Scratch
    2. Add Bot Token Scopes: app_mentions:read, channels:history, chat:write, im:history, im:read, im:write
    3. Enable Event Subscriptions and subscribe to: app_mention, message.channels, message.im
    4. Install the app to your workspace and copy the Bot User OAuth Token and Signing Secret

    2Connect Slack to OpenClaw

    openclaw channels login --channel slack

    OpenClaw 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

    WhatsApp

    ⚠️ 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 whatsapp

    A 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 list

    Multi-Channel Routing

    Route different channels to different agents — useful for separating work and personal contexts:

    Per-channel agent routing
    # 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-5

    Group Chat Settings Reference

    SettingDescriptionDefault
    mention_gatingOnly respond when @mentioned in groupsfalse
    reply_tagsInclude channel-specific reply metadatatrue
    chunkingSplit long responses into multiple messagestrue
    max_chunk_sizeMaximum characters per chunk4000

    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.