diff --git a/lib/api/telegram/client.js b/lib/api/telegram/client.js index 1bedb2db8..39e271f94 100644 --- a/lib/api/telegram/client.js +++ b/lib/api/telegram/client.js @@ -15,7 +15,7 @@ export default class TelegramClientApi extends TelegramClient { #connectMutex = new Mutex(); #disconnectMutex = new Mutex(); - constructor ( { apiId, apiHash, session, deviceModel, appVersion, connectionRetries = 5, logLevel, ...options } = {} ) { + constructor ( { apiId, apiHash, session, deviceModel, appVersion, connectionRetries = 5, logLevel, connect, ...options } = {} ) { const stringSession = new StringSession( session ); super( stringSession, apiId, apiHash, { @@ -30,6 +30,8 @@ export default class TelegramClientApi extends TelegramClient { // "langPack": "", // "systemLangCode": clientParams.systemLangCode, } ); + + if ( connect ) this.connect(); } // properties