跳转到主要内容

openclaw directory

针对支持该功能的渠道(联系人/对等方、群组和“我”)进行的目录查找。

通用标志

  • --channel <name>:频道 ID/别名(配置了多个频道时必需;仅配置一个时为自动)
  • --account <id>:账号 ID(默认:频道默认值)
  • --json:输出 JSON

注意事项

  • directory 旨在帮助您找到可以粘贴到其他命令(尤其是 openclaw message send --target ...)中的 ID。
  • 对于许多渠道,结果是基于配置的(允许列表/已配置群组),而不是实时的提供商目录。
  • 默认输出为用制表符分隔的 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(私信),1234567890-1234567890@g.us(群组)
  • Telegram:@username 或数字聊天 ID;群组为数字 ID
  • Slack:user:U…channel:C…
  • Discord:user:<id>channel:<id>
  • Matrix(插件):user:@user:serverroom:!roomId:server#alias:server
  • Microsoft Teams(插件):user:<id>conversation:<id>
  • Zalo (插件):user id (Bot API)
  • Zalo 个人版 / zalouser(插件):来自 zcamefriend listgroup list)的会话 ID(私信/群组)

自己(“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>

本页面源自 openclaw/openclaw,由 BeaversLab 翻译,遵循 MIT 协议 发布。
Last modified on March 27, 2026