refactor: Shell Init

This commit is contained in:
手瓜一十雪 2024-11-14 10:34:38 +08:00
parent 636d1103e3
commit f6067b002f
2 changed files with 8 additions and 7 deletions

View File

@ -72,11 +72,8 @@ export class NapCatOneBot11Adapter {
};
this.actions = createActionMap(this, core);
this.networkManager = new OB11NetworkManager();
// this.registerNative(core, context).catch(e => this.context.logger.logWarn.bind(this.context.logger)('初始化Native失败', e)).then();
this.InitOneBot()
.catch(e => this.context.logger.logError.bind(this.context.logger)('初始化OneBot失败', e));
}
async InitOneBot() {
const selfInfo = this.core.selfInfo;
const ob11Config = this.configLoader.configData;

View File

@ -232,7 +232,7 @@ export async function NCoreInitShell() {
logger.log(`可用于快速登录的 QQ\n${historyLoginList
.map((u, index) => `${index + 1}. ${u.uin} ${u.nickName}`)
.join('\n')
}`);
}`);
}
loginService.getQRCodePicture();
}
@ -327,8 +327,12 @@ export class NapCatShell {
};
this.core = new NapCatCore(this.context, selfInfo);
// TODO: complete ob11 adapter initialization logic
new NapCatOneBot11Adapter(this.core, this.context, pathWrapper);
}
async InitNapCat() {
new NapCatOneBot11Adapter(this.core, this.context, this.context.pathWrapper).InitOneBot()
.catch(e => this.context.logger.logError.bind(this.context.logger)('初始化OneBot失败', e));
}
}