mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 09:27:34 +00:00
7939de8291
* 可展示本期深渊的全部角色信息,包括组队、天赋及圣遗物 * 数据会上传至胡桃Api进行伤害排名,并展示在页面内 * 可在`#喵喵设置`中启用`#喵喵深渊`作为默认深渊功能,默认关闭
47 lines
1.3 KiB
JavaScript
47 lines
1.3 KiB
JavaScript
import { Cfg } from './index.js'
|
|
import { segment } from 'oicq'
|
|
import { currentVersion, yunzaiVersion, isV3 } from './Changelog.js'
|
|
|
|
export const render = async function (path, params, cfg) {
|
|
let paths = path.split('/')
|
|
let { render, e } = cfg
|
|
let layoutPath = process.cwd() + '/plugins/miao-plugin/resources/common/layout/'
|
|
let base64 = await render(paths[0], paths[1], {
|
|
...params,
|
|
_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 Yunzai-Bot<span class="version">${yunzaiVersion}</span> & Miao-Plugin<span class="version">${currentVersion}</span>`
|
|
}
|
|
})
|
|
|
|
let ret = true
|
|
if (base64) {
|
|
ret = isV3 ? await e.reply(base64) : await e.reply(segment.image(`base64://${base64}`))
|
|
}
|
|
return cfg.retMsgId ? ret : true
|
|
}
|
|
|
|
export const todoV3 = function (e) {
|
|
if (isV3) {
|
|
e.reply('本功能暂时不支持V3版Yunzai...')
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
function sleep (ms) {
|
|
return new Promise((resolve) => setTimeout(resolve, ms))
|
|
}
|
|
|
|
export default {
|
|
render,
|
|
cfg: Cfg.get,
|
|
isDisable: Cfg.isDisable,
|
|
todoV3,
|
|
sleep
|
|
}
|