From dfc92c223ca1a97640546f02d50145169dac4851 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 31 Mar 2022 08:55:20 -0400 Subject: [PATCH] Fix application commands not always sending the proper parameter name --- discord/app_commands/commands.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index f069284c6..6ceb5a29b 100644 --- a/discord/app_commands/commands.py +++ b/discord/app_commands/commands.py @@ -532,13 +532,11 @@ class Command(Generic[GroupT, P, T]): value = values[name] except KeyError: if not param.required: - transformed_values[name] = param.default + transformed_values[param.name] = param.default else: raise CommandSignatureMismatch(self) from None else: - if param._rename is not MISSING: - name = param.name - transformed_values[name] = await param.transform(interaction, value) + transformed_values[param.name] = await param.transform(interaction, value) # These type ignores are because the type checker doesn't quite understand the narrowing here # Likewise, it thinks we're missing positional arguments when there aren't any.