fix: message length error

This commit is contained in:
scarqin 2023-03-23 00:20:47 +08:00
parent 59a3c84b52
commit f46019ef78

View File

@ -151,7 +151,7 @@ export class ChatgptRobotComponent implements OnInit {
//Get message by messageNumber,filter out the error message/official message //Get message by messageNumber,filter out the error message/official message
const result = this.messages const result = this.messages
.filter(val => !val.reply || (val.reply && (!val.text.includes('ChatGPT Error:') || val.user?.name === this.appName))) .filter(val => !val.reply || (val.reply && (!val.text?.includes('ChatGPT Error') || val.user?.name === this.appName)))
.slice(-messageNumber); .slice(-messageNumber);
//If last question is too long, we need to split it //If last question is too long, we need to split it