mirror of
https://github.com/MelisaDev/melisa.git
synced 2024-11-11 19:07:28 +03:00
maybe it should fix zlib.error: Error -3 while decompressing data: invalid stored block lengths
This commit is contained in:
parent
7100a3c6cb
commit
6723407f9a
1 changed files with 11 additions and 8 deletions
|
@ -107,6 +107,7 @@ class Gateway:
|
||||||
await self.ws.send_str(payload)
|
await self.ws.send_str(payload)
|
||||||
|
|
||||||
async def parse_websocket_message(self, msg):
|
async def parse_websocket_message(self, msg):
|
||||||
|
try:
|
||||||
if type(msg) is bytes:
|
if type(msg) is bytes:
|
||||||
self._buffer.extend(msg)
|
self._buffer.extend(msg)
|
||||||
|
|
||||||
|
@ -117,6 +118,8 @@ class Gateway:
|
||||||
self._buffer = bytearray()
|
self._buffer = bytearray()
|
||||||
|
|
||||||
return json.loads(msg)
|
return json.loads(msg)
|
||||||
|
except zlib.error:
|
||||||
|
return None
|
||||||
|
|
||||||
async def handle_data(self, data):
|
async def handle_data(self, data):
|
||||||
if data['op'] == self.DISPATCH:
|
if data['op'] == self.DISPATCH:
|
||||||
|
|
Loading…
Reference in a new issue