From 8ef509883a2ea3d491bcce61750b4eae11770b3b Mon Sep 17 00:00:00 2001 From: zephyrkul Date: Thu, 20 Sep 2018 21:51:05 -0600 Subject: [PATCH] [commands] Properly parse bool when inside a typing.Union --- discord/ext/commands/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 930b1a07a..e11642ca6 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: