Channel napcat by Claude

This commit is contained in:
LZDQ
2026-06-02 14:10:10 +08:00
committed by Xubin Ren
parent ac226d66f9
commit b1a3053ceb
2 changed files with 585 additions and 0 deletions
+45
View File
@@ -14,6 +14,7 @@ Connect nanobot to your favorite chat platform. Want to build your own? See the
| **Matrix** | Homeserver URL + Access token |
| **Email** | IMAP/SMTP credentials |
| **QQ** | 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 |
| **Mochat** | Claw token (auto-setup available) |
@@ -424,6 +425,50 @@ Now send a message to the bot from QQ — it should respond!
</details>
<details>
<summary><b>Napcat (QQ via OneBot v11 支持群聊等功能)</b></summary>
Connects to a [Napcat](https://github.com/NapNeko/NapCatQQ) instance over its **forward WebSocket** (OneBot v11). Use this when you have your own QQ account running through Napcat and want full private + group chat support.
**1. Set up Napcat**
- Install and log into Napcat, then enable a **Forward WebSocket** server. Recommends: [official napcat docker tutorial](https://github.com/NapNeko/NapCat-Docker)
- In the webui, follow "网络配置" -> "新建" -> "Websocket 服务器" to create a forward websocket server. By default, the URL is `ws://127.0.0.1:3001`
- Copy the forward websocket server's token
- (Optional) In the webui, follow "系统配置" -> "登陆配置" -> "快速登录QQ" to automatically login after restarts
**2. Configure**
```json
{
"channels": {
"napcat": {
"enabled": true,
"wsUrl": "ws://127.0.0.1:3001",
"accessToken": "YOUR_WEBSOCKET_TOKEN",
"allowFrom": ["*"],
"groupPolicy": "mention",
"groupPolicyOverrides": {
"123456789": "open",
"987654321": 0.2
},
"welcomeNewMembers": true
}
}
}
```
| Option | What it does |
|--------|--------------|
| `wsUrl` | Napcat forward-WebSocket endpoint. Bearer auth via `accessToken` is sent in the `Authorization` header. |
| `allowFrom` | QQ numbers permitted to talk to the bot. `["*"]` = anyone. Required `["*"]` (or include the joining user) for `welcomeNewMembers` to fire. |
| `groupPolicy` | `"mention"` (default) — reply only when @-mentioned or replying to the bot's own message. `"open"` — reply to every group message. A float `p` in `[0.0, 1.0]`@mentions and replies-to-bot always reply; every other group message replies with probability `p` (so `0.0``"mention"`, `1.0``"open"`). Private chats always reply. |
| `groupPolicyOverrides` | Optional per-group overrides for `groupPolicy`, keyed by group id (as a string). Each value takes the same shape as `groupPolicy` (`"mention"`, `"open"`, or a float). Groups not listed fall back to `groupPolicy`. |
| `welcomeNewMembers` | When true, `notice.group_increase` events are pushed to the bus as a synthetic message so the agent can greet new joiners. |
| `maxImageBytes` | Hard cap (in bytes) for inbound image downloads. Defaults to 20 MB. Larger images are dropped with a warning. |
</details>
<details>
<summary><b>DingTalk (钉钉)</b></summary>