跳到主要内容

clawdbot directory

支持此功能的频道的目录查询(联系人/同行、群组和“我”)。

常用标志位

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

注意事项

  • directory 旨在帮助您查找可以粘贴到其他命令中的 ID(特别是 clawdbot message send --target ...)。
  • 对于许多频道,结果是基于配置的(允许列表 / 已配置的群组),而不是实时的提供商目录。
  • 默认输出为以制表符分隔的 id(有时包含 name);脚本编写请使用 --json

将结果用于 message send

clawdbot directory peers list --channel slack --query "U0"
clawdbot 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:server, room:!roomId:server, 或 #alias:server
  • Microsoft Teams (插件):user:<id>conversation:<id>
  • Zalo (插件):用户 ID (Bot API)
  • Zalo 个人 / zalouser (插件):来自 zca 的线程 ID (私聊/群组)(me (我), friend list (好友列表), group list (群组列表))

自身 (“me”)

clawdbot directory self --channel zalouser

同行 / 联系人 (Peers)

clawdbot directory peers list --channel zalouser
clawdbot directory peers list --channel zalouser --query "name"
clawdbot directory peers list --channel zalouser --limit 50

群组 (Groups)

clawdbot directory groups list --channel zalouser
clawdbot directory groups list --channel zalouser --query "work"
clawdbot directory groups members --channel zalouser --group-id <id>