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

123 lines
2.3 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";
2022-10-17 20:55:39 +08:00
import {genShenMap} from './map.js'
2022-07-24 11:46:05 +08:00
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-08-16 23:24:54 +08:00
import {
2022-09-06 23:09:04 +08:00
rule as userRule,delSign,updCookie,
2022-10-12 16:51:51 +08:00
userInfo,gclog,mytoken,bindStoken,cloudToken
2022-08-16 23:24:54 +08:00
} from "./user.js"
2022-07-29 01:42:35 +08:00
import {
rule as signRule,
2022-10-12 16:51:51 +08:00
sign,bbsSign,cloudSign,seach,cookiesDocHelp,signTask
2022-07-29 01:42:35 +08:00
} from "./sign.js"
2022-10-12 16:51:51 +08:00
2022-07-24 11:46:05 +08:00
export {
2022-10-12 16:51:51 +08:00
updateRes,delSign,cloudSign,seach,bbsSign,
gclog,mytoken,bindStoken,
2022-08-16 23:24:54 +08:00
updateMiaoPlugin,userInfo,
2022-10-12 16:51:51 +08:00
sign,
versionInfo,cloudToken,
Note_appoint,signTask,
2022-10-17 20:55:39 +08:00
pokeNote,genShenMap,
2022-10-12 16:51:51 +08:00
cookiesDocHelp,
2022-07-24 11:46:05 +08:00
sysCfg,
2022-09-06 23:09:04 +08:00
help,updCookie,
2022-08-01 23:13:34 +08:00
DailyNoteTask,
2022-07-24 11:46:05 +08:00
AtlasAlias,
2022-08-01 23:13:34 +08:00
Note,
2022-07-24 11:46:05 +08:00
};
2022-08-01 23:13:34 +08:00
import gsCfg from '../model/gsCfg.js';
2022-10-17 20:55:39 +08:00
import Data from "../components/Data.js";
2022-08-01 23:13:34 +08:00
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: "体力",
},
2022-10-19 07:05:20 +08:00
2022-07-24 11:46:05 +08:00
Note_appoint: {
reg: "^#体力模板(设置(.*)|列表(.*))$",
2022-07-24 11:46:05 +08:00
describe: "体力模板设置",
},
2022-10-19 07:05:20 +08:00
genShenMap:{
reg: "^#(.*)(在(哪|那)里)$",
describe: "地图资源查询 #**在哪里",
},
2022-07-24 11:46:05 +08:00
pokeNote: {
reg: "#poke#",
describe: "体力",
},
2022-08-16 23:24:54 +08:00
...userRule,
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() {
2022-10-17 20:55:39 +08:00
2022-08-01 23:13:34 +08:00
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) {
2022-10-12 16:51:51 +08:00
signTask('bbs')
2022-08-03 22:56:01 +08:00
}
}
);
schedule.scheduleJob(set.allSignTime, function() {
if (set.isSign) {
2022-10-12 16:51:51 +08:00
signTask('mys')
2022-08-03 22:56:01 +08:00
}
});
schedule.scheduleJob(set.YunSignTime, function() {
if (set.isYunSign) {
2022-10-12 16:51:51 +08:00
signTask('cloud')
}
});
2022-10-17 20:55:39 +08:00
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
};