From 4baf615cd4b6c0f63893de0c12a2915b0a79359a Mon Sep 17 00:00:00 2001 From: Sonic4999 Date: Sat, 4 Sep 2021 00:44:54 -0400 Subject: [PATCH] Added (back?) support for hexes without #... for ColourConverter Technically, this never was a documented feature in d.py, but ColourConverter used to work without a # Is this worth a versionchanged? I'll let other contributors decide --- discord/ext/commands/converter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index ce7037a4..16f5c98f 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -597,7 +597,8 @@ class ColourConverter(Converter[discord.Colour]): Add an alias named ColorConverter The following formats are accepted: - + + - ```` - ``0x`` - ``#`` - ``0x#`` @@ -668,7 +669,9 @@ class ColourConverter(Converter[discord.Colour]): arg = arg.replace(' ', '_') method = getattr(discord.Colour, arg, None) - if arg.startswith('from_') or method is None or not inspect.ismethod(method): + if method is None: + return self.parse_hex_number(argument) + elif arg.startswith('from_') or not inspect.ismethod(method): raise BadColourArgument(arg) return method() -- 2.47.2