Skip to content

Commit

Permalink
Added KeyboardInterrupt exception handler. Updated deprecated method …
Browse files Browse the repository at this point in the history
…on Telebot lib
  • Loading branch information
dmcallejo committed Sep 11, 2024
1 parent d523067 commit 90fb35c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ def replace_html_entities(message: str):

try:
LOG.debug("Polling started")
bot.polling(none_stop=True)
bot.infinity_polling()
except KeyboardInterrupt:
LOG.info("Exiting...")
exit(0)
except Exception as e:
LOG.exception(e)
LOG.critical(str(e))

0 comments on commit 90fb35c

Please sign in to comment.