From e0cb8de6ec36db7d376ea96dc84f25113cc16a36 Mon Sep 17 00:00:00 2001 From: yuki Date: Wed, 8 Oct 2025 23:52:32 -0300 Subject: [PATCH] except ValueError in collage generation --- commands/collage.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/commands/collage.py b/commands/collage.py index 0ea5a65..3c938c3 100644 --- a/commands/collage.py +++ b/commands/collage.py @@ -15,9 +15,13 @@ async def send_collage(bot: bot.Bot, ctx: nerimity.Context, entity: str, size: s await ctx.send(u.error_msg(f"Please provide a valid size.\nie `/chart{entity} 5x5`")) return - if int(size.split('x')[0]) > 5 or int(size.split('x')[1]) > 5: - await ctx.send(u.error_msg("Maximum size allowed is 5x5.")) - return + try: + if int(size.split('x')[0]) > 5 or int(size.split('x')[1]) > 5: + await ctx.send(u.error_msg("Maximum size allowed is 5x5.")) + return + + except ValueError: + await ctx.send(u.error_msg(f"Please provide a valid size.\nie `/chart{entity} 5x5`")) if not username: try: username = await bot.get_lastfm(ctx.author.id)