diff options
author | 2024-02-18 20:39:16 +0100 | |
---|---|---|
committer | 2024-03-21 14:29:02 +0100 | |
commit | ee3d68cc9543b79fa35de3e1db3acef24b0dca85 (patch) | |
tree | 02617d30ba7c0a8d8398dd9b4303e2e0899f5f6e /bot/__main__.py | |
parent | implement DefaultCommandErrorHandler (diff) |
register default and command not found error handlers
Diffstat (limited to 'bot/__main__.py')
-rw-r--r-- | bot/__main__.py | 4 |
1 files changed, 4 insertions, 0 deletions
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, |