I am trying to setup a bot that sends messages every hour, I tried everything I found in google and here in stack overflow, but can't seem to make job queue work. Here is my code, I pretty much took it from official python-telegram-bot git hub. Here is the code, any help is highly appreciated.
from telegram.ext import Updater
u = Updater('bot_token', use_context=True)
j = u.job_queue
def callback_minute(context):
context.bot.send_message(chat_id='my_chat_id', text='One message every minute')
job_minute = j.run_repeating(callback_minute, interval=10)
u.start_polling()
u.idle()
This is traceback I am getting
Error submitting job "callback_minute (trigger: interval[0:00:10], next run at: 2021-09-06 08:50:47 UTC)" to executor "default"
Traceback (most recent call last):
File "C:\Users\aeriu\AppData\Local\Programs\Python\Python39\lib\site-packages\apscheduler\schedulers\base.py", line 974, in _process_jobs
executor.submit_job(job, run_times)
File "C:\Users\aeriu\AppData\Local\Programs\Python\Python39\lib\site-packages\apscheduler\executors\base.py", line 71, in submit_job
self._do_submit_job(job, run_times)
File "C:\Users\aeriu\AppData\Local\Programs\Python\Python39\lib\site-packages\apscheduler\executors\pool.py", line 22, in _do_submit_job
f = self._pool.submit(run_job, job, job._jobstore_alias, run_times, self._logger.name)
File "C:\Users\aeriu\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\thread.py", line 163, in submit
raise RuntimeError('cannot schedule new futures after '
RuntimeError: cannot schedule new futures after interpreter shutdown