From 330461cda9aad374ec14bafb414865b7bab28662 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 18 Feb 2024 20:39:16 +0100 Subject: register default and command not found error handlers --- bot/command_error_handlers/__init__.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bot/command_error_handlers') 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 -- cgit v1.2.3