当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
4 Star 11 Fork 1

Wangsheng Funeral Parlor/萝莉
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.js 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
touchscale 提交于 2023-12-10 18:16 +08:00 . update index.js.
import fs from 'node:fs';
import Config from './model/Config.js'; //引入获取配置的js
import chalk from 'chalk';
if (!global.segment) {
global.segment = (await import('icqq')).segment;
}
const _path = './plugins/xiuxian-emulator-plugin'
//定义一个版本信息的常量,获取默认文件配置文件信息
const versionData = Config.getdefSet('version');
//打印启动日志
logger.info(chalk.cyan('-----------(∗❛ั∀❛ั∗)✧*。--------------'));
logger.info(
chalk.yellow(
`修仙插件(萝莉版)${versionData[0].version}${versionData[0].name}」初始化`
)
);
logger.info(`~\t${chalk.green('测试群1: 703231027')}\t~`);
logger.info(`~\t${chalk.green('测试群2: 548122316')}\t~`);
logger.info(`~\t${chalk.green('服主交流群: 523508236')}\t~`);
logger.info(`~\t${chalk.green('原开发:水脚脚,咸咸咸鱼鱼,零零零零')}\t~`);
logger.info(`~\t${chalk.green('开发: DD斩首,零,RetuEase,香菜')}\t~`);
logger.info(`~\t${chalk.green('魔改: touchscale,鱼干Hg,晓飞,雨洛,逝雪苏羽')}\t~`);
logger.info(`~\t${chalk.green('策划:再氪两单嘛')}\t~`);
logger.info(`~\t${chalk.green('源码提供:墨宇,啵唧,xh')}\t~`);
logger.info(`~\t${chalk.green('Created By touchscale')}\t~`)
logger.info(chalk.magenta('------------------------------------'))
/**
* 遍历获取
*/
let sum = [''];
let filepath = `${_path}/apps`;
function readdirectory(dir) {
let files = fs.readdirSync(dir);
files.forEach(async (item) => {
let filepath1 = dir + '/' + item;
let stat = fs.statSync(filepath1);
if (stat.isFile()) {
} else {
let file = filepath1.replace(filepath, '');
sum.push(file);
}
});
}
readdirectory(filepath);
/**
* import
*/
let apps = {};
var bian = '';
//循环写入
for (var i = 0; i < sum.length; i++) {
bian = sum[i];
var files = fs
.readdirSync(`${_path}/apps` + bian)
.filter((file) => file.endsWith('.js'));
for (let file of files) {
let name = file.replace('.js', '');
apps[name] = (await import('./apps' + bian + '/' + file))[name];
}
}
//导出
export { apps };
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/touchscale/luoli.git
git@gitee.com:touchscale/luoli.git
touchscale
luoli
萝莉
master

搜索帮助