Compare commits
1 Commits
JDJGInc/2.
...
Astrea49/c
Author | SHA1 | Date | |
---|---|---|---|
4baf615cd4 |
@ -597,7 +597,8 @@ class ColourConverter(Converter[discord.Colour]):
|
|||||||
Add an alias named ColorConverter
|
Add an alias named ColorConverter
|
||||||
|
|
||||||
The following formats are accepted:
|
The following formats are accepted:
|
||||||
|
|
||||||
|
- ``<hex>``
|
||||||
- ``0x<hex>``
|
- ``0x<hex>``
|
||||||
- ``#<hex>``
|
- ``#<hex>``
|
||||||
- ``0x#<hex>``
|
- ``0x#<hex>``
|
||||||
@ -668,7 +669,9 @@ class ColourConverter(Converter[discord.Colour]):
|
|||||||
|
|
||||||
arg = arg.replace(' ', '_')
|
arg = arg.replace(' ', '_')
|
||||||
method = getattr(discord.Colour, arg, None)
|
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)
|
raise BadColourArgument(arg)
|
||||||
return method()
|
return method()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user