Fixed parameter issue in bound command execution

This commit is contained in:
2026-02-24 22:36:35 +01:00
parent 1add319a6e
commit 5dc4fbae25

View File

@@ -151,7 +151,7 @@ class Command:
before_commands = [bc for bc in self.owner.get_bound_commands(self.name) if bc.when == "before"] before_commands = [bc for bc in self.owner.get_bound_commands(self.name) if bc.when == "before"]
for bound_cmd in before_commands: for bound_cmd in before_commands:
logger.debug(f" will execute bound command {bound_cmd.command.name} BEFORE...") logger.debug(f" will execute bound command {bound_cmd.command.name} BEFORE...")
r = bound_cmd.command.execute(client_response) r = bound_cmd.command.execute() # client_response should not be forwarded as it's not the same command
ret_from_before_commands.append(r) ret_from_before_commands.append(r)
# Execute main callback # Execute main callback
@@ -166,7 +166,7 @@ class Command:
after_commands = [bc for bc in self.owner.get_bound_commands(self.name) if bc.when == "after"] after_commands = [bc for bc in self.owner.get_bound_commands(self.name) if bc.when == "after"]
for bound_cmd in after_commands: for bound_cmd in after_commands:
logger.debug(f" will execute bound command {bound_cmd.command.name} AFTER...") logger.debug(f" will execute bound command {bound_cmd.command.name} AFTER...")
r = bound_cmd.command.execute(client_response) r = bound_cmd.command.execute() # client_response should not be forwarded as it's not the same command
ret_from_after_commands.append(r) ret_from_after_commands.append(r)
all_ret = flatten(ret, ret_from_before_commands, ret_from_after_commands, collector.results) all_ret = flatten(ret, ret_from_before_commands, ret_from_after_commands, collector.results)