From 59f99e4f6aa1963c8438b976cf26953bafc1d07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Tue, 16 Apr 2024 18:36:51 +0800 Subject: [PATCH] fix --- src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts b/src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts index 6fae23d3..85083b81 100644 --- a/src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts +++ b/src/onebot11/action/go-cqhttp/GetFriendMsgHistory.ts @@ -21,15 +21,15 @@ interface Response { export default class GetFriendMsgHistory extends BaseAction { actionName = ActionName.GoCQHTTP_GetGroupMsgHistory; protected async _handle(payload: Payload): Promise { - let uin = getUidByUin(payload.user_id.toString()) - if (!uin) { + let uid = getUidByUin(payload.user_id.toString()) + if (!uid) { throw `记录${payload.user_id}不存在`; } const startMsgId = (await dbUtil.getMsgByShortId(payload.message_seq))?.msgId || '0'; - let friend = await getFriend(uid2UinMap?.[payload.user_id].toString()) + let friend = await getFriend(uid); let historyResult = (await NTQQMsgApi.getMsgHistory({ chatType: friend ? ChatType.friend : ChatType.temp, - peerUid: uin + peerUid: uid }, startMsgId, parseInt(payload.count?.toString()) || 20)); console.log(historyResult); const msgList = historyResult.msgList;