1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-14 09:50:03 +00:00

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

This commit is contained in:
Jakub Kuczys 2022-06-07 02:18:25 +02:00 committed by GitHub
parent 75d57ab3ce
commit 4e7529138c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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