一句话定义
- 这一组命令负责接入聊天平台、查看频道状态、发消息,以及执行线程、投票、反应、成员与频道动作。
解决的问题
- Telegram / Discord / WhatsApp 等频道怎么接入
- 某个频道当前是否在线、是否健康
- 如何主动给某个目标发消息
- 如何执行 poll / react / thread / edit / delete 等动作
- 如何查账号、对象、ID 或配对请求
核心机制
channels负责"账号与连接"。message负责"具体消息与频道动作"。directory负责"查对象与 ID"。pairing / devices负责"配对和设备 token 管理"。
关键组成
1. 频道配置与状态
openclaw channels list
openclaw channels status
openclaw channels add
openclaw channels login
openclaw channels logout
openclaw channels logs
openclaw channels capabilities
openclaw channels resolve
用途拆解:
list:看已配置频道和账号status:看频道健康状态add:新增或更新频道账号login / logout:登录与登出支持的频道logs:看频道相关日志capabilities:看平台支持能力与 scopesresolve:把名字解析成 ID
2. 消息发送与操作(v2026.5.26 完整清单)
openclaw message send --target +15555550123 --message "Hi"
openclaw message send --target +15555550123 --message "Hi" --media photo.jpg
openclaw message read
openclaw message edit
openclaw message delete
3. 消息互动与频道管理
openclaw message poll --channel discord --target channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi
openclaw message react --channel discord --target 123 --message-id 456 --emoji ""
openclaw message reactions
openclaw message pin
openclaw message unpin
openclaw message pins
openclaw message thread
openclaw message emoji
openclaw message sticker
openclaw message search
openclaw message broadcast --targets ... --message ...
4. 成员管理与频道动作
openclaw message member
openclaw message role
openclaw message permissions
openclaw message ban
openclaw message kick
openclaw message timeout
openclaw message channel
openclaw message voice
openclaw message event
说明:
message不是"只是发消息",而是统一消息操作面。- 在 Discord 这类平台中,
message命令的可用子树会更丰富。 - v2026.5.26 新增子命令:ban、broadcast、channel、event、kick、member、permissions、pin、pins、search、sticker、timeout、unpin、voice
- v2026.5.26 保留子命令:delete、edit、emoji、poll、react、reactions、read、role、send、thread
4. 对象查找与配对辅助
openclaw directory
openclaw pairing list
openclaw pairing approve <channel> <code>
openclaw devices list
openclaw devices approve --latest
openclaw devices rotate --device <id> --role <role>
生命周期 / 执行流程
新接一个频道
openclaw channels listopenclaw channels add- 必要时
openclaw channels login openclaw channels status- 发送一条测试消息验证
主动发消息
- 如果目标不确定,先
openclaw directory或channels resolve - 用
openclaw message send ... - 若要后续互动,再用
react / poll / thread / edit / delete
排查某个频道异常
openclaw channels statusopenclaw channels logs- 回到
openclaw status --deep - 必要时查看 gateway 日志
高频命令组合
接入与检查
openclaw channels list
openclaw channels status
openclaw channels capabilities
找目标并发消息
openclaw channels resolve
openclaw message send --channel telegram --target @mychat --message "Hi"
Discord 类操作
openclaw message poll --channel discord --target channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi
openclaw message react --channel discord --target 123 --message-id 456 --emoji ""
边界与限制
- 不同频道支持的能力不同,所以
capabilities很重要。 message的一些子命令只在特定平台生效。login并不是所有频道都需要,或都支持同一种登录方式。- 对象标识不清晰时,要先做
resolve或directory,不要盲发。
常见误区
- 误区 1:把
channels和message混用。前者偏连接管理,后者偏消息动作。 - 误区 2:以为
message send就够了。很多平台还支持 poll、reaction、thread、channel action。 - 误区 3:目标 ID 不清楚时直接试错。更稳妥的做法是先 resolve。
对比项
channels status:频道层状态status --deep:更全面探测message send:主动消息投递directory / resolve:对象查找与映射
评论