fixed version whatsapp web for baileys

This commit is contained in:
Davidson Gomes
2024-05-21 08:38:08 -03:00
parent 65bba23519
commit 8fce53b4af
2 changed files with 32 additions and 7 deletions

View File

@@ -496,13 +496,24 @@ export class BaileysStartupService extends ChannelStartupService {
this.mobile = mobile;
}
const { version } = await fetchLatestBaileysVersion();
this.logger.verbose('Baileys version: ' + version);
const session = this.configService.get<ConfigSessionPhone>('CONFIG_SESSION_PHONE');
const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()];
this.logger.verbose('Browser: ' + JSON.stringify(browser));
let version;
let log;
if (session.VERSION) {
version = session.VERSION.split(',');
log = `Baileys version env: ${version}`;
} else {
const baileysVersion = await fetchLatestBaileysVersion();
version = baileysVersion.version;
log = `Baileys version: ${version}`;
}
this.logger.info(log);
let options;
if (this.localProxy.enabled) {
@@ -540,7 +551,7 @@ export class BaileysStartupService extends ChannelStartupService {
printQRInTerminal: false,
mobile,
browser: number ? ['Chrome (Linux)', session.NAME, release()] : browser,
version: [2, 2413, 1],
version,
markOnlineOnConnect: this.localSettings.always_online,
retryRequestDelayMs: 10,
connectTimeoutMs: 60_000,
@@ -671,10 +682,23 @@ export class BaileysStartupService extends ChannelStartupService {
try {
this.instance.authState = await this.defineAuthState();
// const { version } = await fetchLatestBaileysVersion();
const session = this.configService.get<ConfigSessionPhone>('CONFIG_SESSION_PHONE');
const browser: WABrowserDescription = [session.CLIENT, session.NAME, release()];
let version;
let log;
if (session.VERSION) {
version = session.VERSION.split(',');
log = `Baileys version env: ${version}`;
} else {
const baileysVersion = await fetchLatestBaileysVersion();
version = baileysVersion.version;
log = `Baileys version: ${version}`;
}
this.logger.info(log);
let options;
if (this.localProxy.enabled) {
@@ -711,7 +735,7 @@ export class BaileysStartupService extends ChannelStartupService {
logger: P({ level: this.logBaileys }),
printQRInTerminal: false,
browser: this.phoneNumber ? ['Chrome (Linux)', session.NAME, release()] : browser,
version: [2, 2413, 1],
version,
markOnlineOnConnect: this.localSettings.always_online,
retryRequestDelayMs: 10,
connectTimeoutMs: 60_000,