openclaw directory
在支持的 Channel 上查询目录信息(联系人/对等方、群组和”我”)。
通用参数
--channel <name>:Channel ID 或别名(配置了多个 Channel 时必填;只有一个时自动选择)--account <id>:账户 ID(默认:Channel 默认账户)--json:输出 JSON 格式
说明
directory命令用于帮你找到可以粘贴到其他命令中的 ID(特别是openclaw message send --target ...)。- 对于很多 Channel,结果来自配置文件(白名单/已配置的群组),而不是实时的服务商目录。
- 默认输出是
id(有时还有name),用制表符分隔;用--json参数可以方便脚本处理。
配合 message send 使用
openclaw directory peers list --channel slack --query "U0"
openclaw message send --channel slack --target user:U012ABCDEF --message "hello"
ID 格式(按 Channel 分类)
- WhatsApp:
+15551234567(DM),[email protected](群组) - Telegram:
@username或数字聊天 ID;群组是数字 ID - Slack:
user:U…和channel:C… - Discord:
user:<id>和channel:<id> - Matrix(Plugin):
user:@user:server、room:!roomId:server或#alias:server - Microsoft Teams(Plugin):
user:<id>和conversation:<id> - Zalo(Plugin):用户 ID(Bot API)
- Zalo Personal /
zalouser(Plugin):来自zca的线程 ID(DM/群组)(me、friend list、group list)
Self(“我”)
openclaw directory self --channel zalouser
Peers(联系人/用户)
openclaw directory peers list --channel zalouser
openclaw directory peers list --channel zalouser --query "name"
openclaw directory peers list --channel zalouser --limit 50
Groups(群组)
openclaw directory groups list --channel zalouser
openclaw directory groups list --channel zalouser --query "work"
openclaw directory groups members --channel zalouser --group-id <id>