aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py
index 4651490a..d91664c9 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -34,6 +34,7 @@ import weakref
import aiohttp
from .errors import HTTPException, Forbidden, NotFound, LoginFailure, GatewayNotFound
+from .gateway import DiscordClientWebSocketResponse
from . import __version__, utils
log = logging.getLogger(__name__)
@@ -113,7 +114,7 @@ class HTTPClient:
def recreate(self):
if self.__session.closed:
- self.__session = aiohttp.ClientSession(connector=self.connector)
+ self.__session = aiohttp.ClientSession(connector=self.connector, ws_response_class=DiscordClientWebSocketResponse)
async def ws_connect(self, url, *, compress=0):
kwargs = {
@@ -279,7 +280,7 @@ class HTTPClient:
async def static_login(self, token, *, bot):
# Necessary to get aiohttp to stop complaining about session creation
- self.__session = aiohttp.ClientSession(connector=self.connector)
+ self.__session = aiohttp.ClientSession(connector=self.connector, ws_response_class=DiscordClientWebSocketResponse)
old_token, old_bot = self.token, self.bot_token
self._token(token, bot=bot)