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:聊?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.164group:<id>signal:+E.164signal:group:<id> ?username:<name>/u:<name>
  • iMessage:handle、chat_id:<id>chat_guid:<guid> ?chat_identifier:<id>
  • MS Teams:会?ID(19:[email protected])或 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/Telegram/Discord/Matrix/MS Teams
    • 必需:--target--poll-question--poll-option(重复)
    • 可选:--poll-multi
    • ?Discord:--poll-duration-hours--silent--message
    • ?Telegram:--poll-duration-seconds?-600)、--silent--poll-anonymous / --poll-public--thread-id
  • 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
    • 必需:--message-id--target
  • pins(列表)

    • 频道:Discord/Slack
    • 必需:--target
  • permissions

    • 频道:Discord
    • 必需:--target
  • search

    • 频道:Discord
    • 必需:--guild-id--query
    • 可选:--channel-id--channel-ids(重复)、--author-id--author-ids(重复)、--limit

主题

  • thread create

    • 频道:Discord
    • 必需:--thread-name--target(频?ID?
    • 可选:--message-id--message--auto-archive-min
  • thread list

    • 频道:Discord
    • 必需:--guild-id
    • 可选:--channel-id--include-archived--before--limit
  • thread reply

    • 频道:Discord
    • 必需:--target(主?ID)、--message
    • 可选:--media--reply-to

表情符号

  • emoji list

    • Discord:--guild-id
    • Slack:无额外标志
  • emoji upload

    • 频道:Discord
    • 必需:--guild-id--emoji-name--media
    • 可选:--role-ids(重复)

贴纸

  • sticker send

    • 频道:Discord
    • 必需:--target--sticker-id(重复)
    • 可选:--message
  • sticker upload

    • 频道:Discord
    • 必需:--guild-id--sticker-name--sticker-desc--sticker-tags--media

角色 / 频道 / 成员 / 语音

  • role info(Discord):--guild-id
  • role add / role remove(Discord):--guild-id--user-id--role-id
  • channel info(Discord):--target
  • channel list(Discord):--guild-id
  • member info(Discord/Slack):--user-id? Discord ?--guild-id?
  • voice status(Discord):--guild-id--user-id

活动

  • event list(Discord):--guild-id
  • event create(Discord):--guild-id--event-name--start-time
    • 可选:--end-time--desc--channel-id--location--event-type

审核(Discord?

  • timeout--guild-id--user-id(可?--duration-min ?--until;两者都省略以清除超时)
  • kick--guild-id--user-id? --reason?
  • ban--guild-id--user-id? --delete-days--reason?
    • timeout 也支?--reason

广播

  • broadcast
    • 频道:任何已配置的频道;使用 --channel all 针对所有提供商
    • 必需:--targets(重复)
    • 可选:--message--media--dry-run

示例

发?Discord 回复?

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

发送带组件?Discord 消息?

openclaw message send --channel discord \
  --target channel:123 --message "Choose:" \
  --components '{"text":"Choose a path","blocks":[{"type":"actions","buttons":[{"label":"Approve","style":"success"},{"label":"Decline","style":"danger"}]}]}'

有关完整模式,请参见 Discord 组件?

创建 Discord 投票?

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

创建 Telegram 投票? 分钟自动关闭):

openclaw message poll --channel telegram \
  --target @mychat \
  --poll-question "Lunch?" \
  --poll-option Pizza --poll-option Sushi \
  --poll-duration-seconds 120 --silent

发?Teams 主动消息?

openclaw message send --channel msteams \
  --target conversation:19:[email protected] --message "hi"

创建 Teams 投票?

openclaw message poll --channel msteams \
  --target conversation:19:[email protected] \
  --poll-question "Lunch?" \
  --poll-option Pizza --poll-option Sushi

?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"}] ]'