This commit is contained in:
Profitroll 2024-08-10 14:19:40 +02:00
parent 0b0ca6b832
commit 450476c8a8
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
2 changed files with 8 additions and 3 deletions

View File

@ -57,7 +57,7 @@ class PyroClient(PyroClient):
self.config["bot"]["owner"] self.config["bot"]["owner"]
] ]
self.sender_session = ClientSession() self.sender_session: Union[ClientSession, None] = None
self.scopes_placeholders: Dict[str, int] = { self.scopes_placeholders: Dict[str, int] = {
"owner": self.owner, "owner": self.owner,
@ -67,6 +67,9 @@ class PyroClient(PyroClient):
async def start(self): async def start(self):
await super().start() await super().start()
if self.sender_session is None:
self.sender_session = ClientSession()
if self.config["reports"]["update"]: if self.config["reports"]["update"]:
try: try:
async with ClientSession( async with ClientSession(
@ -134,7 +137,9 @@ class PyroClient(PyroClient):
) )
await http_session.close() await http_session.close()
await self.sender_session.close()
if self.sender_session is not None:
await self.sender_session.close()
await super().stop() await super().stop()

View File

@ -1,4 +1,4 @@
aiohttp~=3.9.1 aiohttp~=3.10.2
async_pymongo==0.1.6 async_pymongo==0.1.6
convopyro==0.5 convopyro==0.5
pillow~=10.4.0 pillow~=10.4.0