except ValueError in collage generation
This commit is contained in:
parent
6c919081c7
commit
e0cb8de6ec
1 changed files with 7 additions and 3 deletions
|
|
@ -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`"))
|
await ctx.send(u.error_msg(f"Please provide a valid size.\nie `/chart{entity} 5x5`"))
|
||||||
return
|
return
|
||||||
|
|
||||||
if int(size.split('x')[0]) > 5 or int(size.split('x')[1]) > 5:
|
try:
|
||||||
await ctx.send(u.error_msg("Maximum size allowed is 5x5."))
|
if int(size.split('x')[0]) > 5 or int(size.split('x')[1]) > 5:
|
||||||
return
|
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:
|
if not username:
|
||||||
try: username = await bot.get_lastfm(ctx.author.id)
|
try: username = await bot.get_lastfm(ctx.author.id)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue