diff options
| author | 2024-02-18 20:39:16 +0100 | |
|---|---|---|
| committer | 2024-03-20 19:15:03 +0100 | |
| commit | 330461cda9aad374ec14bafb414865b7bab28662 (patch) | |
| tree | 4d807afbf256c78ae784d5b06972223c3d92d3ab /bot/command_error_handlers | |
| parent | implement DefaultCommandErrorHandler (diff) | |
register default and command not found error handlers
Diffstat (limited to 'bot/command_error_handlers')
| -rw-r--r-- | bot/command_error_handlers/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bot/command_error_handlers/__init__.py b/bot/command_error_handlers/__init__.py index e69de29b..a5181636 100644 --- a/bot/command_error_handlers/__init__.py +++ b/bot/command_error_handlers/__init__.py @@ -0,0 +1,14 @@ +from pydis_core.utils.error_handling.commands import CommandErrorManager + +from bot.bot import Bot + +from .command_not_found import CommandNotFoundErrorHandler +from .default import DefaultCommandErrorHandler + + +def bootstrap_command_error_manager(bot: Bot) -> CommandErrorManager: + """Bootstraps the command error manager with all the needed error handlers.""" + default_handler = DefaultCommandErrorHandler() + manager = CommandErrorManager(default=default_handler) + manager.register_handler(CommandNotFoundErrorHandler(bot)) + return manager |