Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bghira committed Jul 5, 2024
1 parent d0901e3 commit 4185105
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions discord_tron_master/cogs/image/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from io import BytesIO
import discord as discord_lib
import requests, logging
import requests, logging, asyncio
from discord_tron_master.classes.app_config import AppConfig
from discord_tron_master.classes.openai.text import GPT
from discord_tron_master.classes.stabilityai.api import StabilityAI
Expand Down Expand Up @@ -223,8 +223,8 @@ def generate_image(ctx, prompt, user_id: int = None, extra_image: dict = None):
new_image.save(output, format="PNG")
output.seek(0)
if hasattr(ctx, 'channel'):
await ctx.channel.send(file=discord_lib.File(output, "comparison.png"))
asyncio.run(ctx.channel.send(file=discord_lib.File(output, "comparison.png")))
else:
await ctx.send(file=discord_lib.File(output, "comparison.png"))
asyncio.run(ctx.send(file=discord_lib.File(output, "comparison.png")))
except Exception as e:
await ctx.send(f"Error generating image: {e}")
asyncio.run(ctx.send(f"Error generating image: {e}"))

0 comments on commit 4185105

Please sign in to comment.