koishi-plugin-xsxn-vue3 1.0.10 → 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 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
@@ -23,7 +23,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
23
23
  // src/locales/zh-CN.yml
24
24
  var require_zh_CN = __commonJS({
25
25
  "src/locales/zh-CN.yml"(exports, module2) {
26
- module2.exports = { commands: { querycrop: { description: "作物", examples: "作物 <作物名称>" }, querycookbook: { description: "食谱", examples: "用法:\n食谱+空格+[可为空、食谱名称、食材]" }, querydispatch: { description: "派遣" }, queryinsect: { description: "虫", examples: "用法:\n虫+空格+[虫名称、虫品质]" }, queryfish: { description: "鱼", examples: "用法:\n鱼+空格+[鱼名称、鱼品质]" }, queryinsectisland: { description: "虫岛", examples: "用法:\n虫岛+空格+[虫岛名称]" }, queryfishisland: { description: "鱼岛", examples: "用法:\n鱼岛+空格+[鱼岛名称]" }, querylike: { description: "喜好", examples: "用法:\n喜好+空格+[可为空、角色名称]" }, querytianzhu: { description: "天柱", examples: "用法:\n天柱+空格+[天柱名称或者 怪名称 奖励名称]" }, queryproductiontool: { description: "设施", examples: "用法:\n设施+空格+[可升级设施名称]" } } };
26
+ module2.exports = { commands: { querycrop: { description: "作物", examples: "作物 <作物名称>" }, querycookbook: { description: "食谱", examples: "用法:\n食谱+空格+[可为空、食谱名称、食材]" }, querydispatch: { description: "派遣" }, queryinsect: { description: "虫", examples: "用法:\n虫+空格+[虫名称、虫品质]" }, queryfish: { description: "鱼", examples: "用法:\n鱼+空格+[鱼名称、鱼品质]" }, queryinsectisland: { description: "虫岛", examples: "用法:\n虫岛+空格+[虫岛名称]" }, queryfishisland: { description: "鱼岛", examples: "用法:\n鱼岛+空格+[鱼岛名称]" }, querylike: { description: "卡池", examples: "用法:\n卡池+空格+[可为空、角色名称]" }, querytianzhu: { description: "天柱", examples: "用法:\n天柱+空格+[天柱名称或者 怪名称 奖励名称]" }, queryproductiontool: { description: "设施", examples: "用法:\n设施+空格+[可升级设施名称]" } } };
27
27
  }
28
28
  });
29
29
 
@@ -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.10",
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.0"
25
+ "koishi": "^4.18.8"
26
+ },
27
+ "dependencies": {
28
+ "koishi-plugin-cron": "^3.1.0"
26
29
  }
27
30
  }
package/readme.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # koishi-plugin-xsxn-vue3
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/koishi-plugin-xsxn-vue3?style=flat-square)](https://www.npmjs.com/package/koishi-plugin-xsxn-vue3)
4
- - ### 1.0.10
5
- - 控制同伴搜索条件
4
+ - ### 1.0.12
5
+ - 添加定时消息功能
6
+ - ### 1.0.11
7
+ - 喜好指令修改为-卡池- 可搜索建筑,控制同伴搜索条件
6
8
  - ### 1.0.7
7
9
  - 新增天柱查询、设施升级查询
8
10
  - ### 1.0.5