mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Fixc
Fixc
This commit is contained in:
+3
-5
@@ -369,8 +369,6 @@ class Events(commands.Cog):
|
||||
image_desc = response.data[0].revised_prompt
|
||||
self.logger.debug("Wynikowy obrazek pod url: %s", image_url)
|
||||
response = requests.get(image_url, timeout=360)
|
||||
|
||||
|
||||
temp_file_name = message.content + ".png"
|
||||
temp_file_name = GRAPHICS_PATH + message.content + ".png"
|
||||
num = 0
|
||||
@@ -381,16 +379,16 @@ class Events(commands.Cog):
|
||||
with open(temp_file_name, "wb") as dalle_file:
|
||||
dalle_file.write(response.content)
|
||||
except OSError:
|
||||
temp_file_name = "oserror.png"
|
||||
temp_file_name = "/home/pi/oserror.png"
|
||||
with open(temp_file_name, "wb") as dalle_file:
|
||||
dalle_file.write(response.content)
|
||||
except FileNotFoundError:
|
||||
temp_file_name = "fnferror.png"
|
||||
temp_file_name = "/home/pi/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"
|
||||
temp_file_name = "/home/pi/error.png"
|
||||
with open(temp_file_name, "wb") as dalle_file:
|
||||
dalle_file.write(response.content)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user