1 Star 14 Fork 5

湛蓝科技/xiaoyue-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.js 884 Bytes
一键复制 编辑 原始数据 按行查看 历史
湛蓝科技 提交于 2023-07-24 19:26 . 有缘再见
import fs from 'node:fs'
import Ver from './components/Version.js'
import chalk from 'chalk'
const files = fs.readdirSync('./plugins/xiaoyue-plugin/apps').filter(file => file.endsWith('.js'))
let ret = []
logger.info(chalk.cyan('--------\(≧▽≦)/--------'))
logger.info(chalk.yellow(`小月插件${Ver.ver}初始化~`))
logger.info(chalk.magenta('-------------------------'))
files.forEach((file) => {
ret.push(import(`./apps/${file}`))
})
ret = await Promise.allSettled(ret)
let apps = {}
for (let i in files) {
let name = files[i].replace('.js', '')
if (ret[i].status != 'fulfilled') {
logger.error(`载入插件错误:${logger.red(name)}`)
logger.error(ret[i].reason)
continue
}
apps[name] = ret[i].value[Object.keys(ret[i].value)[0]]
}
if (!global.segment) {
let OICQ = await import("oicq")
global.segment = OICQ.segment
}
export { apps }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bule-Tech/xiaoyue-plugin.git
git@gitee.com:bule-Tech/xiaoyue-plugin.git
bule-Tech
xiaoyue-plugin
xiaoyue-plugin
master

搜索帮助