> ## Documentation Index
> Fetch the complete documentation index at: https://openclaw.veiseule.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# directory

# `openclaw directory`

為支援此功能的頻道提供目錄查詢（聯絡人／peers、群組，以及「me」）。

## 常用旗標

* `--channel <name>`：頻道 ID／別名（當設定了多個頻道時為必填；僅設定一個時會自動選取）
* `--account <id>`：帳戶 ID（預設：頻道預設值）
* `--json`：輸出 JSON

## 注意事項

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

## 使用結果搭配 `message send`

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw directory peers list --channel slack --query "U0"
openclaw message send --channel slack --target user:U012ABCDEF --message "hello"
```

## ID formats（依頻道）

* WhatsApp：`+15551234567`（DM）、`1234567890-1234567890@g.us`（群組）
* Telegram：`@username` 或數字型聊天 ID；群組為數字 ID
* Slack：`user:U…` 與 `channel:C…`
* Discord：`user:<id>` 與 `channel:<id>`
* Matrix（plugin）：`user:@user:server`、`room:!roomId:server` 或 `#alias:server`
* Microsoft Teams（plugin）：`user:<id>` 與 `conversation:<id>`
* Zalo（plugin）：使用者 ID（Bot API）
* Zalo Personal／`zalouser`（plugin）：來自 `zca` 的執行緒 ID（DM／群組）（`me`、`friend list`、`group list`）

## Self（「me」）

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw directory self --channel zalouser
```

## Peers（聯絡人／使用者）

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw directory peers list --channel zalouser
openclaw directory peers list --channel zalouser --query "name"
openclaw directory peers list --channel zalouser --limit 50
```

## 群組

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
openclaw directory groups list --channel zalouser
openclaw directory groups list --channel zalouser --query "work"
openclaw directory groups members --channel zalouser --group-id <id>
```
