code: def register_cmdfinalization_hook(self, func: Callable[[plugin.CommandFinalizationData],
                                                             plugin.CommandFinalizationData]) -> None:
          
          self._validate_cmdfinalization_callable(func)
          self._cmdfinalization_hooks.append(func)
docs: Register a hook to be called after a command is completed, whether it completes successfully or not.