openclaw directory
对支持目录查询的频道进行联系人/同伴、群组和”我”的查找。
通用参数
--channel <name>:频道 ID/别名(配置了多个频道时必填;只配了一个时自动选择)--account <id>:账号 ID(默认:频道默认账号)--json:输出 JSON
注意事项
directory的目的是帮你找到可以粘贴到其他命令中的 ID(特别是openclaw message send --target ...)。- 对很多频道来说,结果来自配置(白名单/已配置的群组),而不是实时的提供商目录。
- 默认输出是用 tab 分隔的
id(有时还有name);脚本中建议用--json。
配合 message send 使用
openclaw directory peers list --channel slack --query "U0"
openclaw message send --channel slack --target user:U012ABCDEF --message "hello"
ID 格式(按频道)
- WhatsApp:
+15551234567(私聊)、[email protected](群组) - Telegram:
@username或数字 chat id;群组用数字 id - Slack:
user:U…和channel:C… - Discord:
user:<id>和channel:<id> - Matrix(插件):
user:@user:server、room:!roomId:server或#alias:server - Microsoft Teams(插件):
user:<id>和conversation:<id> - Zalo(插件):用户 ID(Bot API)
- Zalo Personal /
zalouser(插件):线程 ID(私聊/群组),来自zca(me、friend list、group list)
自己(“me”)
openclaw directory self --channel zalouser
同伴(联系人/用户)
openclaw directory peers list --channel zalouser
openclaw directory peers list --channel zalouser --query "name"
openclaw directory peers list --channel zalouser --limit 50
群组
openclaw directory groups list --channel zalouser
openclaw directory groups list --channel zalouser --query "work"
openclaw directory groups members --channel zalouser --group-id <id>