تثبيت إصدار واتساب ويب مستقر لحل مشكلة فشل الربط

This commit is contained in:
Hamza-Ayed
2026-05-23 17:05:57 +03:00
parent 2d72019bbb
commit d8fa9051c2

View File

@@ -57,15 +57,9 @@ async function startSession(session_key, webhook_url) {
const sessionFolder = path.join(SESSIONS_DIR, session_key); const sessionFolder = path.join(SESSIONS_DIR, session_key);
const { state, saveCreds } = await useMultiFileAuthState(sessionFolder); const { state, saveCreds } = await useMultiFileAuthState(sessionFolder);
// Fetch the latest WhatsApp Web version to avoid 405 rejection // Use a hardcoded stable version to prevent parsed timestamp version errors which reject pairing
let version; const version = [2, 3000, 1017, 0];
try { console.log(`[Baileys] Using stable WA version: ${version}`);
const versionInfo = await fetchLatestBaileysVersion();
version = versionInfo.version;
console.log(`[Baileys] Using WA version: ${version}`);
} catch (e) {
console.warn(`[Baileys] Could not fetch version, using default`);
}
const logger = pino({ level: 'silent' }); const logger = pino({ level: 'silent' });