Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -61,7 +61,9 @@ async def generate(ctx, *, description: str):
|
|
61 |
image = Image.open(io.BytesIO(image_bytes))
|
62 |
image_path = "generated_image.png"
|
63 |
image.save(image_path)
|
64 |
-
|
|
|
|
|
65 |
os.remove(image_path) # Clean up the file after sending
|
66 |
else:
|
67 |
await ctx.send("An error occurred while generating the image.")
|
|
|
61 |
image = Image.open(io.BytesIO(image_bytes))
|
62 |
image_path = "generated_image.png"
|
63 |
image.save(image_path)
|
64 |
+
with open(image_path, 'rb') as f:
|
65 |
+
picture = discord.File(f, filename="generated_image.png")
|
66 |
+
await ctx.send("Here is your generated image:", file=picture)
|
67 |
os.remove(image_path) # Clean up the file after sending
|
68 |
else:
|
69 |
await ctx.send("An error occurred while generating the image.")
|