koishi-plugin-group-control 1.0.0-alpha.6 → 1.0.0

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/lib/index.js CHANGED
@@ -581,20 +581,21 @@ function apply3(ctx, config) {
581
581
  } catch (error) {
582
582
  console.error(`发送等待审核提示给 ${rawUserId} 失败:`, error);
583
583
  }
584
- if (!config.admin.adminQQs || config.admin.adminQQs.length === 0) {
585
- if (config.invite.autoApprove) {
586
- try {
587
- await session.bot.internal.setGroupAddRequest(flag, "invite", true, "");
588
- approvedGroups.add(rawGroupId);
589
- if (config.invite.showDetailedLog) {
590
- console.log(`自动同意群聊邀请: 群号 ${rawGroupId}, 邀请者 ${rawUserId}`);
591
- }
592
- } catch (error) {
593
- console.error("自动同意群聊邀请失败:", error);
584
+ if (config.invite.autoApprove) {
585
+ try {
586
+ await session.bot.internal.setGroupAddRequest(flag, "invite", true, "");
587
+ approvedGroups.add(rawGroupId);
588
+ if (config.invite.showDetailedLog) {
589
+ console.log(`自动同意群聊邀请: 群号 ${rawGroupId}, 邀请者 ${rawUserId}`);
594
590
  }
591
+ } catch (error) {
592
+ console.error("自动同意群聊邀请失败:", error);
595
593
  }
596
594
  return;
597
595
  }
596
+ if (!config.admin.adminQQs || config.admin.adminQQs.length === 0) {
597
+ return;
598
+ }
598
599
  await addPendingInvite(ctx, {
599
600
  groupId: rawGroupId,
600
601
  userId: rawUserId,
@@ -1038,6 +1039,9 @@ function apply6(ctx, config) {
1038
1039
  if (isBotEnabled) {
1039
1040
  return next();
1040
1041
  }
1042
+ if (ADMIN_COMMANDS.has(session["event"]["_data"]["message"])) {
1043
+ return next();
1044
+ }
1041
1045
  const isMentioned = session.elements?.some((e) => e.type === "at" && e.attrs.id === session.bot.userId);
1042
1046
  if (isMentioned && config.botSwitch.disabledMessage) {
1043
1047
  try {
@@ -1179,7 +1183,7 @@ var Config = import_koishi.Schema.intersect([
1179
1183
  import_koishi.Schema.object({
1180
1184
  invite: import_koishi.Schema.object({
1181
1185
  enabled: import_koishi.Schema.boolean().default(false).description("启用群聊邀请审核"),
1182
- autoApprove: import_koishi.Schema.boolean().default(false).description("自动同意邀请(仅在未指定管理员时生效)"),
1186
+ autoApprove: import_koishi.Schema.boolean().default(false).description("自动同意邀请"),
1183
1187
  inviteWaitMessage: import_koishi.Schema.string().default("已收到您的群聊邀请,正在等待管理员审核,请耐心等待。").description("发给邀请者的等待提示"),
1184
1188
  inviteRequestMessage: import_koishi.Schema.string().default("收到新的群聊邀请请求:\n群名称:{groupName}\n群号:{groupId}\n邀请者:{userName} (QQ: {userId})\n\n请使用指令 gc.approve {groupId} 同意或 gc.reject {groupId} 拒绝。").description("发给管理员的请求消息模板,支持变量 {groupName}, {groupId}, {userName}, {userId}"),
1185
1189
  inviteExpireDays: import_koishi.Schema.number().default(3).description("邀请记录过期天数"),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-group-control",
3
3
  "description": "Koishi 插件,一个多功能的群聊自管理工具。支持被踢出自动拉黑、刷屏自动屏蔽、开关控制等功能。(仅支持 OneBot 适配器)",
4
- "version": "1.0.0-alpha.6",
4
+ "version": "1.0.0",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [
package/readme.md CHANGED
@@ -65,7 +65,7 @@ Koishi 插件,多功能群聊自管理工具。仅支持 OneBot 适配器。
65
65
 
66
66
  **小群自动退群**
67
67
 
68
- | 配���项 | 默认值 | 说明 |
68
+ | 配置项 | 默认值 | 说明 |
69
69
  |--------|--------|------|
70
70
  | `smallGroupAutoQuit` | `false` | 启用小群自动退群 |
71
71
  | `smallGroupThreshold` | `30` | 人数阈值,低于等于此值时自动退出 |
@@ -91,7 +91,7 @@ Koishi 插件,多功能群聊自管理工具。仅支持 OneBot 适配器。
91
91
 
92
92
  **群聊**
93
93
 
94
- | 配置项 | 默认��� | 说明 |
94
+ | 配置项 | 默认值 | 说明 |
95
95
  |--------|--------|------|
96
96
  | `enabled` | `false` | 启用群聊频率控制(指令及 @ 对话均受限) |
97
97
  | `limit` | `5` | 时间窗口内允许的最大触发次数 |
@@ -181,7 +181,7 @@ Koishi 插件,多功能群聊自管理工具。仅支持 OneBot 适配器。
181
181
  | `gc.fr <QQ号>` | 拒绝好友申请 |
182
182
  | `gc.fp` | 查看待处理的好友申请列表 |
183
183
 
184
- ### ���聊管理
184
+ ### 群聊管理
185
185
 
186
186
  | 指令 | 说明 | 权限 |
187
187
  |------|------|------|
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 muyni
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.