mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-31 13:32:57 +00:00 
			
		
		
		
	[commands] Raise BadArgument in ColourConverter when using from_hsv/rgb
Fixes #2043
This commit is contained in:
		| @@ -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() | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user