Files
bot/docs/zh-CN/cli/directory.md
zeekay 08582cc303 Rebrand OpenClaw → Hanzo Bot across entire codebase
Complete rename of all OpenClaw/OPENCLAW/openclaw references to
Hanzo Bot/BOT/bot naming convention:

- Env vars: OPENCLAW_* → BOT_* (18 patterns)
- Config: ~/.openclaw/ → ~/.bot/, openclaw.json → bot.json
- Packages: @openclaw/* → @hanzo/bot-*
- Domains: openclaw.ai → hanzo.bot
- Mobile: OpenClawKit → BotKit, bundle IDs ai.openclaw → ai.hanzo.bot
- mDNS: _openclaw-gw._tcp → _bot-gw._tcp
- Docker: CMD hanzo-bot.mjs, BOT_PREFER_PNPM, BOT_DOCKER_APT_PACKAGES
- CI: docker-release.yml adds :latest tag on main branch
2026-02-11 11:13:08 -08:00

2.4 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
你想查找某个渠道的联系人/群组/自身 ID
你正在开发渠道目录适配器
`hanzo-bot directory` 的 CLI 参考(self、peers、groups) directory
generated_at model provider source_hash source_path workflow
2026-02-01T19:58:58Z claude-opus-4-5 pi 7c878d9013aeaa22c8a21563fac30b465a86be85d8c917c5d4591b5c3d4b2025 cli/directory.md 14

hanzo-bot directory

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

通用参数

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

说明

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

将结果用于 message send

hanzo-bot directory peers list --channel slack --query "U0"
hanzo-bot message send --channel slack --target user:U012ABCDEF --message "hello"

ID 格式(按渠道)

  • WhatsApp:+15551234567(私聊),[email protected](群组)
  • 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 Personal / zalouser(插件):来自 zca 的会话 ID(私聊/群组)(me、friend list、group list)

Self("我")

hanzo-bot directory self --channel zalouser

Peers(联系人/用户)

hanzo-bot directory peers list --channel zalouser
hanzo-bot directory peers list --channel zalouser --query "name"
hanzo-bot directory peers list --channel zalouser --limit 50

群组

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