aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzephyrkul <[email protected]>2018-09-20 21:51:05 -0600
committerRapptz <[email protected]>2018-09-20 23:58:34 -0400
commit8ef509883a2ea3d491bcce61750b4eae11770b3b (patch)
tree5179621e1e807f585694a2875d2143ed700c0281
parentCorrect note note about editing emoji in Guild.create_custom_emoji. (diff)
downloaddiscord.py-8ef509883a2ea3d491bcce61750b4eae11770b3b.tar.xz
discord.py-8ef509883a2ea3d491bcce61750b4eae11770b3b.zip
[commands] Properly parse bool when inside a typing.Union
-rw-r--r--discord/ext/commands/core.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index 930b1a07..e11642ca 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -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: