mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +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()
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue