Skip to content

Commit

Permalink
Add a better hint
Browse files Browse the repository at this point in the history
Signed-off-by: bghira <bghira@users.github.com>
  • Loading branch information
bghira committed Apr 20, 2023
1 parent b5db36e commit e234630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions discord_tron_master/cogs/image/img2img.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from PIL import Image
from discord_tron_master.bot import DiscordBot
from discord_tron_master.classes.jobs.image_variation_job import ImageVariationJob
from discord_tron_master.classes.jobs.image_generation_job import ImageGenerationJob
from discord_tron_master.classes.jobs.image_upscaling_job import ImageUpscalingJob
from discord_tron_master.bot import clean_traceback
from discord_tron_master.cogs.image.generate import Generate
Expand Down Expand Up @@ -103,6 +104,8 @@ async def _handle_image_attachment(self, message, attachment):
# Remove "!upscale" from the contents:
message.content = message.content.replace("!upscale", "")
job = ImageUpscalingJob((self.bot, self.config, message, message.content, discord_first_message, attachment.url))
elif message.content != "":
job = ImageGenerationJob((self.bot, self.config, message, message.content, discord_first_message, attachment.url))
else:
# Default to image variation job
job = ImageVariationJob((self.bot, self.config, message, message.content, discord_first_message, attachment.url))
Expand Down
2 changes: 1 addition & 1 deletion discord_tron_master/websocket_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def handler(self, websocket, path):
result = json.dumps(raw_result)
# Did result error? If so, close the websocket connection:
if "RegistrationError" in raw_result:
await websocket.close(code=4002, reason=raw_result)
await websocket.close(code=4002, reason="RegistrationError:" + raw_result)
return
if raw_result is None or "error" in raw_result:
if raw_result is None:
Expand Down

0 comments on commit e234630

Please sign in to comment.