Register a hook to be called before the command function.
(self, func: Callable[[plugin.PrecommandData], plugin.PrecommandData])
| 5880 | raise TypeError(f"{func.__name__} has incompatible return type {ret_ann}, expected {data_type}") |
| 5881 | |
| 5882 | def register_precmd_hook(self, func: Callable[[plugin.PrecommandData], plugin.PrecommandData]) -> None: |
| 5883 | """Register a hook to be called before the command function.""" |
| 5884 | self._validate_prepostcmd_hook(func, plugin.PrecommandData) |
| 5885 | self._precmd_hooks.append(func) |
| 5886 | |
| 5887 | def register_postcmd_hook(self, func: Callable[[plugin.PostcommandData], plugin.PostcommandData]) -> None: |
| 5888 | """Register a hook to be called after the command function.""" |