From 7905d63f7c988640a0848cb2a26c8dc3c3eaa862 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Fri, 20 May 2022 17:21:31 -0400 Subject: [PATCH] Reword missing annotation error to be a bit clearer --- discord/app_commands/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index 92fddef00..5d777550b 100644 --- a/discord/app_commands/commands.py +++ b/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)