diff options
| author | Rapptz <[email protected]> | 2021-04-07 03:17:10 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-07 03:17:36 -0400 |
| commit | f80b8d3f5d77f8188c5e8de47d94adf0f99d0736 (patch) | |
| tree | f453f531e009b220feb5040d65ddbd1945595b1a | |
| parent | Add `__all__` to remaining modules (diff) | |
| download | discord.py-f80b8d3f5d77f8188c5e8de47d94adf0f99d0736.tar.xz discord.py-f80b8d3f5d77f8188c5e8de47d94adf0f99d0736.zip | |
[commands] Only replace annotation if one was given
| -rw-r--r-- | discord/ext/commands/core.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 09661d9c..0de14b45 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -310,7 +310,9 @@ class Command(_BaseCommand): for key, value in self.params.items(): # coalesce the forward references - self.params[key] = value = value.replace(annotation=type_hints.get(key)) + if key in type_hints: + self.params[key] = value = value.replace(annotation=type_hints[key]) + # fail early for when someone passes an unparameterized Greedy type if value.annotation is converters.Greedy: raise TypeError('Unparameterized Greedy[...] is disallowed in signature.') |