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 {
|
2022-12-17 18:29:18 +08:00
|
|
|
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 {
|
|
|
|
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,
|
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,
|
2022-12-17 18:29:18 +08:00
|
|
|
sysCfg, updateTemp,
|
2022-07-24 11:46:05 +08:00
|
|
|
updateMiaoPlugin
|
|
|
|
} from "./admin.js";
|
2023-01-14 00:29:14 +08:00
|
|
|
|
2022-08-16 23:24:54 +08:00
|
|
|
import {
|
2022-10-31 13:57:07 +08:00
|
|
|
rule as userRule,
|
|
|
|
delSign,
|
|
|
|
updCookie,
|
|
|
|
userInfo,
|
|
|
|
gclog,
|
2022-12-17 18:29:18 +08:00
|
|
|
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"
|
2023-01-14 00:29:14 +08:00
|
|
|
import {
|
|
|
|
rule as topupLoginRule,
|
|
|
|
qrCodeLogin,UserPassMsg,UserPassLogin,
|
|
|
|
} from './mhyTopUpLogin.js'
|
2022-07-24 11:46:05 +08:00
|
|
|
export {
|
2022-12-17 18:29:18 +08:00
|
|
|
updateRes, updateTemp,
|
|
|
|
delSign, gcPaylog,
|
2023-01-14 00:29:14 +08:00
|
|
|
cloudSign,qrCodeLogin,
|
2022-12-17 18:29:18 +08:00
|
|
|
seach, bindLogin_ticket,
|
2023-01-14 00:29:14 +08:00
|
|
|
bbsSign,UserPassMsg,UserPassLogin,
|
2022-10-31 13:57:07 +08:00
|
|
|
gclog,
|
2022-12-17 18:29:18 +08:00
|
|
|
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: {
|
2022-11-09 00:10:43 +08:00
|
|
|
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: {
|
2022-11-09 00:10:43 +08:00
|
|
|
reg: "^#(体力模板(设置(.*)|列表(.*))|(我的体力模板列表|体力模板移除(.*)))$",
|
2022-07-24 11:46:05 +08:00
|
|
|
describe: "体力模板设置",
|
|
|
|
},
|
2022-10-31 13:57:07 +08:00
|
|
|
genShenMap: {
|
|
|
|
reg: "^#(.*)(在(哪|那)里*)$",
|
2022-10-19 07:05:20 +08:00
|
|
|
describe: "地图资源查询 #**在哪里",
|
|
|
|
},
|
2022-07-24 11:46:05 +08:00
|
|
|
pokeNote: {
|
|
|
|
reg: "#poke#",
|
|
|
|
describe: "体力",
|
|
|
|
},
|
2022-12-17 18:29:18 +08:00
|
|
|
getBasicVoide: {
|
2022-12-17 18:57:21 +08:00
|
|
|
reg: '#?(动态|幻影)',
|
2022-12-17 18:29:18 +08:00
|
|
|
describe: "动态",
|
|
|
|
},
|
2022-08-16 23:24:54 +08:00
|
|
|
...userRule,
|
2022-07-29 01:42:35 +08:00
|
|
|
...signRule,
|
2023-01-14 00:29:14 +08:00
|
|
|
...adminRule,
|
|
|
|
...topupLoginRule
|
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")
|
2022-12-17 18:29:18 +08:00
|
|
|
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
|
|
|
});
|
2022-12-17 18:29:18 +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
|
|
|
}
|
|
|
|
});
|
2022-12-17 18:29:18 +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')
|
2022-08-06 22:43:54 +08:00
|
|
|
}
|
|
|
|
});
|
2022-12-17 18:29:18 +08:00
|
|
|
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
|
|
|
};
|