diff --git a/apps/telegram-bot/bot.py b/apps/telegram-bot/bot.py index 2b43179..835ce37 100644 --- a/apps/telegram-bot/bot.py +++ b/apps/telegram-bot/bot.py @@ -43,6 +43,10 @@ from config import config BOT_TOKEN = config.bot_token or "" +async def error_handler(update, context): + log.error(f"Error: {context.error}") + + def build_app() -> Application: app = Application.builder().token(BOT_TOKEN).build() @@ -65,6 +69,8 @@ def build_app() -> Application: app.add_handler(MessageHandler(filters.COMMAND, cmd_help)) + app.add_error_handler(error_handler) + return app