[commands] Properly use Optional's default value on parsing error

This commit is contained in:
Jakub Kuczys
2022-06-06 20:18:25 -04:00
committed by GitHub
parent 75d57ab3ce
commit 4e7529138c
+1 -1
View File
@@ -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