1 Star 0 Fork 28

萌萌哒唉/StarRail-plugin

forked from 鹤望兰/StarRail-plugin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.js 987 Bytes
一键复制 编辑 原始数据 按行查看 历史
鹤望兰 提交于 2023-05-10 14:34 . add: 加个自己的名字(诶嘿
import fs from 'node:fs'
if (!global.segment) {
global.segment = (await import("oicq")).segment
}
if (!global.core) {
try {
global.core = (await import("oicq")).core
} catch (err) {}
}
const files = fs.readdirSync('./plugins/StarRail-plugin/apps').filter(file => file.endsWith('.js'))
let ret = []
logger.info('------(ˊ·ω·ˋ)------')
logger.info('StarRail-plugin载入成功!')
logger.info('仓库地址 https://gitee.com/hewang1an/StarRail-plugin')
logger.info('插件群号: 758447726')
logger.info('Created By 鹤望兰')
logger.info('-------------------')
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]]
}
export { apps }
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mengxiaotuan/StarRail-plugin.git
git@gitee.com:mengxiaotuan/StarRail-plugin.git
mengxiaotuan
StarRail-plugin
StarRail-plugin
main

搜索帮助