Z3ktrix commited on
Commit
296c804
Β·
verified Β·
1 Parent(s): b16309c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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
- await ctx.send(file=discord.File(image_path))
 
 
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.")