JungDev / django-telegrambot

Simple app for Telegram bot in Django
BSD 3-Clause "New" or "Revised" License
237 stars 88 forks source link

job_queue is none when using webhook mode #22

Open nisests opened 6 years ago

nisests commented 6 years ago

Set pass_job_queue to true, my task can run normally in polling mode, but the job_queue passed in webhook mode is none.

django-telegrambot==1.0.1 python-telegram-bot==10.1.0

alisher-matkurbanov commented 5 years ago

I think it's not actual but there is solution. You need to explicitly initialize and start JobQueue

dp = DjangoTelegramBot.getDispatcher('bot_username')
dp.job_queue = JobQueue(DjangoTelegramBot.getBot('bot_username'))
# add jobs here
dp.job_queue.start()