koishi-plugin-cocoyyy-console 1.0.8-beta.4 → 1.0.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 +4 -3
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -73,10 +73,10 @@ __name(resolveTagBaseDir, "resolveTagBaseDir");
|
|
|
73
73
|
// src/utils/configs/repeat_config.ts
|
|
74
74
|
var import_koishi4 = require("koishi");
|
|
75
75
|
var RepeatConfigSchema = import_koishi4.Schema.object({
|
|
76
|
-
minTimes: import_koishi4.Schema.number().default(
|
|
76
|
+
minTimes: import_koishi4.Schema.number().default(3).description("最小重复次数"),
|
|
77
77
|
probability: import_koishi4.Schema.number().default(1).description("复读概率[0-1]"),
|
|
78
78
|
guild_ids: import_koishi4.Schema.string().default("").description("不需要复读的群ID,多个群ID用逗号分隔"),
|
|
79
|
-
resetInterval: import_koishi4.Schema.number().default(
|
|
79
|
+
resetInterval: import_koishi4.Schema.number().default(300).description("过期秒数")
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
// src/utils/configs/rbq_config.ts
|
|
@@ -877,6 +877,7 @@ function registerRbqMiddleware(ctx, config) {
|
|
|
877
877
|
const atElements = elements?.filter((el) => el.type === "at") || [];
|
|
878
878
|
if (atElements.length === 0) return next();
|
|
879
879
|
const matched = config.configList.find((item) => {
|
|
880
|
+
if (item.guild_id !== guildId) return false;
|
|
880
881
|
const targetUid = item.uid?.trim();
|
|
881
882
|
if (!targetUid) return false;
|
|
882
883
|
const isAtTarget = atElements.some((el) => el.attrs?.id === targetUid);
|
|
@@ -885,7 +886,7 @@ function registerRbqMiddleware(ctx, config) {
|
|
|
885
886
|
return Math.random() <= probability;
|
|
886
887
|
});
|
|
887
888
|
if (!matched) return next();
|
|
888
|
-
const content = matched.content || "
|
|
889
|
+
const content = matched.content || "*你";
|
|
889
890
|
session.send((0, import_koishi8.h)("at", { id: matched.uid.trim() }) + " " + content);
|
|
890
891
|
return;
|
|
891
892
|
});
|