Skip to Content
👋 欢迎来到 HowToUseOpenClaw 快速入门
CLI 参考Message 消息

openclaw message

发送消息与频道操作的统一出站命令(Discord/Google Chat/Slack/Mattermost(插件)/Telegram/WhatsApp/Signal/iMessage/MS Teams)。

用法

openclaw message <subcommand> [flags]

频道选择:

  • 配置了多个频道时需指定 --channel。
  • 仅配置一个频道时该频道为默认。
  • 取值:whatsapp|telegram|discord|googlechat|slack|mattermost|signal|imessage|msteams(Mattermost 需插件)

目标格式(--target):

  • WhatsApp: E.164 或群组 JID
  • Telegram: chat id 或 @username
  • Discord: channel:<id> 或 user:<id>(或 <@id> 提及;纯数字 id 视为频道)
  • Google Chat: spaces/<spaceId> 或 users/<userId>
  • Slack: channel:<id> 或 user:<id>(接受纯频道 id)
  • Mattermost(插件): channel:<id>、user:<id> 或 @username(裸 id 视为频道)
  • Signal: +E.164、group:<id>、signal:+E.164、signal:group:<id> 或 username:<name>/u:<name>
  • iMessage: handle、chat_id:<id>、chat_guid:<guid> 或 chat_identifier:<id>
  • MS Teams: 会话 id(19:...@thread.tacv2)或 conversation:<id> 或 user:<aad-object-id>

名称解析:

  • 对支持的提供商(Discord/Slack 等),Help 或 #help 等频道名通过目录缓存解析。
  • 缓存未命中时,若提供商支持,OpenClaw 会尝试实时目录查询。

通用参数

  • --channel <name>
  • --account <id>
  • --target <dest>(send/poll/read 等的目标频道或用户)
  • --targets <name>(可重复;仅广播)
  • --json
  • --dry-run
  • --verbose

操作

核心

  • send — 频道:WhatsApp/Telegram/Discord/Google Chat/Slack/Mattermost(插件)/Signal/iMessage/MS Teams。必选:--target,以及 --message 或 --media。可选:--media、--reply-to、--thread-id、--gif-playback。仅 Telegram:--buttons、--thread-id(论坛主题 id)。仅 Slack:--thread-id(线程时间戳)。仅 WhatsApp:--gif-playback。
  • poll — 频道:WhatsApp/Discord/MS Teams。必选:--target、--poll-question、--poll-option(可重复)。可选:--poll-multi。仅 Discord:--poll-duration-hours、--message。
  • react — 频道:Discord/Google Chat/Slack/Telegram/WhatsApp/Signal。必选:--message-id、--target。可选:--emoji、--remove、--participant、--from-me、--target-author、--target-author-uuid。
  • reactions、read、edit、delete、pin/unpin、pins、permissions、search — 见各频道支持。

线程、表情、贴纸、角色/频道/成员/语音、活动、审核(Discord)、广播

详见英文文档各子命令说明。

示例

发送 Discord 回复:

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

创建 Discord 投票:

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

发送 Teams 主动消息:

openclaw message send --channel msteams \ --target conversation:19:abc@thread.tacv2 --message "hi"

在 Slack 中表态:

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

在 Signal 群组中表态:

openclaw message react --channel signal \ --target signal:group:abc123 --message-id 1737630212345 \ --emoji "✅" --target-author-uuid 123e4567-e89b-12d3-a456-426614174000

发送 Telegram 内联按钮:

openclaw message send --channel telegram --target @mychat --message "Choose:" \ --buttons '[ [{"text":"Yes","callback_data":"cmd:yes"}], [{"text":"No","callback_data":"cmd:no"}] ]'
最后更新于: