From b008d07c48c19d5f22119afd15c0607c14abb156 Mon Sep 17 00:00:00 2001 From: Andrey Date: Mon, 3 Jun 2024 19:49:46 +0300 Subject: [PATCH] some fixes --- voice_bot.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/voice_bot.py b/voice_bot.py index d441245..eaa3834 100644 --- a/voice_bot.py +++ b/voice_bot.py @@ -303,16 +303,14 @@ def telegram_bot(): if __name__ == '__main__': telegram_bot() - try: - bot.polling(none_stop=True) - bot.enable_save_next_step_handlers(delay=2) - bot.load_next_step_handlers() - except ConnectionError as e: - if LOGS: - bot.send_message(IMPORTANT_LOGS, "Ошибка соединения, потерял войс бот связь") - except Exception as r: - if LOGS: - bot.send_message(IMPORTANT_LOGS, "Произошло что-то непредвиденное, хелп. Войс бот болеет") - finally: - if LOGS: - bot.send_message(IMPORTANT_LOGS, 'Я войс бот упал, помогите') \ No newline at end of file + while True: + try: + bot.polling(none_stop=True) + bot.enable_save_next_step_handlers(delay=2) + bot.load_next_step_handlers() + except ConnectionError as e: + if LOGS: + bot.send_message(IMPORTANT_LOGS, "Ошибка соединения, потерял войс бот связь") + except Exception as r: + if LOGS: + bot.send_message(IMPORTANT_LOGS, "Произошло что-то непредвиденное, хелп. Войс бот болеет") \ No newline at end of file