openclaw message

统一的出站消息发送命令,支持多渠道:Discord / Google Chat / iMessage / Matrix / Mattermost / Microsoft Teams / Signal / Slack / Telegram / WhatsApp。

基本用法

openclaw message <subcommand> [flags]

渠道选择:

  • 配置了多个渠道时,--channel 必填
  • 只配置了一个渠道时自动推断

常用 flags

  • --channel <name> — 指定渠道
  • --account <id> — 指定账号(多账号渠道)
  • --target <dest> — 目标(频道/用户)
  • --json — 机器可读输出
  • --dry-run — 预览,不实际发送

目标格式(按渠道)

渠道格式示例
WhatsAppE.164 电话号、群组 JID、@newsletter
Telegram@username 或数字 chat id
Discordchannel:<id> 或 user:<id>
Slackchannel:<id> 或 user:<id>
Matrix@user:server、!room:server
Microsoft Teams19:...@thread.tacv2 或 user:<aad-id>

核心 Actions

send — 发送消息

openclaw message send --channel discord \
  --target channel:123 --message "hi" --reply-to 456

支持 --presentation 发送语义化块(buttons、text、divider 等),跨渠道自动适配渲染。

openclaw message send --channel discord --target channel:123 \
  --presentation '{"blocks":[{"type":"buttons","buttons":[{"label":"Approve","value":"approve","style":"success"}]}]}'

poll — 创建投票

支持渠道:WhatsApp / Telegram / Discord / Matrix / Microsoft Teams

openclaw message poll --channel discord \
  --target channel:123 \
  --poll-question "Snack?" \
  --poll-option Pizza --poll-option Sushi \
  --poll-multi --poll-duration-hours 48

react — 添加表情反应

openclaw message react --channel slack \
  --target C123 --message-id 456 --emoji "✅"

其他 Actions

  • read — 读取消息历史(Discord/Slack/Matrix)
  • edit — 编辑消息(Discord/Slack/Matrix)
  • delete — 删除消息(Discord/Slack/Telegram/Matrix)
  • pin / unpin — 置顶/取消置顶
  • broadcast — 广播到多个目标

Discord 专属

  • thread create / thread list / thread reply — 线程管理
  • emoji list / emoji upload — 表情管理
  • role info / role add / role remove — 角色管理
  • timeout / kick / ban — 成员管理

SecretRef 行为

openclaw message 在执行前自动解析渠道 SecretRef。目标渠道/账号的 SecretRef 未解析时,命令失败关闭(fail closed)。

相关链接