mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 跟进shamrock和lain的更新
This commit is contained in:
parent
56a893734c
commit
c99019cd91
1 changed files with 6 additions and 5 deletions
|
|
@ -1,16 +1,17 @@
|
||||||
export async function getChatHistoryGroup (e, num) {
|
export async function getChatHistoryGroup (e, num) {
|
||||||
if (e.adapter === 'shamrock') {
|
//if (e.adapter === 'shamrock') {
|
||||||
return await e.group.getChatHistory(0, num, false)
|
// return await e.group.getChatHistory(0, num, false)
|
||||||
} else {
|
//} else {
|
||||||
let latestChats = await e.group.getChatHistory(0, 1)
|
let latestChats = await e.group.getChatHistory(0, 1)
|
||||||
if (latestChats.length > 0) {
|
if (latestChats.length > 0) {
|
||||||
let latestChat = latestChats[0]
|
let latestChat = latestChats[0]
|
||||||
if (latestChat) {
|
if (latestChat) {
|
||||||
let seq = latestChat.seq
|
let seq = latestChat.seq || latestChat.message_id
|
||||||
let chats = []
|
let chats = []
|
||||||
while (chats.length < num) {
|
while (chats.length < num) {
|
||||||
let chatHistory = await e.group.getChatHistory(seq, 20)
|
let chatHistory = await e.group.getChatHistory(seq, 20)
|
||||||
chats.push(...chatHistory)
|
chats.push(...chatHistory)
|
||||||
|
seq = chatHistory[0].seq || chatHistory[0].message_id
|
||||||
}
|
}
|
||||||
chats = chats.slice(0, num)
|
chats = chats.slice(0, num)
|
||||||
try {
|
try {
|
||||||
|
|
@ -28,6 +29,6 @@ export async function getChatHistoryGroup (e, num) {
|
||||||
return chats
|
return chats
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue