diff options
| author | Harmon <[email protected]> | 2019-03-13 10:05:08 -0500 |
|---|---|---|
| committer | Harmon <[email protected]> | 2019-03-13 10:05:08 -0500 |
| commit | 0513ea1f5350e016f10de4c1aaa8bc7c27cc3865 (patch) | |
| tree | fe9020e615e1ac1d9f4e795495792a79c254500b | |
| parent | Add Embed.copy to do a copy on an embed object. (diff) | |
| download | discord.py-0513ea1f5350e016f10de4c1aaa8bc7c27cc3865.tar.xz discord.py-0513ea1f5350e016f10de4c1aaa8bc7c27cc3865.zip | |
[commands] Properly handle typing.Optional as last positional parameter
| -rw-r--r-- | discord/ext/commands/core.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 85bb1b9f..72f25a69 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -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 |