Adding error checking for stat message removal
This commit is contained in:
parent
1f3ff44317
commit
a5d2530456
@ -504,11 +504,17 @@ async function generateResponse(conversation, message) {
|
||||
|
||||
// clear the interval, replace the "please wait" message with the response, and update the message
|
||||
console.log(responseText);
|
||||
try {
|
||||
if (time > 2) {
|
||||
await botMessage.delete()
|
||||
await botMessage.delete();
|
||||
clearInterval(refreshInterval);
|
||||
botMessage = null;
|
||||
console.log("Time limit reached. Message deleted.");
|
||||
}
|
||||
} catch (err) {
|
||||
console.log("Error deleting message: ", err);
|
||||
}
|
||||
|
||||
|
||||
return responseText;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user