跳转到内容

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: 聊天 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: 句柄, 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> (发送/轮询/读取/等的目标频道或用户)
  • --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 (需要 channels.telegram.capabilities.inlineButtons 允许)
    • 仅 Telegram: --thread-id (论坛主题 ID)
    • 仅 Slack: --thread-id (线程时间戳; --reply-to 使用相同字段)
    • 仅 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
    • 注意: --remove 需要 --emoji (省略 --emoji 以在支持的地方清除自己的反应; 见 /tools/reactions)
    • 仅 WhatsApp: --participant, --from-me
    • Signal 群组反应: 需要 --target-author--target-author-uuid
  • reactions

    • 频道: Discord/Google Chat/Slack
    • 必需: --message-id, --target
    • 可选: --limit
  • read

    • 频道: Discord/Slack
    • 必需: --target
    • 可选: --limit, --before, --after
    • 仅 Discord: --around
  • edit

    • 频道: Discord/Slack
    • 必需: --message-id, --message, --target
  • delete

    • 频道: Discord/Slack/Telegram
    • 必需: --message-id, --target
  • pin / unpin

    • 频道: Discord/Slack