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)