تثبيت إصدار واتساب ويب مستقر لحل مشكلة فشل الربط
This commit is contained in:
@@ -57,15 +57,9 @@ async function startSession(session_key, webhook_url) {
|
||||
const sessionFolder = path.join(SESSIONS_DIR, session_key);
|
||||
const { state, saveCreds } = await useMultiFileAuthState(sessionFolder);
|
||||
|
||||
// Fetch the latest WhatsApp Web version to avoid 405 rejection
|
||||
let version;
|
||||
try {
|
||||
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`);
|
||||
}
|
||||
// Use a hardcoded stable version to prevent parsed timestamp version errors which reject pairing
|
||||
const version = [2, 3000, 1017, 0];
|
||||
console.log(`[Baileys] Using stable WA version: ${version}`);
|
||||
|
||||
const logger = pino({ level: 'silent' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user