mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 03:42:23 -06:00
feat(whatsapp): implement fetchLatestWaWebVersion utility and update version fetching logic
- Added a new utility function `fetchLatestWaWebVersion` to retrieve the latest WhatsApp Web version. - Updated the Baileys service and router to utilize the new function instead of the deprecated `fetchLatestBaileysVersion`, ensuring accurate version information is fetched for WhatsApp integration. - This change enhances the reliability of version management in the application.
This commit is contained in:
@@ -80,6 +80,7 @@ import { Boom } from '@hapi/boom';
|
||||
import { createId as cuid } from '@paralleldrive/cuid2';
|
||||
import { Instance, Message } from '@prisma/client';
|
||||
import { createJid } from '@utils/createJid';
|
||||
import { fetchLatestWaWebVersion } from '@utils/fetchLatestWaWebVersion';
|
||||
import { makeProxyAgent } from '@utils/makeProxyAgent';
|
||||
import { getOnWhatsappCache, saveOnWhatsappCache } from '@utils/onWhatsappCache';
|
||||
import { status } from '@utils/renderStatus';
|
||||
@@ -99,7 +100,6 @@ import makeWASocket, {
|
||||
delay,
|
||||
DisconnectReason,
|
||||
downloadMediaMessage,
|
||||
fetchLatestBaileysVersion,
|
||||
generateWAMessageFromContent,
|
||||
getAggregateVotesInPollMessage,
|
||||
GetCatalogOptions,
|
||||
@@ -548,7 +548,7 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
version = session.VERSION.split('.');
|
||||
log = `Baileys version env: ${version}`;
|
||||
} else {
|
||||
const baileysVersion = await fetchLatestBaileysVersion();
|
||||
const baileysVersion = await fetchLatestWaWebVersion({});
|
||||
version = baileysVersion.version;
|
||||
log = `Baileys version: ${version}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user