跳轉到主要內容

openclaw directory

為支援此功能的頻道提供目錄查詢(聯絡人/peers、群組,以及「me」)。

常用旗標

  • --channel <name>:頻道 ID/別名(當設定了多個頻道時為必填;僅設定一個時會自動選取)
  • --account <id>:帳戶 ID(預設:頻道預設值)
  • --json:輸出 JSON

注意事項

  • directory 旨在協助你找到可貼到其他指令中的 ID(特別是 openclaw message send --target ...)。
  • 對於許多通道,結果是基於設定(允許清單 / 已設定的群組),而非即時的供應商目錄。
  • 預設輸出為以定位字元分隔的 id(有時還包含 name);進行腳本處理時請使用 --json

使用結果搭配 message send

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

ID formats(依頻道)

  • WhatsApp:+15551234567(DM)、[email protected](群組)
  • Telegram:@username 或數字型聊天 ID;群組為數字 ID
  • Slack:user:U…channel:C…
  • Discord:user:<id>channel:<id>
  • Matrix(plugin):user:@user:serverroom:!roomId:server#alias:server
  • Microsoft Teams(plugin):user:<id>conversation:<id>
  • Zalo(plugin):使用者 ID(Bot API)
  • Zalo Personal/zalouser(plugin):來自 zca 的執行緒 ID(DM/群組)(mefriend listgroup list

Self(「me」)

openclaw directory self --channel zalouser

Peers(聯絡人/使用者)

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>