2
0
mirror of https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git synced 2024-12-22 19:10:53 +08:00
xiaoyao-cvs-plugin/apps/index.js

111 lines
1.9 KiB
JavaScript
Raw Normal View History

2022-07-24 11:46:05 +08:00
import lodash from "lodash";
2022-08-01 23:13:34 +08:00
import schedule from "node-schedule";
2022-07-24 11:46:05 +08:00
import {
AtlasAlias
} from "./xiaoyao_image.js";
import {
versionInfo,
help
} from "./help.js";
import {
2022-08-01 23:13:34 +08:00
Note,
DailyNoteTask,
Note_appoint,
pokeNote
2022-07-24 11:46:05 +08:00
} from "./Note.js";
import {
rule as adminRule,
updateRes,
sysCfg,
updateMiaoPlugin
} from "./admin.js";
import {
currentVersion
} from "../components/Changelog.js";
2022-07-29 01:42:35 +08:00
import {
rule as signRule,
2022-08-01 23:13:34 +08:00
sign,
mysSign,
2022-08-03 22:56:01 +08:00
cookiesDocHelp,
signlist,
2022-08-04 23:13:05 +08:00
allMysSign,yunSign,sendyunTime,yuntoken,
2022-08-01 23:13:34 +08:00
allSign
2022-07-29 01:42:35 +08:00
} from "./sign.js"
2022-07-24 11:46:05 +08:00
export {
2022-08-03 22:56:01 +08:00
updateRes,
signlist,
2022-08-01 23:13:34 +08:00
updateMiaoPlugin,
sign,
2022-07-24 11:46:05 +08:00
versionInfo,
2022-08-01 23:13:34 +08:00
Note_appoint,
2022-08-04 23:13:05 +08:00
pokeNote,yunSign,sendyunTime,yuntoken,
2022-08-01 23:13:34 +08:00
cookiesDocHelp,
2022-07-24 11:46:05 +08:00
sysCfg,
2022-08-01 23:13:34 +08:00
help,
DailyNoteTask,
allMysSign,
allSign,
2022-07-24 11:46:05 +08:00
AtlasAlias,
2022-08-01 23:13:34 +08:00
Note,
mysSign
2022-07-24 11:46:05 +08:00
};
2022-08-01 23:13:34 +08:00
import gsCfg from '../model/gsCfg.js';
const _path = process.cwd();
2022-07-24 11:46:05 +08:00
let rule = {
versionInfo: {
reg: "^#图鉴版本$",
describe: "【#帮助】 图鉴版本介绍",
},
help: {
reg: "^#?(图鉴)?(命令|帮助|菜单|help|说明|功能|指令|使用说明)$",
describe: "查看插件的功能",
},
AtlasAlias: {
reg: "^(#(.*)|.*图鉴)$",
describe: "角色、食物、怪物、武器信息图鉴",
},
Note: {
reg: "^#*(体力|树脂|查询体力|便笺|便签)$",
describe: "体力",
},
Note_appoint: {
reg: "^#体力模板(设置(.*)|列表(.*))$",
2022-07-24 11:46:05 +08:00
describe: "体力模板设置",
},
pokeNote: {
reg: "#poke#",
describe: "体力",
},
2022-07-29 01:42:35 +08:00
...signRule,
2022-07-24 11:46:05 +08:00
...adminRule
};
lodash.forEach(rule, (r) => {
r.priority = r.priority || 50;
r.prehash = true;
r.hashMark = true;
});
2022-08-01 23:13:34 +08:00
task();
//定时任务
async function task() {
if (typeof test != "undefined") return;
let set = gsCfg.getfileYaml(`${_path}/plugins/xiaoyao-cvs-plugin/config/`, "config")
2022-08-03 22:56:01 +08:00
schedule.scheduleJob(set.mysBbsTime, function() {
if (set.ismysSign) {
allMysSign()
}
}
);
schedule.scheduleJob(set.allSignTime, function() {
if (set.isSign) {
allSign()
}
});
2022-08-01 23:13:34 +08:00
}
2022-07-24 11:46:05 +08:00
export {
rule
2022-08-01 23:13:34 +08:00
};