X Tutup
Skip to content

Commit 8175fd7

Browse files
committed
update timerbot example
1 parent 2875bae commit 8175fd7

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

examples/timerbot.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
bot.
1919
"""
2020

21-
from telegram import Updater, JobQueue
21+
from telegram import Updater
2222
import logging
2323

2424
# Enable logging
@@ -65,8 +65,8 @@ def error(bot, update, error):
6565
def main():
6666
global job_queue
6767

68-
updater = Updater("TOKEN")
69-
job_queue = JobQueue(updater.bot, tick_interval=1)
68+
updater = Updater("148447715:AAFj2qskb3_sMMzlDhgTuoP7VAABNHpT0BU")
69+
job_queue = updater.job_queue
7070

7171
# Get the dispatcher to register handlers
7272
dp = updater.dispatcher
@@ -79,9 +79,6 @@ def main():
7979
# log all errors
8080
dp.addErrorHandler(error)
8181

82-
# start the job queue
83-
job_queue.start()
84-
8582
# Start the Bot
8683
updater.start_polling()
8784

@@ -90,8 +87,5 @@ def main():
9087
# start_polling() is non-blocking and will stop the bot gracefully.
9188
updater.idle()
9289

93-
# After that, also stop the job queue
94-
job_queue.stop()
95-
9690
if __name__ == '__main__':
9791
main()

0 commit comments

Comments
 (0)
X Tutup