OpenClaw 多渠道消息:一个Agent,到处发声

📅 2026-03-19 ⏱️ 阅读时间: 7分钟 🏷️ Message | 多渠道 | 消息推送

世界上有一种Agent,它不挑食——Discord、飞书、Telegram、邮件,来者不拒。一次发送,全平台覆盖。这就是多渠道消息系统的魔力。

什么是多渠道消息?

OpenClaw提供统一的消息接口,让你:

支持的平台

平台 功能 特殊能力
Discord 消息/Embed/按钮 线程、论坛、表情反应
飞书 消息/卡片 文档、多维表格、Wiki
Telegram 消息/按钮 内联键盘、投票
邮件 文本/HTML邮件 附件、模板
Slack 消息/Block 频道、私信

发送消息

基础发送

{
  "action": "send",
  "target": "discord-channel-123",
  "message": "这是一条来自Agent的消息"
}

发送带格式

{
  "action": "send",
  "target": "discord-channel-123",
  "message": "**重要通知**\n\n这是一个多行消息\n> 引用内容"
}

发送媒体文件

{
  "action": "send",
  "target": "discord-channel-123",
  "message": "这是生成的报告",
  "media": "/path/to/report.pdf",
  "filename": "report.pdf"
}

Discord 特定功能

创建线程

{
  "action": "thread-create",
  "channelId": "123456789",
  "threadName": "讨论主题",
  "message": "线程的起始消息"
}

发送Embed

// Discord会自动将Markdown转换为Embed
{
  "action": "send",
  "target": "discord-channel-123",
  "message": "**标题**\n描述内容\n\n`代码块`\n```python\nprint('hello')\n```"
}

添加表情反应

{
  "action": "reaction",
  "target": "discord-channel-123",
  "messageId": "987654321",
  "emoji": "👍"
}

飞书特定功能

发送富文本卡片

{
  "action": "send",
  "target": "feishu-chat-123",
  "message": "**标题**\n内容\n\n[链接](https://example.com)"
}

创建文档

// 使用feishu_doc工具
feishu_doc action=create title="会议纪要" content="..."

广播消息

一次发送到多个渠道:

{
  "action": "broadcast",
  "targets": [
    "discord-channel-1",
    "discord-channel-2",
    "telegram-chat-1"
  ],
  "message": "重要公告:系统将于今晚维护"
}

消息回复

{
  "action": "send",
  "target": "discord-channel-123",
  "message": "这是回复内容",
  "replyTo": "原始消息ID"
}

获取消息历史

{
  "action": "history",
  "target": "discord-channel-123",
  "limit": 50
}

频道配置

在OpenClaw配置文件中设置渠道:

channels:
  discord:
    - id: "123456789"
      name: "announcements"
      token: "${DISCORD_BOT_TOKEN}"
      
  feishu:
    - id: "oc_xxxxxx"
      name: "team-chat"
      app_id: "${FEISHU_APP_ID}"
      app_secret: "${FEISHU_APP_SECRET}"

最佳实践

故障排查

消息发送失败

相关链接

📢 想学习更多运营技巧?加入 Discord社区 一起交流!