koishi-plugin-onebot-verifier 1.1.7 → 1.1.8
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 +10 -9
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var Config = import_koishi.Schema.intersect([
|
|
|
51
51
|
import_koishi.Schema.object({
|
|
52
52
|
friendTimeout: import_koishi.Schema.union([
|
|
53
53
|
import_koishi.Schema.const(false).description("手动"),
|
|
54
|
-
import_koishi.Schema.number().description("
|
|
54
|
+
import_koishi.Schema.number().description("自动").default(360)
|
|
55
55
|
]).description("超时处理").default(false),
|
|
56
56
|
friendLevel: import_koishi.Schema.number().description("最低好友等级").default(0).min(0).max(256),
|
|
57
57
|
friendRegex: import_koishi.Schema.string().description("好友验证正则"),
|
|
@@ -61,7 +61,7 @@ var Config = import_koishi.Schema.intersect([
|
|
|
61
61
|
import_koishi.Schema.object({
|
|
62
62
|
memberTimeout: import_koishi.Schema.union([
|
|
63
63
|
import_koishi.Schema.const(false).description("手动"),
|
|
64
|
-
import_koishi.Schema.number().description("
|
|
64
|
+
import_koishi.Schema.number().description("自动").default(360)
|
|
65
65
|
]).description("超时处理").default(false),
|
|
66
66
|
verifyRules: import_koishi.Schema.array(import_koishi.Schema.object({
|
|
67
67
|
guildId: import_koishi.Schema.string().description("群号").required(),
|
|
@@ -71,24 +71,24 @@ var Config = import_koishi.Schema.intersect([
|
|
|
71
71
|
import_koishi.Schema.const("accept").description("同意"),
|
|
72
72
|
import_koishi.Schema.const("reject").description("拒绝")
|
|
73
73
|
]).description("操作")
|
|
74
|
-
})).description("
|
|
75
|
-
}).description("加群请求配置"),
|
|
76
|
-
import_koishi.Schema.object({
|
|
74
|
+
})).description("普通验证").role("table"),
|
|
77
75
|
specialRules: import_koishi.Schema.array(import_koishi.Schema.object({
|
|
78
76
|
guildId: import_koishi.Schema.string().description("群号").required(),
|
|
79
77
|
mode: import_koishi.Schema.union([
|
|
80
78
|
import_koishi.Schema.const("vote").description("投票"),
|
|
81
79
|
import_koishi.Schema.const("captcha").description("验证码")
|
|
82
80
|
]).description("模式").default("vote")
|
|
83
|
-
})).description("
|
|
81
|
+
})).description("高级验证").role("table")
|
|
82
|
+
}).description("加群请求配置"),
|
|
83
|
+
import_koishi.Schema.object({
|
|
84
|
+
voteInSitu: import_koishi.Schema.boolean().description("[投票]原群投票模式").default(true),
|
|
84
85
|
voteRatio: import_koishi.Schema.string().description("[投票]支持/反对人数").default("3:2"),
|
|
85
|
-
voteInSitu: import_koishi.Schema.boolean().description("[投票]对应群中发起").default(true),
|
|
86
86
|
captchaDiff: import_koishi.Schema.union([
|
|
87
87
|
import_koishi.Schema.const("simple").description("简单"),
|
|
88
88
|
import_koishi.Schema.const("medium").description("中等"),
|
|
89
89
|
import_koishi.Schema.const("hard").description("困难")
|
|
90
|
-
]).description("[验证]
|
|
91
|
-
}).description("
|
|
90
|
+
]).description("[验证]计算难度").default("simple")
|
|
91
|
+
}).description("模式配置")
|
|
92
92
|
]);
|
|
93
93
|
function apply(ctx, config) {
|
|
94
94
|
const logger = new import_koishi.Logger("onebot-verifier");
|
|
@@ -343,6 +343,7 @@ function apply(ctx, config) {
|
|
|
343
343
|
});
|
|
344
344
|
ctx.on("guild-removed", async (session) => {
|
|
345
345
|
if (session.guildId) {
|
|
346
|
+
if (config.debugMode) logger.info(`[事件] 退出: ${session.guildId} 数据: ${JSON.stringify(session.event?._data)}`);
|
|
346
347
|
const eventData = session.event?._data || {};
|
|
347
348
|
if (eventData.sub_type === "kick_me") {
|
|
348
349
|
const inviterId = inviterMap.get(session.guildId);
|