From ee3d68cc9543b79fa35de3e1db3acef24b0dca85 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/__main__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bot/__main__.py') diff --git a/bot/__main__.py b/bot/__main__.py index bacb2fdd..a6eb6d88 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -11,12 +11,14 @@ from redis import RedisError import bot from bot import constants from bot.bot import Bot +from bot.command_error_handlers import bootstrap_command_error_manager from bot.log import setup_sentry from bot.utils.decorators import whitelist_check log = get_logger(__name__) setup_sentry() + async def _create_redis_session() -> RedisSession: """Create and connect to a redis session.""" redis_session = RedisSession( @@ -74,6 +76,8 @@ async def main() -> None: allowed_roles=allowed_roles, ) + bot.instance.register_command_error_manager(bootstrap_command_error_manager(bot.instance)) + async with bot.instance as _bot: _bot.add_check(whitelist_check( channels=constants.WHITELISTED_CHANNELS, -- cgit v1.2.3