refactor: GetGroupInfo

This commit is contained in:
手瓜一十雪 committed 2024-12-06 11:39:11 +08:00
1 parent 83a988c1e4
commit 5b34616625
6 files changed
+178 -12

No files matched your search

+14
View File
@@ -8,6 +8,7 @@ import {
MemberExtSourceType,
NapCatCore,
GroupNotify,
GroupInfoSource,
} from '@/core';
import { isNumeric, solveAsyncProblem } from '@/common/helper';
import { LimitedHashTable } from '@/common/message-unique';
@@ -24,6 +25,19 @@ export class NTQQGroupApi {
this.core = core;
}
async fetchGroupDetail(groupCode: string) {
let [, detailInfo] = await this.core.eventWrapper.callNormalEventV2(
'NodeIKernelGroupService/getGroupDetailInfo',
'NodeIKernelGroupListener/onGroupDetailInfoChange',
[groupCode, GroupInfoSource.KDATACARD],
(ret) => ret.result === 0,
(detailInfo) => detailInfo.groupCode === groupCode,
1,
5000
);
return detailInfo;
}
async initApi() {
this.initCache().then().catch(e => this.context.logger.logError(e));
}