Skip to content

Commit

Permalink
Merge pull request #152 from rtk-rnjn/main
Browse files Browse the repository at this point in the history
Fix minor issues
  • Loading branch information
deadaf authored Feb 10, 2024
2 parents 7d6b985 + d24fdc7 commit b71ff32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/utils/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ async def wrapper(*args, **kwargs):
class QuoColor:
@classmethod
async def convert(cls, ctx, arg):
match, check = None, False
with contextlib.suppress(AttributeError):
match = re.match(r"\(?(\d+),?\s*(\d+),?\s*(\d+)\)?", arg)
check = all(0 <= int(x) <= 255 for x in match.groups())

if match and check:
return discord.Color.from_rgb([int(i) for i in match.groups()])
return discord.Color.from_rgb(*[int(i) for i in match.groups()])

_converter = commands.ColorConverter()
result = None
Expand Down
4 changes: 2 additions & 2 deletions src/utils/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class InputError(QuotientError):

class SMNotUsable(QuotientError):
def __init__(self):
super().__init__(f"You need either the `scrims-mod` role or `manage_guild` permissions to use this command.")
super().__init__("You need either the `scrims-mod` role or `Manage Server` permissions to use this command.")


class TMNotUsable(QuotientError):
def __init__(self):
super().__init__(f"You need either the `tourney-mod` role or `manage_guild` permissions to use tourney manager.")
super().__init__("You need either the `tourney-mod` role or `Manage Server` permissions to use tourney manager.")


class PastTime(QuotientError):
Expand Down

0 comments on commit b71ff32

Please sign in to comment.