mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-05 01:16:21 +00:00
[commands] Properly use Optional's default value on parsing error
This commit is contained in:
@ -672,7 +672,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]):
|
|||||||
except ArgumentParsingError as exc:
|
except ArgumentParsingError as exc:
|
||||||
if self._is_typing_optional(param.annotation):
|
if self._is_typing_optional(param.annotation):
|
||||||
view.index = previous
|
view.index = previous
|
||||||
return None
|
return None if param.required else await param.get_default(ctx)
|
||||||
else:
|
else:
|
||||||
raise exc
|
raise exc
|
||||||
view.previous = previous
|
view.previous = previous
|
||||||
|
Reference in New Issue
Block a user