Skip to content

Commit b34fbfd

Browse files
committed
fix: make sure Client._http is not a string
1 parent 4eeb138 commit b34fbfd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

interactions/client/bot.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ async def _stop(self) -> None:
486486
self._websocket._closing_lock.set() # Toggles the "ready-to-shutdown" state for the bot.
487487
# And subsequently, the processes will close itself.
488488

489-
await self._http._req._session.close() # Closes the HTTP session associated with the client.
489+
if isinstance(self._http, HTTPClient):
490+
await self._http._req._session.close() # Closes the HTTP session associated with the client.
490491

491492
async def _login(self) -> None:
492493
"""Makes a login with the Discord API."""
@@ -1620,7 +1621,8 @@ async def request_guild_members(
16201621

16211622
async def _logout(self) -> None:
16221623
await self._websocket.close()
1623-
await self._http._req.close()
1624+
if isinstance(self._http, HTTPClient):
1625+
await self._http._req.close()
16241626

16251627
async def wait_for(
16261628
self,

0 commit comments

Comments
 (0)