mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 16:51:59 +00:00
[commands] Disallow complicated Literal types
This commit is contained in:
parent
fb024546ff
commit
185b554a56
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user