{"skill":{"slug":"qqbot-multi-bind","displayName":"QQBot Multi-Bind","summary":"快速配置 OpenClaw 多 QQBot 账号绑定到不同 Agent。用于首次安装 QQBot、新增 QQBot 账号、创建 agent 绑定关系、重启 gateway 使配置生效。当用户需要安装 QQBot 插件、添加新的 QQBot 机器人或配置多账号路由时使用此技能。","description":"---\nname: qqbot-multi-bind\ndescription: 快速配置 OpenClaw 多 QQBot 账号绑定到不同 Agent。用于首次安装 QQBot、新增 QQBot 账号、创建 agent 绑定关系、重启 gateway 使配置生效。当用户需要安装 QQBot 插件、添加新的 QQBot 机器人或配置多账号路由时使用此技能。\n---\n\n# QQBot 多账号绑定配置\n\n## 配置格式说明\n\n`channels.qqbot.accounts` 使用**对象格式**，每个 accountId 作为 key：\n\n```json\n\"accounts\": {\n  \"<account-id>\": {\n    \"enabled\": true,\n    \"appId\": \"<app-id>\",\n    \"clientSecret\": \"<secret>\"\n  }\n}\n```\n\n- 顶层 `appId`/`clientSecret` 是默认账户（accountId = \"default\"）\n- `accounts` 下的每个 key 就是该账户的 accountId\n- 每个账户可独立配置 `enabled`、`name`、`allowFrom`、`systemPrompt` 等\n\n---\n\n## 首次安装 QQBot（从零开始）\n\n### Step 1 — 在 QQ 开放平台创建机器人\n\n1. 访问 [QQ 开放平台](https://bot.q.qq.com/)，用手机 QQ 扫码登录\n2. 点击「创建机器人」\n3. 记录 **AppID** 和 **AppSecret**（AppSecret 只显示一次，务必保存好）\n\n⚠️ 注意：创建后机器人会出现在 QQ 消息列表，但会回复\"机器人去火星了\"，需完成配置才能正常使用。\n\n### Step 2 — 安装插件\n\n**方式 A：npm 安装（推荐）**\n```bash\nopenclaw plugins install @tencent-connect/openclaw-qqbot\n```\n\n**方式 B：源码一键安装**\n```bash\ngit clone https://github.com/tencent-connect/openclaw-qqbot.git && cd openclaw-qqbot\nbash ./scripts/upgrade-via-source.sh --appid YOUR_APPID --secret YOUR_SECRET\n```\n\n**方式 C：手动安装**\n```bash\ngit clone https://github.com/tencent-connect/openclaw-qqbot.git && cd openclaw-qqbot\nnpm install --omit=dev\nopenclaw plugins install .\n```\n\n### Step 3 — 配置 OpenClaw\n\n**CLI 方式（推荐）**\n```bash\nopenclaw channels add --channel qqbot --token \"AppID:AppSecret\"\n```\n\n**手动编辑配置文件**\n\n编辑 `~/.openclaw/openclaw.json`：\n```json\n{\n  \"channels\": {\n    \"qqbot\": {\n      \"enabled\": true,\n      \"appId\": \"Your AppID\",\n      \"clientSecret\": \"Your AppSecret\"\n    }\n  }\n}\n```\n\n### Step 4 — 启动测试\n```bash\nopenclaw gateway\n```\n\n---\n\n## 多账号配置（新增第二个机器人）\n\n### 前置条件\n\n- 已有 OpenClaw 安装并运行\n- 已有 qqbot 插件安装\n- 已有至少一个 agent（如 `main`）\n- 新的 QQBot AppID 和 ClientSecret\n\n### 方式一：CLI 命令添加（推荐）\n\n```bash\nopenclaw channels add --channel qqbot --account <account-id> --token \"AppID:AppSecret\"\n```\n\n示例：\n```bash\nopenclaw channels add --channel qqbot --account bot2 --token \"222222222:secret-of-bot-2\"\n```\n\n然后添加 agent 绑定：\n```bash\nopenclaw agents add <agent-name>  # 如需要新 agent\n```\n\n编辑 `~/.openclaw/openclaw.json`，在 `bindings` 中添加：\n```json\n{\n  \"agentId\": \"<agent-id>\",\n  \"match\": {\n    \"channel\": \"qqbot\",\n    \"accountId\": \"<account-id>\"\n  }\n}\n```\n\n### 方式二：手动编辑配置\n\n#### 1. 创建新 Agent（如需要）\n```bash\nopenclaw agents add <agent-name>\n```\n\n#### 2. 编辑 `~/.openclaw/openclaw.json`\n\n**添加账号到 accounts**：\n```json\n\"channels\": {\n  \"qqbot\": {\n    \"enabled\": true,\n    \"allowFrom\": [\"*\"],\n    \"accounts\": {\n      \"main\": {\n        \"enabled\": true,\n        \"appId\": \"1903000001\",\n        \"clientSecret\": \"your-secret-here\"\n      },\n      \"<new-account-id>\": {\n        \"enabled\": true,\n        \"appId\": \"<new-app-id>\",\n        \"clientSecret\": \"<new-secret>\"\n      }\n    }\n  }\n}\n```\n\n**添加路由到 bindings**：\n```json\n\"bindings\": [\n  {\n    \"agentId\": \"main\",\n    \"match\": { \"channel\": \"qqbot\", \"accountId\": \"main\" }\n  },\n  {\n    \"agentId\": \"<agent-id>\",\n    \"match\": { \"channel\": \"qqbot\", \"accountId\": \"<new-account-id>\" }\n  }\n]\n```\n\n#### 3. 重启并验证\n```bash\nopenclaw gateway restart\nopenclaw agents list --bindings\n```\n\n---\n\n## 完整示例配置\n\n```json\n{\n  \"agents\": {\n    \"list\": [\n      { \"id\": \"main\", \"model\": \"bailian/kimi-k2.5\" },\n      { \"id\": \"coding\", \"model\": \"bailian/kimi-k2.5\" },\n      { \"id\": \"notify\", \"model\": \"bailian/kimi-k2.5\" }\n    ]\n  },\n  \"channels\": {\n    \"qqbot\": {\n      \"enabled\": true,\n      \"allowFrom\": [\"*\"],\n      \"accounts\": {\n        \"main\": { \"enabled\": true, \"appId\": \"1903000001\", \"clientSecret\": \"secret-1\" },\n        \"coding\": { \"enabled\": true, \"appId\": \"1903000002\", \"clientSecret\": \"secret-2\" },\n        \"notify\": { \"enabled\": true, \"appId\": \"1903000003\", \"clientSecret\": \"secret-3\" }\n      }\n    }\n  },\n  \"bindings\": [\n    { \"agentId\": \"main\", \"match\": { \"channel\": \"qqbot\", \"accountId\": \"main\" } },\n    { \"agentId\": \"coding\", \"match\": { \"channel\": \"qqbot\", \"accountId\": \"coding\" } },\n    { \"agentId\": \"notify\", \"match\": { \"channel\": \"qqbot\", \"accountId\": \"notify\" } }\n  ]\n}\n```\n\n---\n\n## 常见问题\n\n**Q: 一个 agent 可以绑定多个 QQBot 吗？**\nA: 可以！添加多个 bindings 指向同一个 agentId。\n\n**Q: 一个 QQBot 可以发给多个 agent 吗？**\nA: 不可以，一个消息只能路由到一个 agent。\n\n**Q: 如何删除某个 QQBot？**\nA: 从 `accounts` 和 `bindings` 中删除对应条目，重启 gateway。\n\n**Q: 如何与另一个 agent 对话？**\nA: `openclaw agent --agent <agent-name> --message \"你的消息\"`\n\n**Q: 如何启用跨 agent 会话访问？**\nA: 在 `openclaw.json` 中添加：\n```json\n{\n  \"tools\": {\n    \"sessions\": {\n      \"visibility\": \"all\"\n    }\n  }\n}\n```\n然后重启 gateway。\n","tags":{"latest":"1.0.1"},"stats":{"comments":0,"downloads":851,"installsAllTime":32,"installsCurrent":4,"stars":1,"versions":2},"createdAt":1773229656603,"updatedAt":1778491828096},"latestVersion":{"version":"1.0.1","createdAt":1773501308559,"changelog":"Version 1.0.1\n\n- 配置文档全面切换至 `accounts` 对象格式，每个 QQBot 账号由 accountId 显式标识，不再使用数组。\n- 新增 CLI 添加多账号与 agent 绑定的命令示例，优化首次与多账号配置流程说明。\n- 完善手动和命令行配置流程，更新配置文件示例，提升多账号绑定灵活性与可读性。\n- 增补了跨 agent 会话访问的常见问题解答与配置示例。","license":"MIT-0"},"metadata":null,"owner":{"handle":"kasonlee-marker","userId":"s17d4wvttk7ptrz5jra798fvdh83xr80","displayName":"KasonLee-marker","image":"https://avatars.githubusercontent.com/u/29779363?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1780089887144}}