GramJS: Support CONNECTION_NOT_INITED in all requests (#3066)

This commit is contained in:
Alexander Zinchuk 2023-04-25 17:24:36 +04:00
parent f2ab2269d7
commit fab245cc83

View File

@ -904,6 +904,10 @@ class TelegramClient {
} else if (e instanceof errors.MsgWaitError) {
// we need to resend this after the old one was confirmed.
await promise.isReady();
} else if (e.message === 'CONNECTION_NOT_INITED') {
await this.disconnect();
await sleep(2000);
await this.connect();
} else {
throw e;
}