diff --git a/src/core/apis/user.ts b/src/core/apis/user.ts index 5d8c7881..a715d83d 100644 --- a/src/core/apis/user.ts +++ b/src/core/apis/user.ts @@ -184,7 +184,7 @@ export class NTQQUserApi { break; } } - return uid; + return uid ?? ''; } async getUinByUidV2(Uid: string) { @@ -203,7 +203,7 @@ export class NTQQUserApi { break; } } - return uin; + return uin ?? '0'; } async getRecentContactListSnapShot(count: number) { diff --git a/src/core/services/NodeIKernelGroupService.ts b/src/core/services/NodeIKernelGroupService.ts index 83a9cc92..1b748883 100644 --- a/src/core/services/NodeIKernelGroupService.ts +++ b/src/core/services/NodeIKernelGroupService.ts @@ -187,11 +187,11 @@ export interface NodeIKernelGroupService { destroyGroup(groupCode: string): void; - getSingleScreenNotifies(doubted: boolean, start_seq: string, num: number): Promise; + getSingleScreenNotifies(doubt: boolean, startSeq: string, count: number): Promise; clearGroupNotifies(groupCode: string): void; - getGroupNotifiesUnreadCount(unknown: boolean): Promise; + getGroupNotifiesUnreadCount(doubt: boolean): Promise; clearGroupNotifiesUnreadCount(doubt: boolean): void; diff --git a/src/onebot/index.ts b/src/onebot/index.ts index 85303d87..5c9c4419 100644 --- a/src/onebot/index.ts +++ b/src/onebot/index.ts @@ -405,8 +405,8 @@ export class NapCatOneBot11Adapter { this.context.logger.logDebug(`收到邀请我加群通知:${notify}`); const groupInviteEvent = new OB11GroupRequestEvent( this.core, - parseInt(notify.group.groupCode), - parseInt(await this.core.apis.UserApi.getUinByUidV2(notify.user2.uid)), + +notify.group.groupCode, + +await this.core.apis.UserApi.getUinByUidV2(notify.user2.uid), 'invite', notify.postscript, flag @@ -423,8 +423,8 @@ export class NapCatOneBot11Adapter { this.context.logger.logDebug(`收到群员邀请加群通知:${notify}`); const groupInviteEvent = new OB11GroupRequestEvent( this.core, - parseInt(notify.group.groupCode), - parseInt(await this.core.apis.UserApi.getUinByUidV2(notify.user1.uid)), + +notify.group.groupCode, + +await this.core.apis.UserApi.getUinByUidV2(notify.user1.uid), 'add', notify.postscript, flag @@ -571,6 +571,8 @@ export class NapCatOneBot11Adapter { } private async emitFriendRecallMsg(message: RawMessage, oriMessageId: number, element: MessageElement) { + const operatorUid = element.grayTipElement?.revokeElement.operatorUid; + if (!operatorUid) return undefined; return new OB11FriendRecallNoticeEvent( this.core, +message.senderUin, @@ -581,7 +583,7 @@ export class NapCatOneBot11Adapter { private async emitGroupRecallMsg(message: RawMessage, oriMessageId: number, element: MessageElement) { const operatorUid = element.grayTipElement?.revokeElement.operatorUid; if (!operatorUid) return undefined; - const operatorId = message.senderUin ?? await this.core.apis.UserApi.getUinByUidV2(operatorUid); + const operatorId = await this.core.apis.UserApi.getUinByUidV2(operatorUid); return new OB11GroupRecallNoticeEvent( this.core, +message.peerUin,