From 31ad0195d8b02755306cc0e126cec8a47069fb72 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Sun, 13 Oct 2024 19:47:52 +0800 Subject: [PATCH] fix(onebot): `get_group_msg_history` API --- src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts b/src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts index 90ca97a..d8328a4 100644 --- a/src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts +++ b/src/onebot11/action/go-cqhttp/GetGroupMsgHistory.ts @@ -30,12 +30,12 @@ export class GetGroupMsgHistory extends BaseAction { const { count, reverseOrder } = payload const peer = { chatType: ChatType.Group, peerUid: payload.group_id.toString() } let msgList: RawMessage[] - if (!payload.message_seq || payload.message_seq === '0') { + if (!payload.message_seq || +payload.message_seq === 0) { msgList = (await this.ctx.ntMsgApi.getAioFirstViewLatestMsgs(peer, +count)).msgList } else { const startMsgId = (await this.ctx.store.getMsgInfoByShortId(+payload.message_seq))?.msgId if (!startMsgId) throw new Error(`消息${payload.message_seq}不存在`) - msgList = (await this.ctx.ntMsgApi.getMsgHistory(peer, startMsgId, +count)).msgList + msgList = (await this.ctx.ntMsgApi.getMsgHistory(peer, startMsgId, +count, true)).msgList } if (!msgList?.length) throw new Error('未找到消息') if (reverseOrder) msgList.reverse()