Browse Source

Reword missing annotation error to be a bit clearer

pull/8056/head
Rapptz 3 years ago
parent
commit
7905d63f7c
  1. 2
      discord/app_commands/commands.py

2
discord/app_commands/commands.py

@ -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)

Loading…
Cancel
Save