代码拉取完成,页面将自动刷新
import fs from 'node:fs'
import chalk from 'chalk'
import { Config } from './utils/config.js'
if (!global.segment) {
global.segment = (await import('oicq')).segment
}
const files = fs.readdirSync('./plugins/hanhan-plugin/apps').filter(file => file.endsWith('.js'))
let ret = []
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]]
}
logger.info(`${chalk.redBright.bold('********************[')}${chalk.cyan.bold('hanhan')}${chalk.redBright.bold(']********************')}`)
logger.info(`${chalk.blue.bold('han')}${chalk.redBright.bold('han')}${chalk.gray.bold('-')}${chalk.cyan.bold('plugin')}${chalk.whiteBright.bold('加载')}${chalk.greenBright.bold('成功')}`)
logger.info(chalk.green.bold(' ▃▆█▇▄▖'))
logger.info(chalk.green.bold(' ▟◤▖ ◥█▎'))
logger.info(chalk.green.bold(' ◢◤ ▐ ▐▉'))
logger.info(chalk.green.bold(' ▗◤ ▂ ▗▖ ▕█▎'))
logger.info(chalk.green.bold(' ◤ ▗▅▖◥▄ ▀◣ █▊'))
logger.info(chalk.green.bold('▐ ▕▎◥▖◣◤ ◢██'))
logger.info(chalk.green.bold('█◣ ◥▅█▀ ▐██◤'))
logger.info(chalk.green.bold('▐█▙▂ ◢██◤'))
logger.info(chalk.green.bold('◥██◣ ◢▄◤'))
logger.info(chalk.green.bold(' ▀██▅▇▀'))
logger.info(chalk.green.bold(`当前版本 v${Config.version}`))
logger.info(`${chalk.cyan.italic('仓库地址')} ${chalk.yellowBright.underline('https://github.com/hanhan258/hanhan-plugin')}`)
logger.info(`${chalk.redBright.bold('********************[')}${chalk.cyan.bold('///^///')}${chalk.redBright.bold(']********************')}`)
export { apps }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。