NapCatQQ/src/core/apis/system.ts
2025-02-02 23:22:21 +08:00

37 lines
1.1 KiB
TypeScript

import { InstanceContext, NapCatCore } from '@/core';
export class NTQQSystemApi {
context: InstanceContext;
core: NapCatCore;
constructor(context: InstanceContext, core: NapCatCore) {
this.context = context;
this.core = core;
}
async hasOtherRunningQQProcess() {
return this.core.util.hasOtherRunningQQProcess();
}
async ocrImage(filePath: string) {
return this.context.session.getNodeMiscService().wantWinScreenOCR(filePath);
}
async translateEnWordToZn(words: string[]) {
return this.context.session.getRichMediaService().translateEnWordToZn(words);
}
async getOnlineDev() {
this.context.session.getMsgService().getOnLineDev();
}
async getArkJsonCollection() {
return await this.core.eventWrapper.callNoListenerEvent('NodeIKernelCollectionService/collectionArkShare', '1717662698058');
}
async bootMiniApp(appFile: string, params: string) {
await this.context.session.getNodeMiscService().setMiniAppVersion('2.16.4');
return this.context.session.getNodeMiscService().startNewMiniApp(appFile, params);
}
}