diff options
author | 2021-05-06 13:05:37 -0400 | |
---|---|---|
committer | 2021-05-06 13:05:37 -0400 | |
commit | 16b43597050b8dad922c8d93aa07c061e0512c1f (patch) | |
tree | 8301d0ee4f91b844426225d204918f6a0dad6242 | |
parent | Merge branch 'main' into feat/mosaic-command (diff) |
chore: Check if the number of squares first is bigger than the max first
Co-authored-by: Anand Krishna <[email protected]>
-rw-r--r-- | bot/exts/evergreen/avatar_modification/avatar_modify.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bot/exts/evergreen/avatar_modification/avatar_modify.py b/bot/exts/evergreen/avatar_modification/avatar_modify.py index 221bd809..dffe43ce 100644 --- a/bot/exts/evergreen/avatar_modification/avatar_modify.py +++ b/bot/exts/evergreen/avatar_modification/avatar_modify.py @@ -322,14 +322,11 @@ class AvatarModify(commands.Cog): await ctx.send(f"{Emojis.cross_mark} Could not get member info.") return - if squares < 1: - raise commands.BadArgument("Squares must be a positive number") + if 1 <= squares <= MAX_SQUARES: + raise commands.BadArgument(f"Squares must be a positive number less than or equal to {MAX_SQUARES:,}.") if not math.sqrt(squares).is_integer(): - raise commands.BadArgument("Squares must be a perfect square") - - if squares > MAX_SQUARES: - raise commands.BadArgument(f"Number of squares cannot be higher than {MAX_SQUARES:,}.") + raise commands.BadArgument("The number of squares must be a perfect square.") file_name = file_safe_name("mosaic_avatar", ctx.author.display_name) |