2022-07-24 11:46:05 +08:00
|
|
|
|
// 适配V3 Yunzai,将index.js移至app/index.js
|
2022-07-26 08:46:36 +08:00
|
|
|
|
import {
|
|
|
|
|
currentVersion,
|
|
|
|
|
isV3
|
|
|
|
|
} from './components/Changelog.js'
|
2022-07-24 11:46:05 +08:00
|
|
|
|
import Data from './components/Data.js'
|
2022-06-24 13:33:00 +08:00
|
|
|
|
|
2023-03-22 19:27:50 +08:00
|
|
|
|
if (!global.segment) {
|
|
|
|
|
global.segment = (await import("oicq")).segment
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-24 11:46:05 +08:00
|
|
|
|
export * from './apps/index.js'
|
2022-07-26 08:46:36 +08:00
|
|
|
|
let index = {
|
|
|
|
|
atlas: {}
|
|
|
|
|
}
|
2022-07-24 11:46:05 +08:00
|
|
|
|
if (isV3) {
|
2022-09-26 23:17:54 +08:00
|
|
|
|
Bot.logger=logger
|
2022-07-26 08:46:36 +08:00
|
|
|
|
index = await Data.importModule('/plugins/xiaoyao-cvs-plugin/adapter', 'index.js')
|
2022-07-24 11:46:05 +08:00
|
|
|
|
}
|
|
|
|
|
export const atlas = index.atlas || {}
|
2022-08-02 20:20:34 +08:00
|
|
|
|
Bot.logger.info(`---------^_^---------`)
|
2022-07-28 20:44:26 +08:00
|
|
|
|
Bot.logger.info(`图鉴插件${currentVersion}初始化~`)
|
2022-06-17 14:12:23 +08:00
|
|
|
|
|
2022-07-26 08:46:36 +08:00
|
|
|
|
setTimeout(async function() {
|
|
|
|
|
let msgStr = await redis.get('xiaoyao:restart-msg')
|
|
|
|
|
let relpyPrivate = async function() {}
|
|
|
|
|
if (!isV3) {
|
|
|
|
|
let common = await Data.importModule('/lib', 'common.js')
|
|
|
|
|
if (common && common.default && common.default.relpyPrivate) {
|
|
|
|
|
relpyPrivate = common.default.relpyPrivate
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (msgStr) {
|
|
|
|
|
let msg = JSON.parse(msgStr)
|
|
|
|
|
await relpyPrivate(msg.qq, msg.msg)
|
|
|
|
|
await redis.del('xiaoyao:restart-msg')
|
|
|
|
|
let msgs = [`当前图鉴版本: ${currentVersion}`, '您可使用 #图鉴版本 命令查看更新信息']
|
|
|
|
|
await relpyPrivate(msg.qq, msgs.join('\n'))
|
|
|
|
|
}
|
2022-07-24 11:46:05 +08:00
|
|
|
|
}, 1000)
|