chore: config

This commit is contained in:
手瓜一十雪
2024-08-12 00:12:52 +08:00
parent ecee642e10
commit 32d4febf10
3 changed files with 20 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ import { LegacyNTEventWrapper } from '@/common/framework/event-legacy';
import { NTQQFileApi, NTQQFriendApi, NTQQGroupApi, NTQQMsgApi, NTQQSystemApi, NTQQUserApi, NTQQWebApi } from './apis';
import os from 'node:os';
import { NTQQCollectionApi } from './apis/collection';
import { OB11Config } from '@/onebot/helper/config';
import { NapCatConfig } from './helper/config';
export enum NapCatCoreWorkingEnv {
Unknown = 0,
@@ -36,6 +38,7 @@ export class NapCatCore {
// runtime info, not readonly
selfInfo: SelfInfo;
util: NodeQQNTWrapperUtil;
config: any;
// 通过构造器递过去的 runtime info 应该尽量少
constructor(context: InstanceContext, selfInfo: SelfInfo) {
@@ -53,6 +56,7 @@ export class NapCatCore {
UserApi: new NTQQUserApi(this.context, this),
GroupApi: new NTQQGroupApi(this.context, this),
};
this.config = new NapCatConfig(this,this.context.pathWrapper.cachePath);
this.NapCatDataPath = path.join(this.dataPath, 'NapCat');
fs.mkdirSync(this.NapCatDataPath, { recursive: true });
this.NapCatTempPath = path.join(this.NapCatDataPath, 'temp');