diff --git a/README.md b/README.md index 4b6c7af3..f1d730a2 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,11 @@ Miao-Plugin 是一个 Yunzai-Bot 的升级插件,提供包括角色查询等 ``` // 使用gitee -git clone https://gitee.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/ +git clone --depth=1 https://gitee.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/ pnpm install -P // 使用github -git clone https://github.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/ +git clone --depth=1 https://github.com/yoimiya-kokomi/miao-plugin.git ./plugins/miao-plugin/ pnpm install -P ``` diff --git a/apps/character/ImgUpload.js b/apps/character/ImgUpload.js index 7e72c166..abd0b9dc 100644 --- a/apps/character/ImgUpload.js +++ b/apps/character/ImgUpload.js @@ -208,6 +208,7 @@ export async function profileImgList (e) { } if ([1, 0].includes(Cfg.get('originalPic') * 1)) { e.reply('已禁止获取面板图列表') + return true } let nickname = Bot.nickname if (e.isGroup) { diff --git a/apps/profile/ProfileChange.js b/apps/profile/ProfileChange.js index b8da18f4..66b3b8d7 100644 --- a/apps/profile/ProfileChange.js +++ b/apps/profile/ProfileChange.js @@ -78,7 +78,7 @@ const ProfileChange = { type } }) - } else if (keyRet[4] !== '武器') { + } else if (keyRet[4] !== '武器' && keyRet[4] !== '花') { return true } } diff --git a/components/Common.js b/components/Common.js index 93a42496..2b243358 100644 --- a/components/Common.js +++ b/components/Common.js @@ -1,10 +1,10 @@ import Cfg from './Cfg.js' -import render from './common/Render.js' +import Render from './common/Render.js' import { Version } from './index.js' import lodash from 'lodash' const Common = { - render, + render: Render.render, cfg: Cfg.get, sleep (ms) { return new Promise((resolve) => setTimeout(resolve, ms)) diff --git a/components/common/Render.js b/components/common/Render.js index dfdeb726..b3fb330e 100644 --- a/components/common/Render.js +++ b/components/common/Render.js @@ -1,32 +1,36 @@ -import { Version } from '../index.js' -import Cfg from '../Cfg.js' +import { Version, Cfg } from '#miao' -export default async function (path, params, cfg) { - let { e } = cfg - if (!e.runtime) { - console.log('未找到e.runtime,请升级至最新版Yunzai') - } - let BotName = Version.isMiao ? 'Miao-Yunzai' : 'Yunzai-Bot' - return e.runtime.render('miao-plugin', path, params, { - retType: cfg.retMsgId ? 'msgId' : 'default', - beforeRender ({ data }) { - let resPath = data.pluResPath - const layoutPath = process.cwd() + '/plugins/miao-plugin/resources/common/layout/' - return { - ...data, - _res_path: resPath, - _layout_path: layoutPath, - _tpl_path: process.cwd() + '/plugins/miao-plugin/resources/common/tpl/', - defaultLayout: layoutPath + 'default.html', - elemLayout: layoutPath + 'elem.html', - sys: { - scale: Cfg.scale(cfg.scale || 1), - copyright: `Created By ${BotName}${Version.yunzai} & Miao-Plugin${Version.version}` - }, - pageGotoParams: { - waitUntil: 'networkidle2' +const Render = { + async render (path, params, cfg) { + let { e } = cfg + if (!e.runtime) { + console.log('未找到e.runtime,请升级至最新版Yunzai') + } + let BotName = Version.isMiao ? 'Miao-Yunzai' : 'Yunzai-Bot' + return e.runtime.render('miao-plugin', path, params, { + retType: cfg.retMsgId ? 'msgId' : 'default', + beforeRender ({ data }) { + let resPath = data.pluResPath + const layoutPath = process.cwd() + '/plugins/miao-plugin/resources/common/layout/' + return { + ...data, + _res_path: resPath, + _miao_path: resPath, + _layout_path: layoutPath, + _tpl_path: process.cwd() + '/plugins/miao-plugin/resources/common/tpl/', + defaultLayout: layoutPath + 'default.html', + elemLayout: layoutPath + 'elem.html', + sys: { + scale: Cfg.scale(cfg.scale || 1) + }, + copyright: `Created By ${BotName}${Version.yunzai} & Miao-Plugin${Version.version}`, + pageGotoParams: { + waitUntil: 'networkidle2' + } } } - } - }) + }) + } } + +export default Render \ No newline at end of file diff --git a/resources/character/avatar-list.html b/resources/character/avatar-list.html index 072ed297..a98b2e95 100644 --- a/resources/character/avatar-list.html +++ b/resources/character/avatar-list.html @@ -76,7 +76,7 @@