# openclaw-tools **Repository Path**: fa0/openclaw-tools ## Basic Information - **Project Name**: openclaw-tools - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-14 - **Last Updated**: 2026-03-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Custom Bot Channel for OpenClaw 将 OpenClaw AI Agent 连接到你自己的平台,整体由两部分组成: 1. **`custom-bot-plugin`** — OpenClaw Channel 插件,通过 WebSocket 连接到 Custom Bot Server,转发 Agent 消息 2. **`custom-bot-server`** — 服务端,提供 REST API + WebSocket 网关,供外部 Bot / 客户端对接 ## 快速安装 ```bash # 1. 启动 Custom Bot Server(本地开发) cd packages/shared && npm install && npm run build cd ../custom-bot-server && npm install && npm run build && npm start # 2. 在 OpenClaw 中安装插件并配置服务端地址 openclaw plugins install openclaw-custom-bot openclaw config set channels.openclaw-custom-bot.accounts.default.enabled true openclaw config set plugins.entries.openclaw-custom-bot.config.server_url ws://:3100 # 3. 重启 OpenClaw Gateway openclaw gateway restart ``` 更多细节请查看下方“子项目文档”中的各自 README。 ## 常用 API(概览) 完整参数与更多接口见 `docs/BOT_SERVER_API.md`,这里只列出最常用的几个: - **发送消息** ```bash # 异步发送(Agent 回复走 Webhook) POST /api/v1/messages/send # 同步发送(阻塞等待 Agent 回复) POST /api/v1/messages/send-sync ``` - **消息历史** ```bash GET /api/v1/messages/:chatId?limit=50&before=timestamp ``` ## 架构 ``` 外部客户端/机器人 (Bot) │ 每个 Bot 绑定一个 clientId │ REST API (HTTP) ▼ ┌──────────────────────┐ │ Custom Bot Server │ │ ├─ REST API │ │ ├─ Message Router │ ← 按 clientId 路由消息 │ ├─ WebSocket Server │ │ └─ SQLite Store │ └──────────┬───────────┘ │ WebSocket (wss://relay.echoclaw.me/ws/gateway) │ 使用 clientId 作为认证令牌 ▼ ┌──────────────────────────────────┐ │ OpenClaw Instance A (clientId=abc) │ │ OpenClaw Instance B (clientId=def) │ └──────────────────────────────────┘ ```