详解OpenClaw多渠道消息集成,配置飞书、Discord、Telegram、Webhook,实现全平台自动化通知。"> OpenClaw消息集成,Discord Bot,Telegram Bot,Webhook,多渠道,OpenClaw教程">

OpenClaw消息渠道集成:让消息无处不在

📅 2026-03-29 ⏱️ 阅读时间: 9分钟 🏷️ OpenClaw | 消息集成 | 多渠道

运营AI需要监控,需要通知,需要和用户互动。消息渠道就是Agent的「感官系统」——没有它,Agent就是个聋子哑巴。这篇告诉你怎么让它开口说话。

支持的消息渠道

飞书集成

配置

# openclaw.config.json
{
  "channels": {
    "feishu": {
      "app_id": "cli_xxxxx",
      "app_secret": "secret_xxxxx",
      "default_chat": "oc_xxx"
    }
  }
}

发送消息

# 发送文本
message send --platform feishu \
  --target "oc_xxx" \
  --message "任务完成!"

# 发送富文本卡片
message send --platform feishu \
  --target "oc_xxx" \
  --message '{"tag":"card",...}'

Discord集成

配置Bot

# 1. 创建Discord应用
https://discord.com/developers/applications

# 2. 添加Bot到服务器
OAuth2 -> Install -> bot scope

# 3. 获取Token

# 4. 配置OpenClaw
{
  "channels": {
    "discord": {
      "bot_token": "xxx",
      "default_channel": "123456789"
    }
  }
}

发送消息

# 发送文本
message send --platform discord \
  --channel "123456789" \
  --message "今日热点速递 📰"

# 发送嵌入消息
message send --platform discord \
  --channel "123456789" \
  --message '{
    "embeds": [{
      "title": "AI新闻日报",
      "description": "今日AI圈发生了什么",
      "color": "5813783"
    }]
  }'

消息模板

# 每日分享模板
每日AI工具推荐 📦

🔍 今日发现:{tool_name}

{short_description}

👉 {link}

# 踩坑故事模板
🎣 踩坑实录

{title}

{story_content}

# 更多案例:{link}

Telegram集成

配置

# 1. @BotFather 创建机器人
# 2. 获取API Token
# 3. 配置

{
  "channels": {
    "telegram": {
      "bot_token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",
      "chat_id": "user_id or channel_id"
    }
  }
}

发送

message send --platform telegram \
  --chat_id "123456789" \
  --message "Hello from OpenClaw!"

Webhook集成

通用Webhook

# 发送POST请求
{
  "channels": {
    "webhook": {
      "enabled": true
    }
  }
}

# 发送数据
message send --platform webhook \
  --url "https://your-server.com/hook" \
  --data '{"event": "task_complete", "data": {...}}'

企业微信Webhook

# 通过wecom_mcp
wecom_mcp call contact getContact '{}'

定时通知配置

每日日报推送

{
  "name": "daily-digest",
  "schedule": {"kind": "cron", "expr": "0 8 * * *"},
  "delivery": {
    "mode": "announce",
    "channel": "feishu",
    "to": "oc_xxx"
  }
}

多渠道同时推送

{
  "name": "breaking-news",
  "delivery": [
    {"channel": "feishu", "to": "oc_xxx"},
    {"channel": "discord", "to": "123456"},
    {"channel": "telegram", "to": "789012"}
  ]
}

消息模板管理

# 模板目录
templates/
├── discord/
│   ├── daily_share.txt
│   ├── hot_news.txt
│   └── story.txt
├── feishu/
│   ├── report.txt
│   └── alert.txt
└── telegram/
    └── notify.txt

最佳实践

  1. 消息精简:控制在合理长度
  2. 适当分隔:不同类型消息用不同渠道
  3. 频率控制:避免刷屏打扰用户
  4. 错误处理:发送失败记录日志

相关链接