From 8175fd7b536ea763a8bfbf6ee528c73f9b79b540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannes=20H=C3=B6ke?= Date: Tue, 5 Jan 2016 13:39:51 +0100 Subject: [PATCH] update timerbot example --- examples/timerbot.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/examples/timerbot.py b/examples/timerbot.py index 0af15825e..eb401429c 100644 --- a/examples/timerbot.py +++ b/examples/timerbot.py @@ -18,7 +18,7 @@ Press Ctrl-C on the command line or send a signal to the process to stop the bot. """ -from telegram import Updater, JobQueue +from telegram import Updater import logging # Enable logging @@ -65,8 +65,8 @@ def error(bot, update, error): def main(): global job_queue - updater = Updater("TOKEN") - job_queue = JobQueue(updater.bot, tick_interval=1) + updater = Updater("148447715:AAFj2qskb3_sMMzlDhgTuoP7VAABNHpT0BU") + job_queue = updater.job_queue # Get the dispatcher to register handlers dp = updater.dispatcher @@ -79,9 +79,6 @@ def main(): # log all errors dp.addErrorHandler(error) - # start the job queue - job_queue.start() - # Start the Bot updater.start_polling() @@ -90,8 +87,5 @@ def main(): # start_polling() is non-blocking and will stop the bot gracefully. updater.idle() - # After that, also stop the job queue - job_queue.stop() - if __name__ == '__main__': main()