koishi-plugin-cat-raising 0.0.2 → 0.0.4
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 +5 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -35,6 +35,11 @@ var Config = import_koishi.Schema.object({
|
|
|
35
35
|
function apply(ctx, config) {
|
|
36
36
|
ctx.on("message", (session) => {
|
|
37
37
|
const message = session.content;
|
|
38
|
+
if (config.isGroup) {
|
|
39
|
+
if (session.channelId === config.targetQQ) return;
|
|
40
|
+
} else {
|
|
41
|
+
if (session.userId === config.targetQQ) return;
|
|
42
|
+
}
|
|
38
43
|
if (!message.includes("神金")) return;
|
|
39
44
|
const numberRegex = /\d{6,15}/;
|
|
40
45
|
if (!numberRegex.test(message)) return;
|
|
@@ -53,7 +58,6 @@ function apply(ctx, config) {
|
|
|
53
58
|
} else {
|
|
54
59
|
session.bot.sendPrivateMessage(config.targetQQ, forwardMessage);
|
|
55
60
|
}
|
|
56
|
-
session.send("🐱 检测到神金 已执行转发~");
|
|
57
61
|
});
|
|
58
62
|
}
|
|
59
63
|
__name(apply, "apply");
|