openclaw message
Lệnh gửi tin nhắn và thao tác channel tổng hợp cho nhiều nền tảng (Discord/Google Chat/Slack/Mattermost (plugin)/Telegram/WhatsApp/Signal/iMessage/MS Teams).
Cách dùng
openclaw message <subcommand> [flags]
Chọn channel:
--channelbắt buộc nếu có nhiều hơn một channel được cấu hình.- Nếu chỉ có đúng một channel được cấu hình, nó sẽ trở thành mặc định.
- Giá trị:
whatsapp|telegram|discord|googlechat|slack|mattermost|signal|imessage|msteams(Mattermost cần plugin)
Định dạng target (--target):
- WhatsApp: E.164 hoặc group JID
- Telegram: chat id hoặc
@username - Discord:
channel:<id>hoặcuser:<id>(hoặc<@id>mention; id số thuần được coi là channel) - Google Chat:
spaces/<spaceId>hoặcusers/<userId> - Slack:
channel:<id>hoặcuser:<id>(chấp nhận channel id thuần) - Mattermost (plugin):
channel:<id>,user:<id>, hoặc@username(id thuần được coi là channel) - Signal:
+E.164,group:<id>,signal:+E.164,signal:group:<id>, hoặcusername:<name>/u:<name> - iMessage: handle,
chat_id:<id>,chat_guid:<guid>, hoặcchat_identifier:<id> - MS Teams: conversation id (
19:[email protected]) hoặcconversation:<id>hoặcuser:<aad-object-id>
Tra cứu tên:
- Với các provider hỗ trợ (Discord/Slack/v.v.), tên channel như
Helphoặc#helpsẽ được phân giải qua directory cache. - Nếu không tìm thấy trong cache, OpenClaw sẽ thử tra cứu trực tiếp khi provider hỗ trợ.
Flags thông dụng
--channel <name>--account <id>--target <dest>(channel hoặc user đích cho send/poll/read/v.v.)--targets <name>(lặp lại; chỉ dùng cho broadcast)--json--dry-run--verbose
Các thao tác
Cơ bản
-
send- Channels: WhatsApp/Telegram/Discord/Google Chat/Slack/Mattermost (plugin)/Signal/iMessage/MS Teams
- Bắt buộc:
--target, cộng với--messagehoặc--media - Tùy chọn:
--media,--reply-to,--thread-id,--gif-playback - Chỉ Telegram:
--buttons(cầnchannels.telegram.capabilities.inlineButtonsđể cho phép) - Chỉ Telegram:
--thread-id(forum topic id) - Chỉ Slack:
--thread-id(thread timestamp;--reply-todùng cùng trường) - Chỉ WhatsApp:
--gif-playback
-
poll- Channels: WhatsApp/Discord/MS Teams
- Bắt buộc:
--target,--poll-question,--poll-option(lặp lại) - Tùy chọn:
--poll-multi - Chỉ Discord:
--poll-duration-hours,--message
-
react- Channels: Discord/Google Chat/Slack/Telegram/WhatsApp/Signal
- Bắt buộc:
--message-id,--target - Tùy chọn:
--emoji,--remove,--participant,--from-me,--target-author,--target-author-uuid - Lưu ý:
--removecần--emoji(bỏ qua--emojiđể xóa reaction của mình nếu được hỗ trợ; xem /tools/reactions) - Chỉ WhatsApp:
--participant,--from-me - Reaction nhóm Signal: cần
--target-authorhoặc--target-author-uuid
-
reactions- Channels: Discord/Google Chat/Slack
- Bắt buộc:
--message-id,--target - Tùy chọn:
--limit
-
read- Channels: Discord/Slack
- Bắt buộc:
--target - Tùy chọn:
--limit,--before,--after - Chỉ Discord:
--around
-
edit- Channels: Discord/Slack
- Bắt buộc:
--message-id,--message,--target
-
delete- Channels: Discord/Slack/Telegram
- Bắt buộc:
--message-id,--target
-
pin/unpin- Channels: Discord/Slack
- Bắt buộc:
--message-id,--target
-
pins(danh sách)- Channels: Discord/Slack
- Bắt buộc:
--target
-
permissions- Channels: Discord
- Bắt buộc:
--target
-
search- Channels: Discord
- Bắt buộc:
--guild-id,--query - Tùy chọn:
--channel-id,--channel-ids(lặp lại),--author-id,--author-ids(lặp lại),--limit
Threads
-
thread create- Channels: Discord
- Bắt buộc:
--thread-name,--target(channel id) - Tùy chọn:
--message-id,--auto-archive-min
-
thread list- Channels: Discord
- Bắt buộc:
--guild-id - Tùy chọn:
--channel-id,--include-archived,--before,--limit
-
thread reply- Channels: Discord
- Bắt buộc:
--target(thread id),--message - Tùy chọn:
--media,--reply-to
Emojis
-
emoji list- Discord:
--guild-id - Slack: không cần flag thêm
- Discord:
-
emoji upload- Channels: Discord
- Bắt buộc:
--guild-id,--emoji-name,--media - Tùy chọn:
--role-ids(lặp lại)
Stickers
-
sticker send- Channels: Discord
- Bắt buộc:
--target,--sticker-id(lặp lại) - Tùy chọn:
--message
-
sticker upload- Channels: Discord
- Bắt buộc:
--guild-id,--sticker-name,--sticker-desc,--sticker-tags,--media
Roles / Channels / Members / Voice
role info(Discord):--guild-idrole add/role remove(Discord):--guild-id,--user-id,--role-idchannel info(Discord):--targetchannel list(Discord):--guild-idmember info(Discord/Slack):--user-id(+--guild-idcho Discord)voice status(Discord):--guild-id,--user-id
Events
event list(Discord):--guild-idevent create(Discord):--guild-id,--event-name,--start-time- Tùy chọn:
--end-time,--desc,--channel-id,--location,--event-type
- Tùy chọn:
Moderation (Discord)
timeout:--guild-id,--user-id(tùy chọn--duration-minhoặc--until; bỏ qua cả hai để xóa timeout)kick:--guild-id,--user-id(+--reason)ban:--guild-id,--user-id(+--delete-days,--reason)timeoutcũng hỗ trợ--reason
Broadcast
broadcast- Channels: bất kỳ channel nào đã cấu hình; dùng
--channel allđể nhắm tất cả provider - Bắt buộc:
--targets(lặp lại) - Tùy chọn:
--message,--media,--dry-run
- Channels: bất kỳ channel nào đã cấu hình; dùng
Ví dụ
Gửi reply trên Discord:
openclaw message send --channel discord \
--target channel:123 --message "hi" --reply-to 456
Tạo poll trên Discord:
openclaw message poll --channel discord \
--target channel:123 \
--poll-question "Snack?" \
--poll-option Pizza --poll-option Sushi \
--poll-multi --poll-duration-hours 48
Gửi tin nhắn chủ động trên Teams:
openclaw message send --channel msteams \
--target conversation:19:[email protected] --message "hi"
Tạo poll trên Teams:
openclaw message poll --channel msteams \
--target conversation:19:[email protected] \
--poll-question "Lunch?" \
--poll-option Pizza --poll-option Sushi
React trên Slack:
openclaw message react --channel slack \
--target C123 --message-id 456 --emoji "✅"
React trong nhóm Signal:
openclaw message react --channel signal \
--target signal:group:abc123 --message-id 1737630212345 \
--emoji "✅" --target-author-uuid 123e4567-e89b-12d3-a456-426614174000
Gửi inline buttons trên Telegram:
openclaw message send --channel telegram --target @mychat --message "Choose:" \
--buttons '[ [{"text":"Yes","callback_data":"cmd:yes"}], [{"text":"No","callback_data":"cmd:no"}] ]'