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

158 lines
2.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,getBasicVoide
2022-07-24 11:46:05 +08:00
} from "./xiaoyao_image.js";
import {
versionInfo,
help
} from "./help.js";
2022-10-31 13:57:07 +08:00
import {
rule as mapRule,
genShenMap,delMapData
2022-10-31 13:57:07 +08:00
} from './map.js'
2022-07-24 11:46:05 +08:00
import {
2022-08-01 23:13:34 +08:00
Note,
DailyNoteTask,
Note_appoint,
2022-10-31 13:57:07 +08:00
noteTask,
2022-08-01 23:13:34 +08:00
pokeNote
2022-07-24 11:46:05 +08:00
} from "./Note.js";
import {
rule as adminRule,
updateRes,
sysCfg, updateTemp,
2022-07-24 11:46:05 +08:00
updateMiaoPlugin
} from "./admin.js";
2022-08-16 23:24:54 +08:00
import {
2022-10-31 13:57:07 +08:00
rule as userRule,
delSign,
updCookie,
userInfo,
gclog,
mytoken, gcPaylog,
bindStoken, bindLogin_ticket,
2022-10-31 13:57:07 +08:00
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-31 13:57:07 +08:00
sign,
bbsSign,
cloudSign,
seach,
cookiesDocHelp,
signTask
2022-07-29 01:42:35 +08:00
} from "./sign.js"
import {
rule as topupLoginRule,
qrCodeLogin,UserPassMsg,UserPassLogin,payOrder
} from './mhyTopUpLogin.js'
2022-07-24 11:46:05 +08:00
export {
updateRes, updateTemp,
delSign, gcPaylog,delMapData,
cloudSign,qrCodeLogin,
seach, bindLogin_ticket,payOrder,
bbsSign,UserPassMsg,UserPassLogin,
2022-10-31 13:57:07 +08:00
gclog,
mytoken, getBasicVoide,
2022-10-31 13:57:07 +08:00
bindStoken,
updateMiaoPlugin,
userInfo,
2022-10-12 16:51:51 +08:00
sign,
2022-10-31 13:57:07 +08:00
versionInfo,
cloudToken,
Note_appoint,
signTask,
pokeNote,
genShenMap,
2022-10-12 16:51:51 +08:00
cookiesDocHelp,
2022-07-24 11:46:05 +08:00
sysCfg,
2022-10-31 13:57:07 +08:00
help,
updCookie,
2022-08-01 23:13:34 +08:00
DailyNoteTask,
2022-10-31 13:57:07 +08:00
noteTask,
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';
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: "^#*(多|全|全部)*(体力|树脂|查询体力|便笺|便签)$",
2022-07-24 11:46:05 +08:00
describe: "体力",
},
2022-10-31 13:57:07 +08:00
noteTask: {
reg: "^#*((开启|关闭)体力推送|体力设置群(推送(开启|关闭)|(阈值|上限)(\\d*)))$",
describe: "体力推送",
},
2022-07-24 11:46:05 +08:00
Note_appoint: {
reg: "^#(体力模板(设置(.*)|列表(.*))|(我的体力模板列表|体力模板移除(.*)))$",
2022-07-24 11:46:05 +08:00
describe: "体力模板设置",
},
2022-07-24 11:46:05 +08:00
pokeNote: {
reg: "#poke#",
describe: "体力",
},
getBasicVoide: {
2022-12-17 18:57:21 +08:00
reg: '#?(动态|幻影)',
describe: "动态",
},
2022-08-16 23:24:54 +08:00
...userRule,
2022-07-29 01:42:35 +08:00
...signRule,
...adminRule,
...topupLoginRule,
...mapRule
2022-07-24 11:46:05 +08:00
};
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")
schedule.scheduleJob(set.mysBbsTime, function () {
2022-10-31 13:57:07 +08:00
if (set.ismysSign) {
signTask('bbs')
2022-08-03 22:56:01 +08:00
}
2022-10-31 13:57:07 +08:00
});
schedule.scheduleJob(set.allSignTime, function () {
2022-08-03 22:56:01 +08:00
if (set.isSign) {
2022-10-12 16:51:51 +08:00
signTask('mys')
2022-08-03 22:56:01 +08:00
}
});
schedule.scheduleJob(set.cloudSignTime, function () {
2022-10-31 13:57:07 +08:00
if (set.isCloudSign) {
2022-10-12 16:51:51 +08:00
signTask('cloud')
}
});
schedule.scheduleJob(set.noteTask, function () {
2022-10-31 13:57:07 +08:00
if (set.isNoteTask) {
DailyNoteTask()
}
});
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
};