mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-14 17:59:48 +00:00
[commands] Properly use Optional's default value on parsing error
This commit is contained in:
parent
75d57ab3ce
commit
4e7529138c
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user