forked from yoimiya-kokomi/miao-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 若更新成功会重启Yunzai,需要Yunzai以 npm run start 模式启动 * 尚未经充分测试,请有一定容错能力的勇士尝试 * 感谢 @清秋 @碎月 的代码支持
- Loading branch information
1 parent
7880122
commit 9290346
Showing
4 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#1.2.0 | ||
* `#角色面板` 增加伤害计算功能 | ||
* 目前支持角色:雷神、胡桃、魈 | ||
* 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 | ||
* 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 | ||
* `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制 | ||
* 增加 `#喵喵更新` 功能 | ||
* 若更新成功会重启Yunzai,需要Yunzai以 npm run start 模式启动 | ||
* 尚未经充分测试,请有一定容错能力的勇士尝试 | ||
* 感谢 @碎月 @清秋 的代码支持 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import fs from "fs"; | ||
import lodash from "lodash"; | ||
|
||
const _path = process.cwd(); | ||
const _logPath = `${_path}/plugins/miao-plugin/CHANGELOG.md`; | ||
|
||
let logs = {}; | ||
let changelogs = []; | ||
let currentVersion; | ||
let isNew = 1; | ||
let lastVersion = await redis.get("miao:last-version"); | ||
try { | ||
if (fs.existsSync(_logPath)) { | ||
logs = fs.readFileSync(_logPath, "utf8") || ""; | ||
logs = logs.split("\n"); | ||
|
||
|
||
lodash.forEach(logs, (line) => { | ||
if (isNew === -1) { | ||
return false; | ||
} | ||
let versionRet = /^#\s*([0-9\\.]+)\s*$/.exec(line); | ||
if (versionRet && versionRet[1]) { | ||
let v = versionRet[1]; | ||
if (!currentVersion) { | ||
currentVersion = v; | ||
} | ||
if (v === lastVersion) { | ||
isNew = 0; | ||
} else if (isNew === 0) { | ||
isNew = -1; | ||
} | ||
return; | ||
} | ||
if (isNew > -1) { | ||
changelogs.push(line); | ||
} | ||
}); | ||
redis.set("miao:last-version", currentVersion, { EX: 3600 * 24 * 300 }); | ||
} | ||
} catch (e) { | ||
// do nth | ||
} | ||
|
||
export { currentVersion, changelogs }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters