RuntimeError: No application was set for this JobQueue. #3725
-
Greetings! Firstly, i need to thank the work that the team are developing in the time. It's great value. I'm work to actual a bot that verify the server and the network at a university in Brasil. For this, in terms of code, i use the class JobQueue.run_daily, together with the appropriate parameters defined in the documentation. But, by running the code, i receive this error:
Note: bot_admin.ExecAutoCommands() contains the JobQueue.run_daily. To underestend the class, i discovered that a variable (self._application) recive None and it isn't modified to the long of the code. _jobqueue.py: [...]
def __init__(self) -> None:
[...]
self._application: "Optional[weakref.ReferenceType[Application]]" = None
[...]
def application(self) -> "Application":
"""The application this JobQueue is associated with."""
if self._application is None:`
raise RuntimeError("No application was set for this JobQueue.")
[...]`
def run_daily
[...]
j = self.scheduler.add_job(
[...]
args=(self.application,),
[...] By investigatin this such error in the web, i not found nothing in this regasd. I think it's current by codumentation, even tough i have reviewd. I think i'm using the class in the wrong way. Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
Please see here, here and the "Important" note here.