diff --git a/src/core/apis/group.ts b/src/core/apis/group.ts index 00ec0098..8384eb9c 100644 --- a/src/core/apis/group.ts +++ b/src/core/apis/group.ts @@ -24,7 +24,7 @@ export class NTQQGroupApi { constructor(context: InstanceContext, core: NapCatCore) { this.context = context; this.core = core; - this.initCache().then().catch(context.logger.logError); + this.initCache().then().catch(context.logger.logError.bind(context.logger)); } async initCache() { diff --git a/src/core/apis/user.ts b/src/core/apis/user.ts index fe8d48f5..4686bee0 100644 --- a/src/core/apis/user.ts +++ b/src/core/apis/user.ts @@ -159,7 +159,7 @@ export class NTQQUserApi { if (uid) return uid; uid = (await this.context.session.getUixConvertService().getUid([Uin])).uidInfo.get(Uin); if (uid) return uid; - const unverifiedUid = (await this.getUserDetailInfoByUinV2(Uin)).detail.uid;//从QQ Native 特殊转换 + const unverifiedUid = (await this.getUserDetailInfoByUin(Uin)).detail.uid;//从QQ Native 特殊转换 if (unverifiedUid.indexOf('*') == -1) uid = unverifiedUid; //if (uid) return uid; return uid; @@ -195,7 +195,7 @@ export class NTQQUserApi { return await this.context.session.getRecentContactService().getRecentContactList(); } - async getUserDetailInfoByUinV2(Uin: string) { + async getUserDetailInfoByUin(Uin: string) { return await this.core.eventWrapper.callNoListenerEvent( 'NodeIKernelProfileService/getUserDetailInfoByUin', Uin diff --git a/src/core/entities/user.ts b/src/core/entities/user.ts index 9e827f24..692e0f94 100644 --- a/src/core/entities/user.ts +++ b/src/core/entities/user.ts @@ -297,7 +297,7 @@ export enum BizKey { KPHOTOWALL } -export interface UserDetailInfoByUinV2 { +export interface UserDetailInfoByUin { result: number, errMsg: string, detail: { @@ -308,65 +308,6 @@ export interface UserDetailInfoByUinV2 { photoWall: null } } - -export interface UserDetailInfoByUin { - result: number, - errMsg: string, - info: { - uid: string,//这个没办法用 - qid: string, - uin: string, - nick: string, - remark: string, - longNick: string, - avatarUrl: string, - birthday_year: number, - birthday_month: number, - birthday_day: number, - sex: number,//0 - topTime: string, - constellation: number, - shengXiao: number, - kBloodType: number, - homeTown: string, - makeFriendCareer: number, - pos: string, - eMail: string, - phoneNum: string, - college: string, - country: string, - province: string, - city: string, - postCode: string, - address: string, - isBlock: boolean, - isSpecialCareOpen: boolean, - isSpecialCareZone: boolean, - ringId: string, - regTime: number, - interest: string, - termType: number, - labels: any[], - qqLevel: { crownNum: number, sunNum: number, moonNum: number, starNum: number }, - isHideQQLevel: number, - privilegeIcon: { jumpUrl: string, openIconList: any[], closeIconList: any[] }, - isHidePrivilegeIcon: number, - photoWall: { picList: any[] }, - vipFlag: boolean, - yearVipFlag: boolean, - svipFlag: boolean, - vipLevel: number, - status: number, - qidianMasterFlag: number, - qidianCrewFlag: number, - qidianCrewFlag2: number, - extStatus: number, - recommendImgFlag: number, - disableEmojiShortCuts: number, - pendantId: string, - vipNameColorId: string - } -} export enum UserDetailSource { KDB, KSERVER diff --git a/src/core/services/NodeIKernelProfileService.ts b/src/core/services/NodeIKernelProfileService.ts index a43c6c43..b27e8e0d 100644 --- a/src/core/services/NodeIKernelProfileService.ts +++ b/src/core/services/NodeIKernelProfileService.ts @@ -1,5 +1,5 @@ import { AnyCnameRecord } from 'node:dns'; -import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUinV2, UserDetailSource } from '@/core'; +import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUin, UserDetailSource } from '@/core'; import { GeneralCallResult } from '@/core/services/common'; export interface NodeIKernelProfileService { @@ -55,7 +55,7 @@ export interface NodeIKernelProfileService { getUserDetailInfoWithBizInfo(uid: string, Biz: BizKey[]): Promise; - getUserDetailInfoByUin(uin: string): Promise; + getUserDetailInfoByUin(uin: string): Promise; getZplanAvatarInfos(args: string[]): Promise; diff --git a/src/onebot/action/go-cqhttp/GetStrangerInfo.ts b/src/onebot/action/go-cqhttp/GetStrangerInfo.ts index ed6a9e12..51d7cd3a 100644 --- a/src/onebot/action/go-cqhttp/GetStrangerInfo.ts +++ b/src/onebot/action/go-cqhttp/GetStrangerInfo.ts @@ -20,7 +20,7 @@ export default class GoCQHTTPGetStrangerInfo extends BaseAction { const user_id = payload.user_id.toString(); - const extendData = await this.core.apis.UserApi.getUserDetailInfoByUinV2(user_id); + const extendData = await this.core.apis.UserApi.getUserDetailInfoByUin(user_id); const uid = (await this.core.apis.UserApi.getUidByUinV2(user_id))!; if (!uid || uid.indexOf('*') != -1) { return {