@nestim/koishi-plugin-qq-group-manager 0.1.5 → 0.1.7
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.
- package/LICENSE +21 -0
- package/lib/index.js +19 -3
- package/lib/service.js +815 -105
- package/package.json +1 -1
- package/readme.md +97 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Miseat
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/lib/index.js
CHANGED
|
@@ -23,7 +23,8 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
23
23
|
dryRun: koishi_1.Schema.boolean().default(false).description('演练模式:仅输出计划动作,不执行群管理操作。'),
|
|
24
24
|
}).description('基础设置'),
|
|
25
25
|
koishi_1.Schema.object({
|
|
26
|
-
bannedWords: koishi_1.Schema.array(String).role('table').default([]).description('
|
|
26
|
+
bannedWords: koishi_1.Schema.array(String).role('table').default([]).description('违禁词列表。支持顺序模糊匹配(如“领红包”可命中“领xxx元红包”)。可用“关键词|分值”自定义权重,分值越高越容易单独触发。'),
|
|
27
|
+
bannedWordScoreThreshold: koishi_1.Schema.natural().min(1).max(100).default(70).description('违禁词评分触发阈值:整条消息累计得分达到该值才触发管控(默认 70)。'),
|
|
27
28
|
blockCardMessage: koishi_1.Schema.boolean().default(true).description('是否禁止卡片消息(json/xml)。'),
|
|
28
29
|
blockForwardMessage: koishi_1.Schema.boolean().default(true).description('是否禁止合并转发消息(forward)。'),
|
|
29
30
|
autoDeleteViolation: koishi_1.Schema.boolean().default(true).description('违规消息是否自动撤回。'),
|
|
@@ -31,7 +32,9 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
31
32
|
groupRules: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
32
33
|
guildId: koishi_1.Schema.string().required().description('群号。'),
|
|
33
34
|
enableAiReply: koishi_1.Schema.boolean().description('该群是否启用 AI 回复(留空则跟随全局设置)。'),
|
|
34
|
-
bannedWords: koishi_1.Schema.array(String).role('table').default([]).description('
|
|
35
|
+
bannedWords: koishi_1.Schema.array(String).role('table').default([]).description('该群专属违禁词列表(同样支持“关键词|分值”与顺序模糊匹配)。'),
|
|
36
|
+
whitelistKeywords: koishi_1.Schema.array(String).role('table').default([]).description('该群违禁词白名单:消息只要命中其中任意一个关键词,就整条跳过违禁词评分(用于校学生会招新等允许的宣传场景)。'),
|
|
37
|
+
whitelistOnlyOwners: koishi_1.Schema.boolean().default(false).description('白名单是否仅对群主/管理员生效。关闭时所有群成员命中白名单均可豁免。'),
|
|
35
38
|
blockCardMessage: koishi_1.Schema.boolean().default(true).description('该群是否禁止卡片消息(json/xml)。'),
|
|
36
39
|
blockForwardMessage: koishi_1.Schema.boolean().default(true).description('该群是否禁止合并转发消息(forward)。'),
|
|
37
40
|
autoDeleteViolation: koishi_1.Schema.boolean().default(true).description('该群违规消息是否自动撤回。'),
|
|
@@ -75,7 +78,20 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
75
78
|
joinRequestReviewTtlMinutes: koishi_1.Schema.natural().default(30).description('入群申请审核编号的有效期(分钟)。'),
|
|
76
79
|
}).description('群聊互动'),
|
|
77
80
|
koishi_1.Schema.object({
|
|
78
|
-
|
|
81
|
+
customCommands: koishi_1.Schema.array(koishi_1.Schema.object({
|
|
82
|
+
trigger: koishi_1.Schema.string().required().description('触发词,需用方括号包裹,如 [签到]。只有整条消息与之完全相同(忽略首尾空白)才会触发。'),
|
|
83
|
+
replies: koishi_1.Schema.array(String).role('table').default([]).description('回复内容,可配置多条。每条支持 {user} 发送者昵称、{at} @发送者、{group} 群号。'),
|
|
84
|
+
enabled: koishi_1.Schema.boolean().default(true).description('是否启用该命令。'),
|
|
85
|
+
groups: koishi_1.Schema.array(String).role('table').default([]).description('限定生效的群号;留空表示所有群生效。'),
|
|
86
|
+
randomReply: koishi_1.Schema.boolean().default(false).description('配置多条回复时:开启则随机选一条,关闭则按顺序轮换。'),
|
|
87
|
+
quote: koishi_1.Schema.boolean().default(false).description('回复时是否引用触发的那条消息。'),
|
|
88
|
+
cooldownSeconds: koishi_1.Schema.natural().default(0).description('同一群内该命令的冷却时间(秒,0 表示不限制)。'),
|
|
89
|
+
logHit: koishi_1.Schema.boolean().default(true).description('命中时是否写入日志。'),
|
|
90
|
+
})).role('table').default([]).description('自定义命令:检测到指定命令后输出预设消息(触发后不再走 AI 回复)。'),
|
|
91
|
+
}).description('自定义命令'),
|
|
92
|
+
koishi_1.Schema.object({
|
|
93
|
+
enableAiReply: koishi_1.Schema.boolean().default(false).description('全局 AI 回复开关(当 aiReplyRequireGroupRule 关闭时,未单独配置的群会回落到此值)。'),
|
|
94
|
+
aiReplyRequireGroupRule: koishi_1.Schema.boolean().default(true).description('AI 回复是否要求该群已单独配置:开启后,未出现在 groupRules 里的群一律不启用 AI 回复(推荐)。'),
|
|
79
95
|
aiProvider: koishi_1.Schema.union([
|
|
80
96
|
koishi_1.Schema.const('openai-compatible').description('OpenAI 兼容接口(OpenAI/火山引擎/Codex API/Auth 等)'),
|
|
81
97
|
koishi_1.Schema.const('gemini').description('Gemini 原生接口(Google Generative Language API)'),
|