diff options
| author | Rapptz <[email protected]> | 2019-04-06 19:29:21 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-04-06 19:29:21 -0400 |
| commit | e4de25eaab902666749e30b79c60e3fe23842201 (patch) | |
| tree | c332b8eb2d99c5a3746b177fba309fc47be7f4ef | |
| parent | Only escape characters as necessary in clean_content (diff) | |
| download | discord.py-e4de25eaab902666749e30b79c60e3fe23842201.tar.xz discord.py-e4de25eaab902666749e30b79c60e3fe23842201.zip | |
[commands] Raise BadArgument in ColourConverter when using from_hsv/rgb
Fixes #2043
| -rw-r--r-- | discord/ext/commands/converter.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index 600f4be9..8676329c 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -298,8 +298,9 @@ class ColourConverter(Converter): raise BadArgument('Colour "{}" is invalid.'.format(arg)) return discord.Colour(value=value) except ValueError: - method = getattr(discord.Colour, arg.replace(' ', '_'), None) - if method is None or not inspect.ismethod(method): + arg = arg.replace(' ', '_') + method = getattr(discord.Colour, arg, None) + if arg.startswith('from_') or method is None or not inspect.ismethod(method): raise BadArgument('Colour "{}" is invalid.'.format(arg)) return method() |