OpenClaw 支持同时接入多个消息渠道,你可以通过 Telegram、微信、Discord、Slack 等平台与 AI 助手对话。本文详细介绍各渠道的配置方法。
支持的渠道
Telegram
最推荐的渠道,响应速度快,功能完善
微信
支持企业微信和个人微信(需配置)
Discord
适合社区和团队协作
Slack
企业协作平台集成
Signal
注重隐私的安全通讯
Telegram 配置(推荐)
Telegram 是最容易配置的渠道:
- 打开 Telegram,搜索 @BotFather
- 发送 /newbot 创建新机器人
- 获取 Bot Token
- (可选)设置允许的用户列表
// openclaw.json 配置
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
"allowedUsers": ["your_user_id"]
}
}
}
微信配置(企业微信)
- 登录企业微信管理后台
- 创建自建应用
- 获取 CorpID、Secret、AgentID
- 配置可信 IP(你的服务器 IP)
// openclaw.json 配置
{
"channels": {
"wecom": {
"enabled": true,
"corpId": "wwxxxxx",
"corpSecret": "xxxxxxxx",
"agentId": "1000001",
"allowedUsers": ["user_id_1"]
}
}
}
Discord 配置
- 打开 Discord Developer Portal
- 创建新 Application
- 添加 Bot 用户
- 获取 Bot Token 和 Server ID
- 邀请 Bot 到服务器
// openclaw.json 配置
{
"channels": {
"discord": {
"enabled": true,
"botToken": "xxx",
"guildId": "123456789",
"channelIds": ["channel_id"],
"allowedUsers": ["user_id"]
}
}
}
多渠道同时使用
OpenClaw 支持同时开启多个渠道:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "xxx"
},
"discord": {
"enabled": true,
"botToken": "xxx"
},
"wecom": {
"enabled": true,
"corpId": "xxx"
}
}
}
安全设置
建议配置用户白名单,确保 AI 只响应授权用户:
{
"channels": {
"telegram": {
"allowedUsers": ["123456789", "987654321"]
}
}
}
💡 提示:获取用户 ID 可以使用 @userinfobot(Telegram)或类似工具。
消息路由
你可以通过配置实现:
- 消息转发:一个渠道的消息转发到其他渠道
- 选择性响应:只响应指定用户或群组
- 自定义前缀:使用特定前缀触发 AI
常见问题
- 微信收不到消息:检查企业微信可信 IP 是否配置正确
- Telegram 无法启动:确认 Bot Token 正确,网络能访问 Telegram API
- Discord 无响应:检查 Intent 权限配置