feat(qq): add QR scan connection for QQ bots
Scan the official QQ Bot binding page from Channels → QQ or `nanobot channels login qq`; the returned AppID and encrypted secret are decrypted locally, saved to config, and the channel is enabled by the existing post-connect flow. The WebUI keeps manual entry of AppID and Secret in Advanced, restores every QQ setup field there, and warns that scanning again rotates the App Secret and invalidates the previous one. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
1 parent
9adbcc2cef
commit
6741acb391
20 files changed
+595
-8
No files matched your search
+9
-1
@@ -97,7 +97,7 @@ If `nanobot channels status` does not show the channel as enabled, the config sn
|
||||
| **Slack** | Bot token + App-Level token |
|
||||
| **Matrix** | Homeserver URL + Access token |
|
||||
| **Email** | IMAP/SMTP credentials |
|
||||
| **QQ** | App ID + App Secret |
|
||||
| **QQ** | QR code scan (`nanobot channels login qq`) or App ID + App Secret |
|
||||
| **Napcat (QQ)** | Napcat Forward WebSocket URL + access token |
|
||||
| **Wecom** | Bot ID + Bot Secret |
|
||||
| **Microsoft Teams** | App ID + App Password + public HTTPS endpoint |
|
||||
@@ -609,6 +609,14 @@ nanobot plugins enable qq
|
||||
|
||||
**3. Configure**
|
||||
|
||||
Run the QR login and scan with mobile QQ to save the AppID and AppSecret automatically. Scanning again replaces the App Secret and stops the previous secret from working:
|
||||
|
||||
```bash
|
||||
nanobot channels login qq
|
||||
```
|
||||
|
||||
To enter them yourself, copy **AppID** and **AppSecret** from **开发设置 (Developer Settings)** into `channels.qq`:
|
||||
|
||||
> - `allowFrom`: Add your openid (find it in nanobot logs when you message the bot). Use `["*"]` for public access.
|
||||
> - `msgFormat`: Optional. Use `"plain"` (default) for maximum compatibility with legacy QQ clients, or `"markdown"` for richer formatting on newer clients.
|
||||
> - For production: submit a review in the bot console and publish. See [QQ Bot Docs](https://bot.q.qq.com/wiki/) for the full publishing flow.
|
||||
|
||||
@@ -24,7 +24,7 @@ For terminal or server setup, use the manual configuration section below. Reuse
|
||||
|
||||
## Enable the QQ channel
|
||||
|
||||
Create a QQ bot application, copy its AppID and AppSecret, and add your account to the sandbox members. In **Channels → QQ**, enter those credentials, enable the channel, and save. Follow any installation or restart prompt.
|
||||
In **Channels → QQ**, scan the QR code with mobile QQ. nanobot saves the AppID and Secret automatically, enables the channel, and follows any installation or restart prompt. To use credentials you already copied, open **Advanced** and enter them manually. Scanning again replaces the current App Secret, and the previous secret stops working once the new scan completes.
|
||||
|
||||
<details>
|
||||
<summary>Manual configuration</summary>
|
||||
|
||||
Reference in new issue
Block a user