mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
[commands] Properly parse bool when inside a typing.Union
This commit is contained in:
parent
262c0d3a9e
commit
8ef509883a
@ -231,6 +231,9 @@ class Command:
|
||||
return self
|
||||
|
||||
async def _actual_conversion(self, ctx, converter, argument, param):
|
||||
if converter is bool:
|
||||
return _convert_to_bool(argument)
|
||||
|
||||
try:
|
||||
module = converter.__module__
|
||||
except:
|
||||
@ -271,9 +274,6 @@ class Command:
|
||||
raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from e
|
||||
|
||||
async def do_conversion(self, ctx, converter, argument, param):
|
||||
if converter is bool:
|
||||
return _convert_to_bool(argument)
|
||||
|
||||
try:
|
||||
origin = converter.__origin__
|
||||
except AttributeError:
|
||||
|
Loading…
x
Reference in New Issue
Block a user