refactor: GetGroupInfo

This commit is contained in:
手瓜一十雪
2024-12-06 11:39:11 +08:00
parent 0ae3a4172c
commit 4b319d15a7
6 changed files with 178 additions and 12 deletions

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));
}