diff options
| author | Rapptz <[email protected]> | 2021-04-24 09:12:28 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-04-24 09:12:28 -0400 |
| commit | 185b554a563ad4f663de7b80a4e5895f2deb33a4 (patch) | |
| tree | 731491bef17615b456558c0fd1b6f70ecaf1268e | |
| parent | [commands] Fix Literal converter not working within flags (diff) | |
| download | discord.py-185b554a563ad4f663de7b80a4e5895f2deb33a4.tar.xz discord.py-185b554a563ad4f663de7b80a4e5895f2deb33a4.zip | |
[commands] Disallow complicated Literal types
| -rw-r--r-- | discord/ext/commands/core.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 642fbe0f..7c802873 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -134,6 +134,9 @@ def _evaluate_annotation( _evaluate_annotation(arg, globals, locals, cache, implicit_str=implicit_str) for arg in args ) + if not all(isinstance(x, (str, int, bool, float, complex)) for x in evaluated_args): + raise TypeError('Literal arguments must be of type str, int, bool, float or complex.') + if evaluated_args == args: return tp |