Home Tutorials Categories Skills About
ZH EN JA KO
Channels

How to Connect OpenClaw to Multiple Chat Channels

· 23 min read

Introduction

One of OpenClaw's most powerful features is its ability to connect to multiple chat platforms at the same time. You can have the same AI assistant appear on WhatsApp, Telegram, Discord, Slack, Matrix, and more — each with its own model, persona, and behavior settings.

This tutorial provides a comprehensive guide to multi-channel configuration methods and best practices.

Multi-Channel Architecture Overview

OpenClaw's multi-channel architecture looks like this:

                    ┌─────────────┐
                    │  OpenClaw   │
                    │   Gateway   │
                    │  :18789     │
                    └──────┬──────┘
                           │
          ┌────────────────┼────────────────┐
          │                │                │
    ┌─────┴─────┐   ┌─────┴─────┐   ┌─────┴─────┐
    │ WhatsApp  │   │ Telegram  │   │  Discord  │
    │  Channel  │   │  Channel  │   │  Channel  │
    └───────────┘   └───────────┘   └───────────┘

Each channel runs independently, sharing the same Gateway service, but with its own configuration.

Basic Multi-Channel Configuration

Edit ~/.config/openclaw/openclaw.json5 and add multiple channels under channels:

{
  // Global model settings (used as defaults for all channels)
  model: {
    provider: "claude",
    name: "claude-sonnet-4-20250514",
    apiKey: "sk-ant-xxxxx"
  },

  channels: {
    // WhatsApp channel
    whatsapp: {
      enabled: true,
      phoneNumber: "+8613800138000",
      responseMode: "all"
    },

    // Telegram channel
    telegram: {
      enabled: true,
      botToken: "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
      responseMode: "mention"
    },

    // Discord channel
    discord: {
      enabled: true,
      botToken: "MTIzNDU2Nzg5MDEy.xxxxx.xxxxx",
      responseMode: "mention",
      allowedServers: ["1234567890"]
    },

    // Matrix channel
    matrix: {
      enabled: true,
      homeserverUrl: "https://matrix.org",
      userId: "@openclaw-bot:matrix.org",
      accessToken: "syt_xxxxx",
      responseMode: "mention"
    },

    // Slack channel
    slack: {
      enabled: true,
      botToken: "xoxb-xxxxx",
      appToken: "xapp-xxxxx",
      responseMode: "mention"
    }
  }
}

Per-Channel Independent Settings

Each channel can override the global configuration to have its own model, persona, and language settings.

Assigning Different Models to Different Channels

{
  // Global default model
  model: {
    provider: "claude",
    name: "claude-sonnet-4-20250514",
    apiKey: "sk-ant-xxxxx"
  },

  channels: {
    // Telegram uses the default Claude model
    telegram: {
      enabled: true,
      botToken: "your-telegram-token"
    },

    // Discord uses a local Ollama model (to save costs)
    discord: {
      enabled: true,
      botToken: "your-discord-token",
      model: {
        provider: "ollama",
        name: "llama3.1:70b",
        baseUrl: "http://localhost:11434"
      }
    },

    // WhatsApp uses OpenAI GPT-4o
    whatsapp: {
      enabled: true,
      phoneNumber: "+8613800138000",
      model: {
        provider: "openai",
        name: "gpt-4o",
        apiKey: "sk-xxxxx"
      }
    }
  }
}

Setting Different Personas for Different Channels

{
  channels: {
    telegram: {
      enabled: true,
      botToken: "your-telegram-token",
      persona: {
        name: "小助手",
        systemPrompt: "你是一个友好的中文AI助手,语气轻松活泼,适当使用表情符号。"
      }
    },

    slack: {
      enabled: true,
      botToken: "your-slack-token",
      appToken: "your-app-token",
      persona: {
        name: "TechBot",
        systemPrompt: "You are a professional technical assistant. Respond in English. Be concise and precise. Focus on code and technical solutions."
      }
    },

    discord: {
      enabled: true,
      botToken: "your-discord-token",
      persona: {
        name: "游戏顾问",
        systemPrompt: "你是一个游戏领域的专家,熟悉各种游戏攻略和资讯。回答时可以用轻松幽默的语气。"
      }
    }
  }
}

Channel Configuration Options at a Glance

The following options can be configured independently for each channel:

Option Description Example
model AI model settings Override the global model
persona Persona and system prompt Different personality per channel
responseMode Response mode all / mention
language Default language zh-CN / en / ja
maxTokens Maximum response token count 2048
temperature Model temperature 0.7
skills Enabled skills list ["weather", "reminder"]
rateLimit Rate limiting { maxPerMinute: 10 }

Message Routing Strategies

Shared Context vs. Isolated Context

By default, conversation contexts are isolated between different channels. You can enable shared context through configuration:

{
  context: {
    // Context isolation strategy
    // "channel": Isolate by channel (default)
    // "user": Isolate by user (same user shares context across channels)
    // "global": Globally shared
    isolation: "channel",

    // Context window size
    maxMessages: 50,

    // Context expiration time (seconds)
    ttl: 3600
  }
}

User-Based Isolation Scenario

When isolation: "user" is set, the same user's conversations can carry over across channels. For example, if a user discusses a topic on Telegram, they can continue the conversation after switching to Discord.

Users are linked through identity mapping:

{
  context: {
    isolation: "user",
    // User identity mapping (optional, for recognizing the same user across platforms)
    userMapping: {
      "telegram:12345678": "user-alice",
      "discord:98765432": "user-alice",
      "whatsapp:+8613800138000": "user-alice"
    }
  }
}

Channel-Specific Skill Configuration

You can enable different skills for different channels:

{
  channels: {
    telegram: {
      enabled: true,
      botToken: "your-token",
      // Only enable these skills
      skills: ["weather", "translate", "reminder"],
    },

    slack: {
      enabled: true,
      botToken: "your-token",
      appToken: "your-app-token",
      // Work-oriented skills
      skills: ["jira", "github", "code-review"],
    },

    discord: {
      enabled: true,
      botToken: "your-token",
      // Entertainment-oriented skills
      skills: ["trivia", "music-recommend", "game-wiki"],
    }
  }
}

Status Monitoring

Dashboard Monitoring

Launch the OpenClaw Dashboard to view real-time status of all channels:

openclaw dashboard

The Dashboard opens in your browser and displays:

  • Connection status of each channel (online/offline/error)
  • Message send/receive statistics
  • Model invocation counts and token usage
  • Real-time log stream

Command-Line Status Checks

# View all channel statuses
openclaw doctor

# View real-time logs (all channels)
openclaw logs

# View logs for a specific channel
openclaw logs --channel telegram

Typical healthy output:

OpenClaw Doctor Report
======================
Gateway:    ✓ Running on port 18789
Node.js:    ✓ v22.12.0

Channels:
  whatsapp:  ✓ Connected (uptime: 3d 14h)
  telegram:  ✓ Connected (uptime: 3d 14h)
  discord:   ✓ Connected (uptime: 3d 14h)
  matrix:    ✓ Connected (uptime: 2d 8h)
  slack:     ✗ Error: Invalid bot token

Models:
  claude:    ✓ API reachable
  ollama:    ✓ Running locally

Rate Limiting and Load Balancing

When multiple channels are active simultaneously, it's recommended to configure rate limits to avoid exhausting your API quota:

{
  // Global rate limit
  rateLimit: {
    // Maximum requests per minute (across all channels)
    globalMaxPerMinute: 60,
    // Maximum requests per user per minute
    userMaxPerMinute: 10
  },

  channels: {
    telegram: {
      enabled: true,
      botToken: "your-token",
      // Channel-level rate limit
      rateLimit: {
        maxPerMinute: 30
      }
    },

    discord: {
      enabled: true,
      botToken: "your-token",
      rateLimit: {
        maxPerMinute: 20
      }
    }
  }
}

Enabling and Disabling Channels

You can quickly enable or disable a channel using the enabled field without removing its configuration:

{
  channels: {
    whatsapp: {
      enabled: true,   // Running
      // ...
    },
    telegram: {
      enabled: false,  // Disabled but configuration preserved
      // ...
    }
  }
}

After modifying the configuration, restart OpenClaw for changes to take effect:

openclaw restart

Real-World Example: Team Multi-Channel Deployment

Here's a multi-channel configuration that a team might actually use in production:

{
  model: {
    provider: "claude",
    name: "claude-sonnet-4-20250514",
    apiKey: "sk-ant-xxxxx"
  },

  channels: {
    // Internal team Slack workspace
    slack: {
      enabled: true,
      botToken: "xoxb-xxxxx",
      appToken: "xapp-xxxxx",
      responseMode: "mention",
      persona: {
        name: "团队助手",
        systemPrompt: "你是团队的技术助手,帮助回答技术问题、review代码、查找文档。"
      },
      skills: ["github", "jira", "code-review", "docs-search"],
      language: "zh-CN"
    },

    // Customer support Telegram channel
    telegram: {
      enabled: true,
      botToken: "your-token",
      responseMode: "all",
      persona: {
        name: "客服小助",
        systemPrompt: "你是产品客服助手,礼貌地回答用户关于产品的问题。遇到无法解决的问题,建议用户联系人工客服。"
      },
      skills: ["faq", "product-docs"],
      model: {
        provider: "openai",
        name: "gpt-4o-mini",
        apiKey: "sk-xxxxx"
      }
    },

    // CEO's personal WhatsApp assistant
    whatsapp: {
      enabled: true,
      phoneNumber: "+8613800138000",
      responseMode: "all",
      persona: {
        name: "智能管家",
        systemPrompt: "你是CEO的私人智能助手,帮助处理日程、提醒、信息汇总等任务。"
      },
      skills: ["calendar", "reminder", "news-summary", "weather"]
    }
  }
}

FAQ

Will one channel going offline affect other channels?

No. Each channel runs independently, and an issue with one channel will not affect the others. OpenClaw also has a built-in automatic reconnection mechanism.

Does running multiple channels consume more memory?

Each additional channel adds approximately 20-50MB of memory usage. With 5 channels running simultaneously, total memory usage typically falls in the 200-400MB range.

How can I quickly troubleshoot channel issues?

# Run diagnostics
openclaw doctor

# View logs for a specific channel
openclaw logs --channel discord

# Check Gateway status
curl http://localhost:18789/health

Summary

With multi-channel configuration, OpenClaw can serve as your all-platform AI hub. The ability to independently configure models, personas, and skills for each channel gives you the flexibility to handle different scenarios. Combined with status monitoring and rate limiting, you can confidently deploy multi-channel services in production environments.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms