mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-20 02:06:43 -06:00
fixed version whatsapp web for baileys
This commit is contained in:
parent
65bba23519
commit
8fce53b4af
@ -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,
|
||||
|
@ -155,7 +155,7 @@ export type CacheConfLocal = {
|
||||
};
|
||||
export type SslConf = { PRIVKEY: string; FULLCHAIN: string };
|
||||
export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook };
|
||||
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
|
||||
export type ConfigSessionPhone = { CLIENT: string; NAME: string; VERSION: string };
|
||||
export type QrCode = { LIMIT: number; COLOR: string };
|
||||
export type Typebot = { API_VERSION: string; KEEP_OPEN: boolean };
|
||||
export type Chatwoot = {
|
||||
@ -360,6 +360,7 @@ export class ConfigService {
|
||||
CONFIG_SESSION_PHONE: {
|
||||
CLIENT: process.env?.CONFIG_SESSION_PHONE_CLIENT || 'Evolution API',
|
||||
NAME: process.env?.CONFIG_SESSION_PHONE_NAME || 'Chrome',
|
||||
VERSION: process.env?.CONFIG_SESSION_PHONE_VERSION || null,
|
||||
},
|
||||
QRCODE: {
|
||||
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,
|
||||
|
Loading…
Reference in New Issue
Block a user