`moltbot directory`

`moltbot directory`

适用范围

使用本页面当:

  • 需要查找渠道的联系人/群组/自己的 ID
  • 正在开发渠道目录适配器

支持目录的渠道的目录查找(联系人/对等体、群组和"自己")。

常用标志

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

说明

  • directory 旨在帮助您找到可以粘贴到其他命令的 ID(尤其是 moltbot message send --target ...)。
  • 对于许多渠道,结果是配置支持的(允许列表/配置的群组)而不是实时的提供商目录。
  • 默认输出是 id(有时还有 name),用制表符分隔;使用 --json 进行脚本编写。

将结果与 message send 一起使用

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

ID 格式(按渠道)

  • WhatsApp:+15551234567(DM)、[email protected](群组)
  • 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(插件):用户 ID(Bot API)
  • Zalo Personal / zalouser(插件):来自 zca 的线程 ID(DM/群组)(mefriend listgroup list

自己(“me”)

moltbot directory self --channel zalouser

对等体(联系人/用户)

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

群组

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