From b3f1f6ca3a060608f53e9bfb1c802d1e1cd396d6 Mon Sep 17 00:00:00 2001 From: Kellermann Date: Sat, 28 May 2022 15:27:55 +0200 Subject: [PATCH] Exception for daily --- source/bot.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/bot.py b/source/bot.py index 19779b6..3d4d580 100644 --- a/source/bot.py +++ b/source/bot.py @@ -539,10 +539,13 @@ def daily_message(message): iteration-=1 time.sleep(1) - product_for_today=find_todays_product_from_db() - bot.send_message(chat_id=user_id, text=str(hf.make_markdown_proof(product_for_today.image_link)), parse_mode="MARKDOWNV2") - start_time = time.time() - bot.register_next_step_handler((message,start_time), get_user_guess) + try: + product_for_today=find_todays_product_from_db() + bot.send_message(chat_id=user_id, text=str(hf.make_markdown_proof(product_for_today.image_link)), parse_mode="MARKDOWNV2") + start_time = time.time() + bot.register_next_step_handler((message,start_time), get_user_guess) + except Exception as e: + bot.send_message(chat_id=user_id, text=str(e)) def get_time_difference(start_time, end_time): """Get time difference