diff --git a/discord/client.py b/discord/client.py index d92b568a0..13f00220b 100644 --- a/discord/client.py +++ b/discord/client.py @@ -666,7 +666,7 @@ class Client: self._closed = False self._ready.clear() self._connection.clear() - self.http.recreate() + self.http.clear() async def start(self, token: str, *, reconnect: bool = True) -> None: """|coro| diff --git a/discord/http.py b/discord/http.py index c06865f9f..5f011eb71 100644 --- a/discord/http.py +++ b/discord/http.py @@ -351,11 +351,9 @@ class HTTPClient: user_agent = 'DiscordBot (https://github.com/Rapptz/discord.py {0}) Python/{1[0]}.{1[1]} aiohttp/{2}' self.user_agent: str = user_agent.format(__version__, sys.version_info, aiohttp.__version__) - def recreate(self) -> None: - if self.__session.closed: - self.__session = aiohttp.ClientSession( - connector=self.connector, ws_response_class=DiscordClientWebSocketResponse - ) + def clear(self) -> None: + if self.__session and self.__session.closed: + self.__session = MISSING async def ws_connect(self, url: str, *, compress: int = 0) -> aiohttp.ClientWebSocketResponse: kwargs = {