Fix hanuraiMemory function to use shift instead of pop for chats array

This commit is contained in:
kwaroran
2024-04-24 00:15:06 +09:00
parent 6242cd821d
commit 414fa5348c

View File

@@ -57,7 +57,7 @@ export async function hanuraiMemory(chats:OpenAIChat[],arg:{
let tokens = arg.currentTokens + db.hanuraiTokens
while(tokens > arg.maxContextTokens){
const poped = chats.pop()
const poped = chats.shift()
if(!poped){
alertError(language.errors.toomuchtoken + "\n\nRequired Tokens: " + tokens)
return false