miao-plugin/components/Common.js
yoimiya-kokomi 658217ee8f * #喵喵设置 支持设置 面板查询 的功能开关
* `#喵喵版本` 使用图片展示更新信息
* 页面版权信息展示Yunzai及喵喵版本号
* `#角色面板` 伤害计算增加 迪奥娜ⁿᵉʷ、安柏ⁿᵉʷ、凯亚ⁿᵉʷ
2022-05-22 21:10:10 +08:00

32 lines
883 B
JavaScript

import { Cfg } from "./index.js";
import { segment } from "oicq";
import { currentVersion, yunzaiVersion } from "./Changelog.js";
export const render = async function (path, params, cfg) {
let paths = path.split("/");
let { render, e } = cfg;
let _layout_path = process.cwd() + "/plugins/miao-plugin/resources/common/layout/";
let base64 = await render(paths[0], paths[1], {
...params,
_layout_path,
defaultLayout: _layout_path + "default.html",
elemLayout: _layout_path + "elem.html",
sys: {
scale: Cfg.scale(cfg.scale || 1),
copyright: `Created By Yunzai-Bot<span class="version">${yunzaiVersion}</span> & Miao-Plugin<span class="version">${currentVersion}</span>`
}
});
if (base64) {
e.reply(segment.image(`base64://${base64}`));
}
return true;
}
export default {
render,
cfg: Cfg.get,
isDisable: Cfg.isDisable
};