From 9ff90d786392655ba57f9d63cb8ddab21d208f70 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Thu, 14 Apr 2022 17:45:27 -0400 Subject: [PATCH] Copy internal attributes for command decorator state This allows for copies to not clear the state the decorators had set prior. --- discord/app_commands/commands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/discord/app_commands/commands.py b/discord/app_commands/commands.py index c0b6a3dd0..8e7ec1337 100644 --- a/discord/app_commands/commands.py +++ b/discord/app_commands/commands.py @@ -389,21 +389,21 @@ def _extract_parameters_from_callback(func: Callable[..., Any], globalns: Dict[s except AttributeError: pass else: - _populate_renames(result, renames) + _populate_renames(result, renames.copy()) try: choices = func.__discord_app_commands_param_choices__ except AttributeError: pass else: - _populate_choices(result, choices) + _populate_choices(result, choices.copy()) try: autocomplete = func.__discord_app_commands_param_autocomplete__ except AttributeError: pass else: - _populate_autocomplete(result, autocomplete) + _populate_autocomplete(result, autocomplete.copy()) return result