🎯 学习目标:配置多个聊天渠道
支持的渠道
| 渠道 | 特点 |
|---|---|
| Telegram | 最简单,Bot API |
| Discord | 服务器/频道/DM |
| 飞书 | 企业常用,WebSocket |
| 需要 QR 配对 | |
| Signal | 隐私优先 |
| iMessage | 仅 macOS |
| Slack | 工作空间应用 |
飞书配置
Step 1: 创建应用
- 登录 飞书开放平台
- 创建企业自建应用
- 开启机器人能力
- 获取 App ID 和 App Secret
Step 2: 配置 OpenClaw
openclaw configure --section feishu
或直接编辑配置:
{
"channels": {
"feishu": {
"appId": "cli_xxx",
"appSecret": "xxx"
}
}
}
Step 3: 配置事件订阅
在飞书开放平台配置:
- 消息接收事件
- WebSocket 方式(推荐)
Discord 配置
Step 1: 创建应用
- 登录 Discord Developer Portal
- 创建 Application
- 在 Bot 页面创建 Bot
- 获取 Token
- 生成邀请链接,添加到服务器
Step 2: 配置 OpenClaw
openclaw configure --section discord
{
"channels": {
"discord": {
"token": "xxx"
}
}
}
同时运行多渠道
配置文件中可以同时配置多个渠道:
{
"channels": {
"telegram": {
"token": "xxx"
},
"discord": {
"token": "xxx"
},
"feishu": {
"appId": "xxx",
"appSecret": "xxx"
}
}
}
OpenClaw 会同时连接所有配置的渠道。
安全配置
限制允许的用户
{
"channels": {
"telegram": {
"token": "xxx",
"allowFrom": ["your_telegram_id"]
}
}
}
群聊需要 @ 提及
{
"channels": {
"telegram": {
"token": "xxx",
"groups": {
"*": { "requireMention": true }
}
}
}
}
检查渠道状态
openclaw status
✅ 今日练习
- 选择并配置第二个聊天渠道
- 测试两个渠道都能正常工作
- 配置安全限制(allowFrom)
- 使用
openclaw status检查所有渠道