koishi-plugin-cat-raising 0.0.4 → 0.0.5

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.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface Config {
4
4
  targetQQ: string;
5
5
  isGroup: boolean;
6
6
  debugMode: boolean;
7
+ monitorGroup: string;
7
8
  }
8
9
  export declare const Config: Schema<Config>;
9
10
  export declare function apply(ctx: Context, config: Config): void;
package/lib/index.js CHANGED
@@ -30,16 +30,13 @@ var name = "cat-raising";
30
30
  var Config = import_koishi.Schema.object({
31
31
  targetQQ: import_koishi.Schema.string().description("目标QQ号或QQ群号").required(),
32
32
  isGroup: import_koishi.Schema.boolean().description("是否为QQ群").default(false),
33
- debugMode: import_koishi.Schema.boolean().description("调试模式(不执行转发,仅在原消息处发送调试信息)").default(false)
33
+ debugMode: import_koishi.Schema.boolean().description("调试模式(不执行转发,仅在原消息处发送调试信息)").default(false),
34
+ monitorGroup: import_koishi.Schema.string().description("监听的群号(只检测此群的消息)").required()
34
35
  });
35
36
  function apply(ctx, config) {
36
37
  ctx.on("message", (session) => {
37
38
  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
- }
39
+ if (session.channelId !== config.monitorGroup) return;
43
40
  if (!message.includes("神金")) return;
44
41
  const numberRegex = /\d{6,15}/;
45
42
  if (!numberRegex.test(message)) return;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-cat-raising",
3
3
  "description": "",
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [