-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
38 lines (36 loc) · 1.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import chalk from 'chalk';
import Config from './utils/config.js';
import path from 'path';
import { _paths } from './utils/paths.js';
import YukiBili from './apps/bilibili.js';
import YukiHelp from './apps/help.js';
import YukiVersion from './apps/version.js';
import YukiWeibo from './apps/weibo.js';
const yukiPluginVersion = Config.getPackageJsonKey('version', path.join(_paths.pluginPath, 'package.json'));
if (!global.segment) {
try {
global.segment = (await import('oicq')).segment;
}
catch (err) {
global.segment = (await import('icqq')).segment;
}
}
let apps = { YukiBili, YukiHelp, YukiVersion, YukiWeibo };
let rules = {};
let count = 0;
for (let key in apps) {
if (!apps[key]) {
logger.error(`载入插件错误:${[key]}`);
continue;
}
rules[`${key}`] = apps[key];
count++;
}
logger.info(chalk.rgb(0, 190, 255)(`-----------------------------------------`));
logger.info(chalk.rgb(255, 225, 255)(`|优纪插件 ${yukiPluginVersion} 初始化~`));
logger.info(chalk.rgb(255, 245, 255)(`|作者:snowtafir`));
logger.info(chalk.rgb(255, 225, 255)(`|仓库地址:`));
logger.info(chalk.rgb(255, 245, 255)(`|https://github.com/snowtafir/yuki-plugin`));
logger.info(chalk.rgb(0, 190, 255)(`-----------------------------------------`));
logger.info(chalk.rgb(0, 190, 255)(`★ 优纪插件加载完成,共计加载${count}个app`));
export { rules as apps };