1
0
mirror of https://github.com/Rapptz/discord.py.git synced 2025-05-12 16:59:50 +00:00

Reword missing annotation error to be a bit clearer

This commit is contained in:
Rapptz 2022-05-20 17:21:31 -04:00
parent e813e5efe7
commit 7905d63f7c

@ -377,7 +377,7 @@ def _extract_parameters_from_callback(func: Callable[..., Any], globalns: Dict[s
parameters: List[CommandParameter] = []
for parameter in iterator:
if parameter.annotation is parameter.empty:
raise TypeError(f'annotation for {parameter.name} must be given in callback {func.__qualname__!r}')
raise TypeError(f'parameter {parameter.name!r} is missing a type annotation in callback {func.__qualname__!r}')
resolved = resolve_annotation(parameter.annotation, globalns, globalns, cache)
param = annotation_to_parameter(resolved, parameter)