File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments