From 03608959e66e7fb6c4f25a7953cd78a77f8ebe96 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 7 Jul 2021 18:38:43 +0300 Subject: [PATCH] GramJs: Bring back `PingDelayDisconnect` --- src/lib/gramjs/client/TelegramClient.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/gramjs/client/TelegramClient.js b/src/lib/gramjs/client/TelegramClient.js index e1f8ac4e..54076937 100644 --- a/src/lib/gramjs/client/TelegramClient.js +++ b/src/lib/gramjs/client/TelegramClient.js @@ -195,8 +195,9 @@ class TelegramClient { try { await attempts(() => { - return timeout(this._sender.send(new requests.Ping({ + return timeout(this._sender.send(new requests.PingDelayDisconnect({ pingId: Helpers.getRandomInt(Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER), + disconnectDelay: PING_DISCONNECT_DELAY, })), PING_TIMEOUT); }, PING_FAIL_ATTEMPTS, PING_FAIL_INTERVAL); } catch (err) {