aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorRapptz <[email protected]>2021-08-25 01:26:37 -0400
committerRapptz <[email protected]>2021-08-25 01:26:37 -0400
commit78598d59d7f006058a3e31ef7d6b21606b804c42 (patch)
treefaa59146a840b890e089f9275a2cfdec701a05ce /discord
parentExclude private functions from VoiceClient (diff)
downloaddiscord.py-78598d59d7f006058a3e31ef7d6b21606b804c42.tar.xz
discord.py-78598d59d7f006058a3e31ef7d6b21606b804c42.zip
Change on_socket_raw_receive to dispatch right before JSON conversion
Diffstat (limited to 'discord')
-rw-r--r--discord/gateway.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/gateway.py b/discord/gateway.py
index 87137695..aa0c6ba0 100644
--- a/discord/gateway.py
+++ b/discord/gateway.py
@@ -420,8 +420,6 @@ class DiscordWebSocket:
_log.info('Shard ID %s has sent the RESUME payload.', self.shard_id)
async def received_message(self, msg, /):
- self.log_receive(msg)
-
if type(msg) is bytes:
self._buffer.extend(msg)
@@ -430,6 +428,8 @@ class DiscordWebSocket:
msg = self._zlib.decompress(self._buffer)
msg = msg.decode('utf-8')
self._buffer = bytearray()
+
+ self.log_receive(msg)
msg = utils._from_json(msg)
_log.debug('For Shard ID %s: WebSocket Event: %s', self.shard_id, msg)