0

I am using async version of python-telegram-bot lib 20+

persistence = PicklePersistence(filepath="pickle_persistence")
application = Application.builder().token(token).persistence(persistence).build()

application.job_queue.run_daily(task_function, time=time(hour=3, minute=0))

but in debuger i see than .job_queue exist but it is None seems like it's not init or something, can't find examples or docs how to add some daily job on startup in async version of library

in older versions of python-telegram-bot it was like this:

updater = Updater(settings.TOKEN)
updater.job_queue.run_repeating(task_function, interval=7 * 60, first=0)

1 Answer 1

1

In order to use the JobQueue, you'll have to install PTB with an optional dependency:

pip install "python-telegram-bot[job-queue]"

See also the readmes section on dependencies in PTB.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.