@nestim/koishi-plugin-qq-group-manager 0.1.4 → 0.1.6

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 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/commands.js CHANGED
@@ -105,17 +105,16 @@ function registerCommands(ctx, service, config) {
105
105
  return formatAction(result, config, displayTarget);
106
106
  });
107
107
  root
108
- .subcommand('gag [target:string]', '口球(随机 1~60 分钟禁言)')
109
- .alias('口球')
110
- .alias('口气')
108
+ .subcommand('gag [target:string]', '自我约束(随机 1~60 分钟禁言)')
109
+ .alias('自我约束')
111
110
  .option('reason', '-r <reason:string> 操作原因')
112
111
  .action(async ({ session, options }, target) => {
113
112
  if (!config.enableSelfGag)
114
- return '口球娱乐功能未启用。';
113
+ return '自我约束功能未启用。';
115
114
  if (!session?.userId)
116
115
  return '无法识别当前账号。';
117
116
  if (config.allowedUserIds.includes(session.userId))
118
- return '喵~ 白名单用户不参与口球。';
117
+ return '喵~ 白名单用户不参与自我约束。';
119
118
  const resolvedTarget = target || session.userId;
120
119
  if (await service.shouldSelfGag(session, resolvedTarget)) {
121
120
  const result = await service.selfGag(session, 'gag-trigger');
@@ -168,22 +167,4 @@ function registerCommands(ctx, service, config) {
168
167
  const displayTarget = await service.formatTargetDisplay(session, result.plan?.targetId, target);
169
168
  return formatAction(result, config, displayTarget);
170
169
  });
171
- root
172
- .subcommand('审核 <code:string> <state:string>', '审核入群申请(同意/拒绝)')
173
- .option('reason', '-r <reason:string> 审核理由')
174
- .action(async ({ session, options }, code, state) => {
175
- if (!code || !state)
176
- return '请提供审核编号与状态(同意/拒绝)。';
177
- const auth = await service.authorizeCommand('review-join-request', session);
178
- if (!auth.ok)
179
- return auth.userMessage ?? '权限不足或上下文不符合要求。';
180
- const normalized = state.trim().toLowerCase();
181
- const approve = ['同意', '通过', '放行', '批准', 'approve', 'pass', 'ok', 'yes'].includes(normalized);
182
- const reject = ['拒绝', '驳回', 'deny', 'reject', 'no', 'refuse'].includes(normalized);
183
- if (!approve && !reject)
184
- return '状态仅支持:同意/拒绝。';
185
- const result = await service.reviewJoinRequestDecision(session, code, approve, options.reason);
186
- service.logCommandResult('review-join-request', result, session, { code, approve, source: 'command' });
187
- return formatAction(result, config);
188
- });
189
170
  }
package/lib/index.d.ts CHANGED
@@ -66,7 +66,6 @@ export interface Config {
66
66
  enableMemory: boolean;
67
67
  memoryFileName: string;
68
68
  memoryInAi: boolean;
69
- memoryContent: string;
70
69
  groupRules: GroupRule[];
71
70
  allowedUserIds: string[];
72
71
  allowGroupOwner: boolean;
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,7 @@ 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('该群专属违禁词列表(同样支持“关键词|分值”与顺序模糊匹配)。'),
35
36
  blockCardMessage: koishi_1.Schema.boolean().default(true).description('该群是否禁止卡片消息(json/xml)。'),
36
37
  blockForwardMessage: koishi_1.Schema.boolean().default(true).description('该群是否禁止合并转发消息(forward)。'),
37
38
  autoDeleteViolation: koishi_1.Schema.boolean().default(true).description('该群违规消息是否自动撤回。'),
@@ -55,9 +56,8 @@ exports.Config = koishi_1.Schema.intersect([
55
56
  }).description('自动管控'),
56
57
  koishi_1.Schema.object({
57
58
  enableMemory: koishi_1.Schema.boolean().default(true).description('启用记忆库:群内发送 [记忆]+内容 保存到 Memory.md,[记忆查询]/[记忆删除] 管理,AI 回复可引用。'),
58
- memoryFileName: koishi_1.Schema.string().default('Memory.md').description('记忆库文件名(保存在 Koishi 数据目录)。'),
59
+ memoryFileName: koishi_1.Schema.string().default('Memory.md').description('记忆库文件名(保存在 Koishi 数据目录)。请直接使用控制台左侧「探索器 Explorer」打开该文件查看/编辑记忆库内容。'),
59
60
  memoryInAi: koishi_1.Schema.boolean().default(true).description('AI 回复/识图时是否参考记忆库内容。'),
60
- memoryContent: koishi_1.Schema.string().role('textarea').default('').description('记忆库内容(可直接在此查看/编辑 Memory.md,保存后会自动写回文件)。'),
61
61
  }).description('记忆库'),
62
62
  koishi_1.Schema.object({
63
63
  enableSelfGag: koishi_1.Schema.boolean().default(true).description('启用口球娱乐:普通成员对自己使用 mute/gag 时随机 1~60 分钟禁言。'),
package/lib/service.d.ts CHANGED
@@ -122,7 +122,6 @@ export declare class QQGroupManagerService extends Service {
122
122
  private searchMemory;
123
123
  private decoratePromptWithMemory;
124
124
  private handleMemoryCommand;
125
- private _syncMemoryConfig;
126
125
  private isImageSendableUrl;
127
126
  describeImageMessage(session?: Session): {
128
127
  hasCqImage: boolean;