koishi-plugin-xsxn-vue3 1.0.11 → 1.0.12
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 +6 -0
- package/lib/index.js +15 -2
- package/package.json +7 -4
- package/readme.md +2 -0
package/lib/index.d.ts
CHANGED
|
@@ -3,9 +3,15 @@ export declare const name = "xsxn_vue3";
|
|
|
3
3
|
export declare const inject: {
|
|
4
4
|
required: string[];
|
|
5
5
|
};
|
|
6
|
+
export interface CronTimeMessagesItem {
|
|
7
|
+
cronTime: string;
|
|
8
|
+
message: string;
|
|
9
|
+
groupID: string;
|
|
10
|
+
}
|
|
6
11
|
export interface Config {
|
|
7
12
|
url: string;
|
|
8
13
|
notice: string;
|
|
14
|
+
cronTimeMessages: CronTimeMessagesItem[];
|
|
9
15
|
}
|
|
10
16
|
export declare const Config: Schema<Config>;
|
|
11
17
|
export declare function apply(ctx: Context, cfg: Config): Promise<void>;
|
package/lib/index.js
CHANGED
|
@@ -39,14 +39,27 @@ module.exports = __toCommonJS(src_exports);
|
|
|
39
39
|
var import_koishi = require("koishi");
|
|
40
40
|
var name = "xsxn_vue3";
|
|
41
41
|
var inject = {
|
|
42
|
-
required: ["puppeteer"]
|
|
42
|
+
required: ["puppeteer", "cron"]
|
|
43
43
|
};
|
|
44
44
|
var Config = import_koishi.Schema.object({
|
|
45
45
|
url: import_koishi.Schema.string().description("服务器地址").default(""),
|
|
46
|
-
notice: import_koishi.Schema.string().description("公告文本").default("")
|
|
46
|
+
notice: import_koishi.Schema.string().description("公告文本").default(""),
|
|
47
|
+
cronTimeMessages: import_koishi.Schema.array(import_koishi.Schema.object({
|
|
48
|
+
cronTime: import_koishi.Schema.string().description("定时任务时间").default("0 0 * * *"),
|
|
49
|
+
message: import_koishi.Schema.string().description("定时任务消息").default(""),
|
|
50
|
+
groupID: import_koishi.Schema.string().description("定时任务群号").default("")
|
|
51
|
+
})).description("定时任务配置").default([])
|
|
47
52
|
});
|
|
48
53
|
async function apply(ctx, cfg) {
|
|
49
54
|
ctx.i18n.define("zh-CN", require_zh_CN());
|
|
55
|
+
var bot = ctx.bots[0];
|
|
56
|
+
if (cfg.cronTimeMessages && cfg.cronTimeMessages.length > 0) {
|
|
57
|
+
for (const item of cfg.cronTimeMessages) {
|
|
58
|
+
ctx.cron(item.cronTime, async () => {
|
|
59
|
+
bot.sendMessage(item.groupID, item.message);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
50
63
|
ctx.command("queryHelp").alias("关于").action((_) => {
|
|
51
64
|
return `
|
|
52
65
|
点击指令后输入需要查询的名称
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-xsxn-vue3",
|
|
3
3
|
"description": "查询工具与后端分离,无服务端,自用版本",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.12",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -17,11 +17,14 @@
|
|
|
17
17
|
],
|
|
18
18
|
"service": {
|
|
19
19
|
"required": [
|
|
20
|
-
"puppeteer"
|
|
20
|
+
"puppeteer",
|
|
21
|
+
"cron"
|
|
21
22
|
]
|
|
22
23
|
},
|
|
23
|
-
"devDependencies": {},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"koishi": "^4.18.
|
|
25
|
+
"koishi": "^4.18.8"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"koishi-plugin-cron": "^3.1.0"
|
|
26
29
|
}
|
|
27
30
|
}
|
package/readme.md
CHANGED