适配segment作为全局变量

This commit is contained in:
yeyang
2023-03-22 13:13:20 +08:00
parent 2b2e99ccaa
commit fbec3d84fd
21 changed files with 25 additions and 21 deletions

View File

@@ -13,6 +13,14 @@ files.forEach((file) => {
ret.push(import(`./apps/${file}`))
})
if (!global.segment) {
try {
global.segment = (await import('oicq')).segment
} catch (err) {
global.segment = (await import('icqq')).segment
}
}
ret = await Promise.allSettled(ret)
let apps = {}