Merge 'upstream/master'

This commit is contained in:
Akamaru 2018-02-25 23:45:06 +01:00
commit 2d0a4b54d4

10
bot.py
View File

@ -340,6 +340,10 @@ def run_job(bot, job=None):
check_feed(bot, key) check_feed(bot, key)
def onerror(bot, update, error):
logger.error(error)
# Main function # Main function
def main(): def main():
# Setup the updater and show bot info # Setup the updater and show bot info
@ -364,6 +368,12 @@ def main():
for handler in handlers: for handler in handlers:
updater.dispatcher.add_handler(handler) updater.dispatcher.add_handler(handler)
# Hide "Error while getting Updates" because it's not our fault
updater.logger.addFilter((lambda log: not log.msg.startswith('Error while getting Updates:')))
# Fix for Python <= 3.5
updater.dispatcher.add_error_handler(onerror)
updater.job_queue.run_repeating( updater.job_queue.run_repeating(
run_job, run_job,
interval=60.0, interval=60.0,