mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-20 16:00:29 +00:00
[commands] Properly handle typing.Optional as last positional parameter
This commit is contained in:
parent
7fbdc6e83f
commit
0513ea1f53
@ -413,6 +413,8 @@ class Command(_BaseCommand):
|
||||
if param.kind == param.VAR_POSITIONAL:
|
||||
raise RuntimeError() # break the loop
|
||||
if required:
|
||||
if self._is_typing_optional(param.annotation):
|
||||
return None
|
||||
raise MissingRequiredArgument(param)
|
||||
return param.default
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user