miao-plugin/index.js
2022-07-25 05:11:19 +08:00

32 lines
998 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 适配V3 Yunzai将index.js移至app/index.js
import { currentVersion, isV3 } from './components/Changelog.js'
import Data from './components/Data.js'
export * from './apps/index.js'
let index = { miao: {} }
if (isV3) {
index = await Data.importModule('/plugins/miao-plugin/adapter', 'index.js')
}
export const miao = index.miao || {}
console.log(`喵喵插件${currentVersion}初始化~`)
setTimeout(async function () {
let msgStr = await redis.get('miao:restart-msg')
let relpyPrivate = async function () {
}
if (!isV3) {
let common = await Data.importModule('/lib', 'common.js')
if (common && common.relpyPrivate) {
relpyPrivate = common.relpyPrivate
}
}
if (msgStr) {
let msg = JSON.parse(msgStr)
await relpyPrivate(msg.qq, msg.msg)
await redis.del('miao:restart-msg')
let msgs = [`当前喵喵版本: ${currentVersion}`, '您可使用 #喵喵版本 命令查看更新信息']
await relpyPrivate(msg.qq, msgs.join('\n'))
}
}, 1000)