代码拉取完成,页面将自动刷新
import lodash from "lodash"
import { common, Data } from "#components"
import Theme from "../model/help/theme.js"
export class help extends plugin {
constructor() {
super({
name: "DF:帮助",
dsc: "DF插件命令帮助",
event: "message",
priority: 2000,
rule: [
{
reg: "^#?[Dd][Ff](插件)?帮助$",
fnc: "help"
}
]
})
}
async help(e) {
let custom = {}
let help = {}
let { diyCfg, sysCfg } = await Data.importCfg("help")
custom = help
let helpConfig = lodash.defaults(diyCfg.helpCfg || {}, custom.helpCfg, sysCfg.helpCfg)
let helpList = diyCfg.helpList || custom.helpList || sysCfg.helpList
let helpGroup = []
lodash.forEach(helpList, (group) => {
if (group.auth && group.auth === "master" && !e.isMaster) {
return true
}
lodash.forEach(group.list, (help) => {
let icon = help.icon * 1
if (!icon) {
help.css = "display:none"
} else {
let x = (icon - 1) % 10
let y = (icon - x - 1) / 10
help.css = `background-position:-${x * 50}px -${y * 50}px`
}
})
helpGroup.push(group)
})
let themeData = await Theme.getThemeData(diyCfg.helpCfg || {}, sysCfg.helpCfg || {})
return await common.render("help/index", {
helpCfg: helpConfig,
helpGroup,
...themeData
}, { e, scale: 1.6 })
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。