تثبيت إصدار واتساب ويب مستقر لحل مشكلة فشل الربط
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 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' });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user