2022-06-17 15:10:02 +08:00
|
|
|
import lodash from "lodash";
|
|
|
|
import {
|
2022-06-20 21:43:24 +08:00
|
|
|
AtlasAlias
|
|
|
|
} from "./apps/xiaoyao_image.js";
|
2022-06-23 22:30:41 +08:00
|
|
|
import {
|
|
|
|
versionInfo,
|
2022-06-24 08:06:43 +08:00
|
|
|
help
|
2022-06-23 22:30:41 +08:00
|
|
|
} from "./apps/help.js";
|
2022-06-24 13:33:00 +08:00
|
|
|
|
|
|
|
import common from "../../lib/common.js";
|
2022-06-23 22:30:41 +08:00
|
|
|
import {
|
|
|
|
Note
|
|
|
|
} from "./apps/Note.js"
|
2022-06-17 15:10:02 +08:00
|
|
|
import {
|
|
|
|
rule as adminRule,
|
2022-06-24 22:01:48 +08:00
|
|
|
updateRes,
|
|
|
|
sysCfg,
|
2022-06-17 15:10:02 +08:00
|
|
|
updateMiaoPlugin
|
|
|
|
} from "./apps/admin.js";
|
2022-06-24 22:01:48 +08:00
|
|
|
import {
|
|
|
|
currentVersion
|
|
|
|
} from "./components/Changelog.js";
|
2022-06-17 15:10:02 +08:00
|
|
|
export {
|
2022-06-23 22:30:41 +08:00
|
|
|
updateRes,
|
|
|
|
updateMiaoPlugin,
|
2022-06-24 22:01:48 +08:00
|
|
|
versionInfo,
|
|
|
|
sysCfg,
|
2022-06-24 08:06:43 +08:00
|
|
|
help,
|
2022-06-23 22:30:41 +08:00
|
|
|
AtlasAlias,
|
|
|
|
Note
|
2022-06-17 15:10:02 +08:00
|
|
|
};
|
2022-06-17 14:12:23 +08:00
|
|
|
|
2022-06-17 15:10:02 +08:00
|
|
|
let rule = {
|
|
|
|
versionInfo: {
|
|
|
|
reg: "^#图鉴版本$",
|
2022-06-24 22:01:48 +08:00
|
|
|
describe: "【#帮助】 图鉴版本介绍",
|
2022-06-17 15:10:02 +08:00
|
|
|
},
|
2022-06-24 08:06:43 +08:00
|
|
|
help: {
|
2022-06-24 22:01:48 +08:00
|
|
|
reg: "^#?(图鉴)?(命令|帮助|菜单|help|说明|功能|指令|使用说明)$",
|
2022-06-24 08:06:43 +08:00
|
|
|
describe: "查看插件的功能",
|
2022-06-17 15:10:02 +08:00
|
|
|
},
|
2022-06-23 22:30:41 +08:00
|
|
|
AtlasAlias: {
|
2022-06-24 08:06:43 +08:00
|
|
|
reg: "#*(.*)(信息|图鉴|命座|天赋|突破|材料|特色料理|特殊料理)$",
|
2022-06-24 22:01:48 +08:00
|
|
|
describe: "角色、食物、怪物、武器信息图鉴",
|
2022-06-17 15:10:02 +08:00
|
|
|
},
|
2022-06-23 22:30:41 +08:00
|
|
|
Note: {
|
2022-06-24 08:06:43 +08:00
|
|
|
reg: "^#*(体力|树脂|查询体力|便笺|便签)$",
|
2022-06-23 22:30:41 +08:00
|
|
|
describe: "体力",
|
|
|
|
},
|
2022-06-17 15:10:02 +08:00
|
|
|
...adminRule
|
|
|
|
};
|
2022-06-17 14:12:23 +08:00
|
|
|
|
2022-06-17 15:10:02 +08:00
|
|
|
lodash.forEach(rule, (r) => {
|
|
|
|
r.priority = r.priority || 50;
|
|
|
|
r.prehash = true;
|
|
|
|
r.hashMark = true;
|
|
|
|
});
|
2022-06-17 14:12:23 +08:00
|
|
|
|
2022-06-17 15:10:02 +08:00
|
|
|
export {
|
|
|
|
rule
|
|
|
|
};
|
2022-06-17 14:12:23 +08:00
|
|
|
|
2022-06-24 13:30:03 +08:00
|
|
|
console.log(`图鉴插件${currentVersion}初始化~`);
|
2022-06-24 22:01:48 +08:00
|
|
|
setTimeout(async function() {
|
|
|
|
let msgStr = await redis.get("xiaoyao:restart-msg");
|
|
|
|
if (msgStr) {
|
|
|
|
let msg = JSON.parse(msgStr);
|
|
|
|
await common.relpyPrivate(msg.qq, msg.msg);
|
|
|
|
await redis.del("xiaoyao:restart-msg");
|
|
|
|
let msgs = [`当前版本: ${currentVersion}`, `您可使用 #图鉴版本 命令查看更新信息`];
|
|
|
|
await common.relpyPrivate(msg.qq, msgs.join("\n"));
|
|
|
|
}
|
2022-06-24 08:20:05 +08:00
|
|
|
}, 1000);
|