2 Star 3 Fork 0

曉K/spotify-plugin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.js 1004 Bytes
一键复制 编辑 原始数据 按行查看 历史
曉K 提交于 2024-05-02 00:41 . Spotify Out!
import fs from 'node:fs'
import chalk from 'chalk'
if (!global.segment) {
global.segment = (await import('oicq')).segment
}
let ret = []
logger.info(chalk.rgb(32, 212, 100)(`=========QAQ=========`))
logger.info(chalk.rgb(32, 212, 100)(`Spotify插件插件载入成功~awa`))
logger.info(chalk.rgb(32, 212, 100)(`Author - 曉K`))
logger.info(chalk.rgb(32, 212, 100)(`我的原神群285258025,欢迎来玩~`))
logger.info(chalk.rgb(32, 212, 100)(`=====================`));
const files = fs
.readdirSync('./plugins/spotify-plugin/apps')
.filter((file) => file.endsWith('.js'))
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/SmallK111407/spotify-plugin.git
git@gitee.com:SmallK111407/spotify-plugin.git
SmallK111407
spotify-plugin
spotify-plugin
main

搜索帮助