Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor issues #152

Merged
merged 4 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading