Restart client after receiving unknown constructor

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
KurimuzonAkuma 2024-09-04 10:48:29 +03:00 committed by wulan17
parent 4e2d553f35
commit 01e200e8ce
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -190,14 +190,19 @@ class Session:
await self.start() await self.start()
async def handle_packet(self, packet): async def handle_packet(self, packet):
data = await self.loop.run_in_executor( try:
pyrogram.crypto_executor, data = await self.loop.run_in_executor(
mtproto.unpack, pyrogram.crypto_executor,
BytesIO(packet), mtproto.unpack,
self.session_id, BytesIO(packet),
self.auth_key, self.session_id,
self.auth_key_id self.auth_key,
) self.auth_key_id
)
except ValueError as e:
log.debug(e)
self.loop.create_task(self.restart())
return
messages = ( messages = (
data.body.messages data.body.messages