mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Restart client after receiving unknown constructor
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
4e2d553f35
commit
01e200e8ce
1 changed files with 13 additions and 8 deletions
|
|
@ -190,14 +190,19 @@ class Session:
|
|||
await self.start()
|
||||
|
||||
async def handle_packet(self, packet):
|
||||
data = await self.loop.run_in_executor(
|
||||
pyrogram.crypto_executor,
|
||||
mtproto.unpack,
|
||||
BytesIO(packet),
|
||||
self.session_id,
|
||||
self.auth_key,
|
||||
self.auth_key_id
|
||||
)
|
||||
try:
|
||||
data = await self.loop.run_in_executor(
|
||||
pyrogram.crypto_executor,
|
||||
mtproto.unpack,
|
||||
BytesIO(packet),
|
||||
self.session_id,
|
||||
self.auth_key,
|
||||
self.auth_key_id
|
||||
)
|
||||
except ValueError as e:
|
||||
log.debug(e)
|
||||
self.loop.create_task(self.restart())
|
||||
return
|
||||
|
||||
messages = (
|
||||
data.body.messages
|
||||
|
|
|
|||
Loading…
Reference in a new issue