mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
优化更新信息的展示
This commit is contained in:
parent
7c7e3d6033
commit
054f84ff7d
10
CHANGELOG.md
10
CHANGELOG.md
@ -1,10 +1,14 @@
|
||||
# 1.2.1
|
||||
|
||||
* `#角色面板` 增加伤害计算功能
|
||||
* 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子
|
||||
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果
|
||||
* 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示
|
||||
* 目前支持角色:雷神、胡桃、魈、神子、甘雨、宵宫、公子
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* `#角色面板` 增加伤害计算功能
|
||||
* 目前支持角色:雷神、胡桃、魈、神子、甘雨
|
||||
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果
|
||||
* 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示
|
||||
* `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制
|
||||
* 增加 `#喵喵更新` 功能
|
||||
* 感谢 @碎月 @清秋 的代码支持
|
||||
|
@ -7,26 +7,35 @@ const _logPath = `${_path}/plugins/miao-plugin/CHANGELOG.md`;
|
||||
let logs = {};
|
||||
let changelogs = [];
|
||||
let currentVersion;
|
||||
let isNew = 1;
|
||||
let versionCount = 2;
|
||||
try {
|
||||
if (fs.existsSync(_logPath)) {
|
||||
logs = fs.readFileSync(_logPath, "utf8") || "";
|
||||
logs = logs.split("\n");
|
||||
lodash.forEach(logs, (line) => {
|
||||
if (isNew === -1) {
|
||||
if (versionCount === -1) {
|
||||
return false;
|
||||
}
|
||||
let versionRet = /^#\s*([0-9\\.]+)\s*$/.exec(line);
|
||||
if (versionRet && versionRet[1]) {
|
||||
let v = versionRet[1];
|
||||
|
||||
|
||||
if (!currentVersion) {
|
||||
currentVersion = v;
|
||||
}
|
||||
isNew--;
|
||||
versionCount--;
|
||||
versionCount === 0 && changelogs.push(" ");
|
||||
versionCount > -1 && changelogs.push(`【 版本: ${v} 】`)
|
||||
|
||||
return;
|
||||
}
|
||||
if (isNew > -1) {
|
||||
changelogs.push(line);
|
||||
if (versionCount > -1) {
|
||||
line = line.trim();
|
||||
line = line.replace(/`/g, "");
|
||||
if (line) {
|
||||
changelogs.push(line);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user