Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Apr 19, 2024
1 parent 7eefaa5 commit 180a33f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion discord_tron_master/cogs/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ async def generate_image(ctx, prompt, user_id: int = None, extra_image: dict = N
output = BytesIO()
new_image.save(output, format="PNG")
output.seek(0)
await ctx.channel.send(file=discord_lib.File(output, "comparison.png"))
if hasattr(ctx, 'channel'):
await ctx.channel.send(file=discord_lib.File(output, "comparison.png"))
else:
await ctx.send(file=discord_lib.File(output, "comparison.png"))
except Exception as e:
await ctx.send(f"Error generating image: {e}")

0 comments on commit 180a33f

Please sign in to comment.