Files
yenai-plugin/apps/admin.js
2022-10-16 17:14:47 +08:00

48 lines
1.2 KiB
JavaScript

import plugin from '../../../lib/plugins/plugin.js'
import { update } from '../../other/update.js'
import { Version, Common, Plugin_Name } from '../components/index.js'
export class admin extends plugin {
constructor() {
super({
name: "版本信息",
event: "message",
priority: 400,
rule: [
{
reg: '^#?椰奶(插件)?版本$',
fnc: 'plugin_version',
},
{
reg: '^#?椰奶(插件)?更新日志$',
fnc: 'update_log',
},
],
});
this.key = "yenai:restart";
}
async plugin_version() {
return versionInfo(this.e);
}
async update_log() {
let Update_Plugin = new update();
Update_Plugin.e = this.e;
Update_Plugin.reply = this.reply;
if (Update_Plugin.getPlugin(Plugin_Name)) {
this.e.reply(await Update_Plugin.getLog(Plugin_Name));
}
return true;
}
}
async function versionInfo(e) {
return await Common.render('help/version-info', {
currentVersion: Version.ver,
changelogs: Version.logs,
elem: 'cryo'
}, { e, scale: 1.2 })
}