From b34fbfd1f7eac68b076e2679c787a165e2ef4b26 Mon Sep 17 00:00:00 2001 From: Damego Date: Sun, 22 Jan 2023 13:30:39 +0500 Subject: [PATCH] fix: make sure `Client._http` is not a string --- interactions/client/bot.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interactions/client/bot.py b/interactions/client/bot.py index ef6898431..bc3fc35ca 100644 --- a/interactions/client/bot.py +++ b/interactions/client/bot.py @@ -486,7 +486,8 @@ async def _stop(self) -> None: self._websocket._closing_lock.set() # Toggles the "ready-to-shutdown" state for the bot. # And subsequently, the processes will close itself. - await self._http._req._session.close() # Closes the HTTP session associated with the client. + if isinstance(self._http, HTTPClient): + await self._http._req._session.close() # Closes the HTTP session associated with the client. async def _login(self) -> None: """Makes a login with the Discord API.""" @@ -1620,7 +1621,8 @@ async def request_guild_members( async def _logout(self) -> None: await self._websocket.close() - await self._http._req.close() + if isinstance(self._http, HTTPClient): + await self._http._req.close() async def wait_for( self,