From 853e9521289b9ca4d21cca01ee6e926e9c24fff6 Mon Sep 17 00:00:00 2001 From: Michal Tuszowski Date: Tue, 21 Jan 2025 16:51:33 +0100 Subject: [PATCH] Hej hoppsan! --- ai_commands.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ai_commands.py b/ai_commands.py index 381a6b2..0624c66 100644 --- a/ai_commands.py +++ b/ai_commands.py @@ -2,7 +2,6 @@ import logging import re import sys -import random from datetime import datetime from enum import Enum from typing import Optional @@ -381,6 +380,15 @@ class Events(commands.Cog): temp_file_name = "oserror.png" with open(temp_file_name, "wb") as dalle_file: dalle_file.write(response.content) + except FileNotFoundError: + temp_file_name = "fnferror.png" + with open(temp_file_name, "wb") as dalle_file: + dalle_file.write(response.content) + except Exception as e: + self.logger.error("Nieznany błąd: %s", e) + temp_file_name = "error.png" + with open(temp_file_name, "wb") as dalle_file: + dalle_file.write(response.content) self.logger.info("Koniec procedury obrazkowej.") fnord = discord.File(