标准兼容

根据GOCQ标准将获取群历史消息中的msg_seq改为非必要参数,默认为0
This commit is contained in:
Alen
2024-07-27 04:10:01 +08:00
parent 5db201c342
commit 990a31e961

View File

@@ -18,7 +18,7 @@ const SchemaData = {
message_seq: { type: 'number' },
count: { type: 'number' }
},
required: ['group_id', 'message_seq', 'count']
required: ['group_id', 'count']
} as const satisfies JSONSchema;
type Payload = FromSchema<typeof SchemaData>;
@@ -31,7 +31,7 @@ export default class GoCQHTTPGetGroupMsgHistory extends BaseAction<Payload, Resp
if (!group) {
throw `${payload.group_id}不存在`;
}
const startMsgId = (await MessageUnique.getMsgIdAndPeerByShortId(payload.message_seq))?.MsgId || '0';
const startMsgId = (await MessageUnique.getMsgIdAndPeerByShortId(payload.message_seq || 0))?.MsgId || '0';
// log("startMsgId", startMsgId)
const historyResult = (await NTQQMsgApi.getMsgHistory({
chatType: ChatType.group,