From 18186fd75f66529ff7bd1279f4655a5299ae735a Mon Sep 17 00:00:00 2001 From: yoimiya-kokomi <592981798@qq.com> Date: Wed, 27 Apr 2022 03:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0#=E5=96=B5=E5=96=B5=E7=89=88?= =?UTF-8?q?=E6=9C=AC=20=E6=9F=A5=E8=AF=A2=E5=BD=93=E5=89=8D=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E4=BB=8B=E7=BB=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 16 +++++++++------- apps/help.js | 9 ++++++++- index.js | 21 +++++++++++++++++++-- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5610c7bb..dfe315fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ -#1.2.0 +# 1.2.0 + * `#角色面板` 增加伤害计算功能 - * 目前支持角色:雷神、胡桃、魈、神子、甘雨 - * 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 - * 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 + * 目前支持角色:雷神、胡桃、魈、神子、甘雨 + * 可通过 `#怪物等级85` 命令设定怪物等级,以获得更准确的计算结果 + * 计算伤害为满Buff情况,后续会出更详细的Buff及计算展示 * `#获取游戏角色详情`命令在服务侧增加基于UID的天频度限制 * 增加 `#喵喵更新` 功能 - * 若更新成功会重启Yunzai,需要Yunzai以 npm run start 模式启动 - * 尚未经充分测试,请有一定容错能力的勇士尝试 - * 感谢 @碎月 @清秋 的代码支持 \ No newline at end of file + * 感谢 @碎月 @清秋 的代码支持 + * 若更新成功会重启Yunzai,需要Yunzai以 npm run start 模式启动 + * 尚未经充分测试,请有一定容错能力的勇士尝试 + * 增加`#喵喵版本`命令查询版本信息 diff --git a/apps/help.js b/apps/help.js index a4122d4f..64a5b356 100644 --- a/apps/help.js +++ b/apps/help.js @@ -1,7 +1,8 @@ -import { Character } from "../components/models.js"; import { Cfg } from "../components/index.js"; import { segment } from "oicq"; import lodash from "lodash"; +import { currentVersion, changelogs } from "../components/Changelog.js"; +import common from "../../../lib/common.js"; const _path = process.cwd(); const helpFilePath = `${_path}/plugins/miao-plugin/resources/help/help-list.js`; @@ -46,4 +47,10 @@ export async function help(e, { render }) { e.reply(segment.image(`base64://${base64}`)); } return true; +} + +export async function versionInfo(e) { + let msgs = [`当前喵喵版本: ${currentVersion}`, ...changelogs]; + e.reply(msgs.join("\n")); + return true; } \ No newline at end of file diff --git a/index.js b/index.js index b4aa9cdc..bae422d0 100644 --- a/index.js +++ b/index.js @@ -1,13 +1,26 @@ import { character, getProfile, wife, wifeReg, enemyLv } from "./apps/character.js"; import { consStat, abyssPct } from "./apps/stat.js"; import { wiki } from "./apps/wiki.js"; -import { help } from "./apps/help.js"; +import { help, versionInfo } from "./apps/help.js"; import lodash from "lodash"; import common from "../../lib/common.js"; import { rule as adminRule, updateRes, sysCfg, updateMiaoPlugin } from "./apps/admin.js"; import { currentVersion, changelogs } from "./components/Changelog.js"; -export { character, wife, consStat, abyssPct, wiki, updateRes, updateMiaoPlugin, sysCfg, help, getProfile, enemyLv }; +export { + character, + wife, + consStat, + abyssPct, + wiki, + updateRes, + updateMiaoPlugin, + sysCfg, + help, + versionInfo, + getProfile, + enemyLv +}; let rule = { @@ -43,6 +56,10 @@ let rule = { reg: "^#敌人等级\\s*\\d{1,3}\\s*$", describe: "【#角色】 设置伤害计算中目标敌人的等级", }, + versionInfo: { + reg: "#喵喵版本", + describe: "【#帮助】 喵喵版本介绍", + }, ...adminRule };