From d5691c2bbb0349cc2bf349558f52f6e5b1f8470d Mon Sep 17 00:00:00 2001 From: Profitroll Date: Mon, 19 Feb 2024 23:07:38 +0100 Subject: [PATCH] Fixed scheduler-related issues --- classes/pycordbot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/classes/pycordbot.py b/classes/pycordbot.py index 973e7a2..4f770bf 100644 --- a/classes/pycordbot.py +++ b/classes/pycordbot.py @@ -14,6 +14,9 @@ class PycordBot(LibPycordBot): self.client_session = ClientSession() + if self.scheduler is None: + return + # Scheduler job for DHL parcel tracking self.scheduler.add_job( update_tracks_dhl, @@ -40,6 +43,8 @@ class PycordBot(LibPycordBot): async def close(self, *args: Any, **kwargs: Any) -> None: await self.client_session.close() - self.scheduler.shutdown() + + if self.scheduler is not None: + self.scheduler.shutdown() await super().close(*args, **kwargs)