wop commited on
Commit
500eb3a
·
verified ·
1 Parent(s): b92b3f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -82,9 +82,11 @@ async def img(ctx, *, prompt: str):
82
  image_bytes = query({
83
  "inputs": prompt,
84
  })
85
- image_file = discord.File(io.BytesIO(image_bytes), filename='generated_image.png')
 
 
86
  # Send the image as a file
87
- await ctx.reply(file=image_file)
88
 
89
 
90
  @bot.command()
 
82
  image_bytes = query({
83
  "inputs": prompt,
84
  })
85
+ timestamp = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
86
+ filename = f"generated_image_{timestamp}.png"
87
+ image_file = discord.File(io.BytesIO(image_bytes), filename=filename)
88
  # Send the image as a file
89
+ await ctx.reply(content=prompt, file=image_file)
90
 
91
 
92
  @bot.command()