@nestim/koishi-plugin-qq-group-manager 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -2
  2. package/readme.md +124 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nestim/koishi-plugin-qq-group-manager",
3
3
  "description": "Koishi QQ群管理插件(OneBot/LLOneBot):群管命令、权限校验、图片菜单、状态卡片、复读、AI群聊回复、记忆库、识图与自动管控(禁言/踢人)。",
4
- "version": "1.1.3",
4
+ "version": "1.1.4",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
@@ -32,7 +32,8 @@
32
32
  "koishi": "^4.18.7"
33
33
  },
34
34
  "koishi": {
35
- "description": "QQ群管理插件(群管、自动管控、记忆、识图、AI回复)。"
35
+ "description": "QQ群管理插件(群管、自动管控、记忆、识图、AI回复)。",
36
+ "category": "manage"
36
37
  },
37
38
  "repository": {
38
39
  "type": "git",
package/readme.md CHANGED
@@ -139,6 +139,130 @@ npm i @nestim/koishi-plugin-qq-group-manager
139
139
 
140
140
  鉴权细节与指令执行结果只写日志,不回显到群聊。
141
141
 
142
+ ---
143
+
144
+ ## English
145
+
146
+ A QQ group-management plugin for [Koishi](https://koishi.chat) (OneBot / NapCat / LLOneBot).
147
+
148
+ Bracket-style commands plus layered per-group configuration. Covers moderation actions,
149
+ message filtering, automatic punishment, a memory store, blacklists, join-request review,
150
+ repeat (echo) and AI group-chat replies. **No database required** — all state is persisted
151
+ as Markdown files that you can read and edit directly in the Koishi console (Explorer).
152
+
153
+ - Commands use a uniform `[prefix] args` form; targets accept a QQ number or `@mention`
154
+ - Command names are English; menu lines are labelled in Chinese (e.g. `禁言 [mute] ...`)
155
+ - Menus are plain text — **no puppeteer / image rendering**
156
+ - Troubleshooting means opening the `.md` files in the Koishi data directory, no DB queries
157
+
158
+ ### Features
159
+
160
+ | Group | Capability |
161
+ | --- | --- |
162
+ | **Moderation** | Mute / unmute / kick (optionally rejecting future join requests). Durations `10`, `10m`, `1h`, `1d`, `1w`, capped at 30 days |
163
+ | **Authorization** | Account allowlist plus group owner / admin checks; can require the bot itself to hold owner or admin rights |
164
+ | **Message filtering** | Whole-message scoring for banned words (fuzzy ordered matching, confidence decay, per-word weights); intercepts card messages and merged forwards; optional auto-recall with a group notice |
165
+ | **Strong keywords** | `strongKeywords` triggers moderation on match and **ignores allowlist exemptions**, closing the "append an allowlisted word to bypass" hole. Evaluation order: strong keyword → allowlist → banned word |
166
+ | **Per-group overrides** | `groupRules` sets banned words, strong keywords, allowlist keywords and toggles per group; unset values fall back to global |
167
+ | **Auto punishment** | Accumulated violations inside a window reaching a threshold trigger auto-mute / auto-kick; threshold, duration and window are all configurable |
168
+ | **Blacklist** | Stored per group (`banMember_<groupId>.md`); join requests are matched automatically and rejected |
169
+ | **Join review** | New requests are pushed to the group; admins use `approve` / `reject`. Pending requests are persisted and **survive restarts** |
170
+ | **Memory store** | `[memory]` save / list / search / delete into `Memory.md`; when enabled, AI replies retrieve and cite relevant memories |
171
+ | **AI replies** | Three sequential gates: ① message threshold ② random probability ③ interest scoring. Failing any gate means no reply and no model call; an `@mention` bypasses every gate. Multiple personas, context window, temperature and output limits |
172
+ | **AI vision** | Images are downloaded and converted to data URLs before being sent to the model; handles CQ codes, HTML `<img>` and message elements, including stickers |
173
+ | **Repeat (echo)** | Echoes a message once consecutive repeats reach a threshold; repeat events feed into the AI context |
174
+
175
+ ### Install
176
+
177
+ ```sh
178
+ npm i @nestim/koishi-plugin-qq-group-manager
179
+ ```
180
+
181
+ Or search `qq-group-manager` in the Koishi console plugin market.
182
+
183
+ Requires `koishi >= 4.18.7` and a OneBot implementation (NapCat / LLOneBot, etc.) providing
184
+ `setGroupBan` / `setGroupKick` / `getGroupMemberInfo`.
185
+
186
+ ### Commands
187
+
188
+ All commands use `[prefix] args`; targets accept a QQ number or `@mention`.
189
+ Send `[bot]` on its own to show the menu.
190
+
191
+ | Command | Description |
192
+ | --- | --- |
193
+ | `[mute] QQ duration [reason]` | Mute. Duration `10` / `10m` / `1h` / `1d` / `1w`, max 30 days |
194
+ | `[unmute] QQ [reason]` | Unmute |
195
+ | `[kick] QQ [reason]` | Remove from the group (optionally reject future join requests and record to the blacklist) |
196
+ | `[memory] content` | Save a memory |
197
+ | `[memory] list` | List the 10 most recent memories |
198
+ | `[memory] search keyword` | Search memories (`query` / `find` are synonyms) |
199
+ | `[memory] delete keyword` | Delete memories containing the keyword (`del` is a synonym) |
200
+ | `[ban] QQ [reason]` | Add to this group's blacklist |
201
+ | `[unban] QQ [reason]` | Remove from this group's blacklist |
202
+ | `[banlist]` | List this group's blacklist |
203
+ | `[custom]` | List custom commands |
204
+ | `[bot]` | Show the command menu |
205
+ | `[Version]` | Show plugin info (version, author, GitHub and npm links) |
206
+
207
+ **Join review**: a new request posts a 6-digit ID to the group. Admins reply with plain text —
208
+ `approve [id] [reason]` or `reject [id] [reason]`. The ID may be omitted, in which case the
209
+ most recent pending request in that group is used.
210
+
211
+ ### Configuration groups
212
+
213
+ The plugin's config page is organised into 11 groups:
214
+ `基础设置` · `消息管控` · `自动管控` · `记忆库` · `黑名单` · `娱乐设置` · `群聊互动` ·
215
+ `自定义命令` · `AI 回复` · `权限设置` · `日志设置` (Basics · Message filtering · Auto
216
+ punishment · Memory · Blacklist · Entertainment · Group interaction · Custom commands ·
217
+ AI replies · Permissions · Logging).
218
+
219
+ A few commonly used options:
220
+
221
+ | Option | Default | Description |
222
+ | --- | --- | --- |
223
+ | `command` | `[bot]` | Menu entry prefix |
224
+ | `allowedUserIds` | `[]` | Accounts allowed to use moderation commands directly |
225
+ | `bannedWords` | `[]` | Banned words; supports `keyword\|score` for custom weights |
226
+ | `bannedWordScoreThreshold` | `70` | Score threshold for banned words (shared with strong keywords) |
227
+ | `strongKeywords` | `[]` | Strong keywords: match triggers moderation and **ignores allowlist exemptions**; supports `keyword\|score` |
228
+ | `groupRules` | `[]` | Per-group overrides (banned words, strong keywords, allowlist keywords, AI toggles, auto-punishment thresholds) |
229
+ | `enableJoinRequestReview` | `true` | Whether to enable join review |
230
+ | `enableAiReply` | `false` | Master switch for AI replies (pair with `aiReplyRequireGroupRule` to enable per group) |
231
+ | `dryRun` | `false` | Dry-run mode: log planned actions without executing them |
232
+
233
+ ### Data files
234
+
235
+ All stored in the Koishi data directory (`ctx.baseDir`), readable and editable through the
236
+ console Explorer:
237
+
238
+ | File | Contents |
239
+ | --- | --- |
240
+ | `Memory.md` | Memory store, entries separated by `---` |
241
+ | `banMember_<groupId>.md` | Per-group blacklist, `## QQ · note` plus join time |
242
+ | `JoinRequests.md` | Pending join requests (human-readable table + machine-readable section); restored on restart, expired entries cleaned up automatically |
243
+
244
+ ### Permission model
245
+
246
+ Moderation commands (`[mute]` `[unmute]` `[kick]` `[ban]` `[unban]` `[banlist]`) use
247
+ **two-step authorization**:
248
+
249
+ 1. **Actor identity** — passes if the sender is in `allowedUserIds`; otherwise they must be
250
+ the group owner (`allowGroupOwner`) or a group admin (`allowGroupAdmin`).
251
+ 2. **Execution capability** — when `requireBotOwnerForAdmin` is on, the bot must itself be
252
+ owner or admin in that group.
253
+
254
+ Both steps must pass. Authorization details and command results are written to logs only and
255
+ are never echoed into the group.
256
+
142
257
  ## License
143
258
 
144
259
  MIT
260
+
261
+ ---
262
+
263
+ 📖 **完整文档请前往 GitHub / Full documentation on GitHub:**
264
+ <https://github.com/Miseat/koishi-plugin-qq-group-manager#readme>
265
+
266
+ - 🐛 Issues / 问题反馈:<https://github.com/Miseat/koishi-plugin-qq-group-manager/issues>
267
+ - 📦 npm:<https://www.npmjs.com/package/@nestim/koishi-plugin-qq-group-manager>
268
+ - 📝 更新日志 / Changelog:[CHANGELOG.md](https://github.com/Miseat/koishi-plugin-qq-group-manager/blob/master/CHANGELOG.md)