diff --git a/README.md b/README.md index efe6cb1..515584f 100644 --- a/README.md +++ b/README.md @@ -162,8 +162,18 @@ Scan to join the QQ group chat ### Step 2 — Install the Plugin +**Option A: One-Click Install & Run (Recommended)** + +```bash +git clone https://github.com/tencent-connect/openclaw-qq.git && cd openclaw-qq +bash ./scripts/upgrade-and-run.sh --appid YOUR_APPID --secret YOUR_SECRET +``` + +The script handles everything: cleanup old plugins → install deps → register plugin → configure channel → start service. Once done, skip to [Step 4](#step-4--start--test). + +**Option B: Manual Step-by-Step** + ```bash -# From source (npm package coming soon) git clone https://github.com/tencent-connect/openclaw-qq.git && cd openclaw-qq npm install --omit=dev openclaw plugins install . diff --git a/README.zh.md b/README.zh.md index 354447c..3f7976f 100644 --- a/README.zh.md +++ b/README.zh.md @@ -158,8 +158,18 @@ ### 第二步 — 安装插件 +**方式一:一键安装并启动(推荐)** + +```bash +git clone https://github.com/tencent-connect/openclaw-qq.git && cd openclaw-qq +bash ./scripts/upgrade-and-run.sh --appid YOUR_APPID --secret YOUR_SECRET +``` + +脚本会自动完成:清理旧插件 → 安装依赖 → 注册插件 → 配置通道 → 启动服务。完成后可直接跳到[第四步](#第四步--启动并测试)。 + +**方式二:手动分步安装** + ```bash -# 从源码安装(npm 包即将发布) git clone https://github.com/tencent-connect/openclaw-qq.git && cd openclaw-qq npm install --omit=dev openclaw plugins install . diff --git a/package.json b/package.json index 6491539..83e5587 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@tencent-connect/openclaw-qq", + "name": "@tencent-connect/qqbot", "version": "1.5.4", "type": "module", "main": "dist/index.js", @@ -20,16 +20,19 @@ "moltbot.plugin.json" ], "clawdbot": { + "id": "qqbot", "extensions": [ "./index.ts" ] }, "moltbot": { + "id": "qqbot", "extensions": [ "./index.ts" ] }, "openclaw": { + "id": "qqbot", "extensions": [ "./index.ts" ] diff --git a/src/channel.ts b/src/channel.ts index 13bd306..1cccad0 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -73,21 +73,9 @@ export const qqbotPlugin: ChannelPlugin = { onboarding: qqbotOnboardingAdapter, config: { - listAccountIds: (cfg) => { - const ids = listQQBotAccountIds(cfg); - console.log(`[qqbot:channel] listAccountIds: ${JSON.stringify(ids)}`); - return ids; - }, - resolveAccount: (cfg, accountId) => { - const account = resolveQQBotAccount(cfg, accountId); - console.log(`[qqbot:channel] resolveAccount: input=${accountId} → resolved=${account.accountId}, appId=${account.appId}, enabled=${account.enabled}`); - return account; - }, - defaultAccountId: (cfg) => { - const id = resolveDefaultQQBotAccountId(cfg); - console.log(`[qqbot:channel] defaultAccountId: ${id}`); - return id; - }, + listAccountIds: (cfg) => listQQBotAccountIds(cfg), + resolveAccount: (cfg, accountId) => resolveQQBotAccount(cfg, accountId), + defaultAccountId: (cfg) => resolveDefaultQQBotAccountId(cfg), // 新增:设置账户启用状态 setAccountEnabled: ({ cfg, accountId, enabled }) => setAccountEnabledInConfigSection({