fix(chat): add error handling for failed sending

This commit is contained in:
The0Mikkel 2024-05-28 09:10:41 +02:00
parent 25c9857c4c
commit 633e27946d

5
bot.py
View File

@ -142,7 +142,10 @@ class Bot:
# Write response
# Truncate response if too long
await r.write(message, response[:2000])
try:
await r.write(message, response[:2000])
except Exception as e:
logging.error('Error sending response: %s', e)
task.cancel()