Merge branch 'v2' of github.com:ikechan8370/chatgpt-plugin into v2

This commit is contained in:
ikechan8370 2025-02-15 19:14:23 +08:00
commit 83c481a4bc
3 changed files with 9 additions and 8 deletions

View file

@ -16,13 +16,13 @@ export async function getChatHistoryGroup (e, num) {
if (!chatHistory || chatHistory.length === 0) {
break
}
chats.push(...chatHistory)
if (seq === chatHistory[0].seq || seq === chatHistory[0].message_id) {
chats.push(...chatHistory.reverse())
if (seq === chatHistory[chatHistory.length - 1].seq || seq === chatHistory[chatHistory.length - 1].message_id) {
break
}
seq = chatHistory[0].seq || chatHistory[0].message_id
seq = chatHistory[chatHistory.length - 1].seq || chatHistory[chatHistory.length - 1].message_id
}
chats = chats.slice(0, num)
chats = chats.slice(0, num).reverse()
try {
let mm = await e.bot.gml
for (const chat of chats) {