修正获取原图列表无法屏蔽的bug

This commit is contained in:
Kokomi 2023-03-09 05:29:30 +08:00
parent 822f619bf2
commit 3749002d1e
9 changed files with 51 additions and 46 deletions

View File

@ -14,11 +14,11 @@ Miao-Plugin 是一个 Yunzai-Bot 的升级插件,提供包括角色查询等
``` ```
// 使用gitee // 使用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 pnpm install -P
// 使用github // 使用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 pnpm install -P
``` ```

View File

@ -208,6 +208,7 @@ export async function profileImgList (e) {
} }
if ([1, 0].includes(Cfg.get('originalPic') * 1)) { if ([1, 0].includes(Cfg.get('originalPic') * 1)) {
e.reply('已禁止获取面板图列表') e.reply('已禁止获取面板图列表')
return true
} }
let nickname = Bot.nickname let nickname = Bot.nickname
if (e.isGroup) { if (e.isGroup) {

View File

@ -78,7 +78,7 @@ const ProfileChange = {
type type
} }
}) })
} else if (keyRet[4] !== '武器') { } else if (keyRet[4] !== '武器' && keyRet[4] !== '花') {
return true return true
} }
} }

View File

@ -1,10 +1,10 @@
import Cfg from './Cfg.js' import Cfg from './Cfg.js'
import render from './common/Render.js' import Render from './common/Render.js'
import { Version } from './index.js' import { Version } from './index.js'
import lodash from 'lodash' import lodash from 'lodash'
const Common = { const Common = {
render, render: Render.render,
cfg: Cfg.get, cfg: Cfg.get,
sleep (ms) { sleep (ms) {
return new Promise((resolve) => setTimeout(resolve, ms)) return new Promise((resolve) => setTimeout(resolve, ms))

View File

@ -1,32 +1,36 @@
import { Version } from '../index.js' import { Version, Cfg } from '#miao'
import Cfg from '../Cfg.js'
export default async function (path, params, cfg) { const Render = {
let { e } = cfg async render (path, params, cfg) {
if (!e.runtime) { let { e } = cfg
console.log('未找到e.runtime请升级至最新版Yunzai') if (!e.runtime) {
} console.log('未找到e.runtime请升级至最新版Yunzai')
let BotName = Version.isMiao ? 'Miao-Yunzai' : 'Yunzai-Bot' }
return e.runtime.render('miao-plugin', path, params, { let BotName = Version.isMiao ? 'Miao-Yunzai' : 'Yunzai-Bot'
retType: cfg.retMsgId ? 'msgId' : 'default', return e.runtime.render('miao-plugin', path, params, {
beforeRender ({ data }) { retType: cfg.retMsgId ? 'msgId' : 'default',
let resPath = data.pluResPath beforeRender ({ data }) {
const layoutPath = process.cwd() + '/plugins/miao-plugin/resources/common/layout/' let resPath = data.pluResPath
return { const layoutPath = process.cwd() + '/plugins/miao-plugin/resources/common/layout/'
...data, return {
_res_path: resPath, ...data,
_layout_path: layoutPath, _res_path: resPath,
_tpl_path: process.cwd() + '/plugins/miao-plugin/resources/common/tpl/', _miao_path: resPath,
defaultLayout: layoutPath + 'default.html', _layout_path: layoutPath,
elemLayout: layoutPath + 'elem.html', _tpl_path: process.cwd() + '/plugins/miao-plugin/resources/common/tpl/',
sys: { defaultLayout: layoutPath + 'default.html',
scale: Cfg.scale(cfg.scale || 1), elemLayout: layoutPath + 'elem.html',
copyright: `Created By ${BotName}<span class="version">${Version.yunzai}</span> & Miao-Plugin<span class="version">${Version.version}</span>` sys: {
}, scale: Cfg.scale(cfg.scale || 1)
pageGotoParams: { },
waitUntil: 'networkidle2' copyright: `Created By ${BotName}<span class="version">${Version.yunzai}</span> & Miao-Plugin<span class="version">${Version.version}</span>`,
pageGotoParams: {
waitUntil: 'networkidle2'
}
} }
} }
} })
}) }
} }
export default Render

View File

@ -76,7 +76,7 @@
<div class="cont-title">角色列表</div> <div class="cont-title">角色列表</div>
<div class="avatar-list"> <div class="avatar-list">
{{each avatars avatar idx}} {{each avatars avatar idx}}
<% include(_layout_path+'../tpl/avatar-card.html', [avatar,{_res_path, cardType:'mini'}]) %> <% include(_tpl_path+'/avatar-card.html', [avatar,{_res_path, cardType:'mini'}]) %>
{{/each}} {{/each}}
</div> </div>
<div class="cont-footer cont-notice"> <div class="cont-footer cont-notice">

View File

@ -4,18 +4,18 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="#"/> <link rel="shortcut icon" href="#"/>
<link rel="preload" href="{{_res_path}}common/font/HYWH-65W.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/HYWH-65W.woff" as="font" type="font/woff">
<link rel="preload" href="{{_res_path}}common/font/NZBZ.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/NZBZ.woff" as="font" type="font/woff">
<link rel="preload" href="{{_res_path}}common/font/tttgbnumber.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/tttgbnumber.woff" as="font" type="font/woff">
<link rel="stylesheet" type="text/css" href="{{_res_path}}common/common.css"/> <link rel="stylesheet" type="text/css" href="{{_miao_path}}common/common.css"/>
<title>miao-plugin</title> <title>miao-plugin</title>
{{block 'css'}} {{block 'css'}}
{{/block}} {{/block}}
</head> </head>
<body class="elem-{{element||elem||`hydro`}} {{displayMode || mode || `default`}}-mode {{bodyClass}}" {{sys.scale}}> <body class="elem-{{element||elem||`hydro`}} {{displayMode || mode || `default`}}-mode {{bodyClass}}" {{sys.scale}}>
<div class="container" id="container"> <div class="container" id="container">
{{block 'main'}}{{/block}} {{block 'main'}}{{/block}}
<div class="copyright">{{@sys.copyright}}</div> <div class="copyright">{{@copyright || sys?.copyright}}</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -4,10 +4,10 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width"> <meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="#"/> <link rel="shortcut icon" href="#"/>
<link rel="preload" href="{{_res_path}}common/font/HYWH-65W.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/HYWH-65W.woff" as="font" type="font/woff">
<link rel="preload" href="{{_res_path}}common/font/NZBZ.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/NZBZ.woff" as="font" type="font/woff">
<link rel="preload" href="{{_res_path}}common/font/tttgbnumber.woff" as="font" type="font/woff"> <link rel="preload" href="{{_miao_path}}common/font/tttgbnumber.woff" as="font" type="font/woff">
<link rel="stylesheet" type="text/css" href="{{_res_path}}common/common.css"/> <link rel="stylesheet" type="text/css" href="{{_miao_path}}common/common.css"/>
<title>miao-plugin</title> <title>miao-plugin</title>
{{block 'css'}} {{block 'css'}}
{{/block}} {{/block}}
@ -15,7 +15,7 @@
<body class="elem-{{element||elem||`hydro`}} {{displayMode || mode || `default`}}-mode {{bodyClass}}" {{sys.scale}}> <body class="elem-{{element||elem||`hydro`}} {{displayMode || mode || `default`}}-mode {{bodyClass}}" {{sys.scale}}>
<div class="container elem-bg" id="container"> <div class="container elem-bg" id="container">
{{block 'main'}}{{/block}} {{block 'main'}}{{/block}}
<div class="copyright">{{@sys.copyright}}</div> <div class="copyright">{{@copyright || sys?.copyright}}</div>
</div> </div>
</body> </body>
</html> </html>

View File

@ -58,7 +58,7 @@
<div class="abyss-team"> <div class="abyss-team">
{{set ds=floor?.display?.up?.avatars||[] }} {{set ds=floor?.display?.up?.avatars||[] }}
{{each ds id idx}} {{each ds id idx}}
<% include(_layout_path+'../tpl/avatar-card.html', [avatars[id],{_res_path, cardType:cardTypes[ds.length][idx]}]) %> <% include(_tpl_path+'/avatar-card.html', [avatars[id],{_res_path, cardType:cardTypes[ds.length][idx]}]) %>
{{/each}} {{/each}}
</div> </div>
<div class="line"></div> <div class="line"></div>