From 4e7529138c8ed9ee9fffaf6be2f95b5a1b3dd6e2 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys <6032823+jack1142@users.noreply.github.com> Date: Tue, 7 Jun 2022 02:18:25 +0200 Subject: [PATCH] [commands] Properly use Optional's default value on parsing error --- discord/ext/commands/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 4a0b2a96a..682a64748 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -672,7 +672,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): except ArgumentParsingError as exc: if self._is_typing_optional(param.annotation): view.index = previous - return None + return None if param.required else await param.get_default(ctx) else: raise exc view.previous = previous