WhiskeySockets / Baileys

Lightweight full-featured typescript/javascript WhatsApp Web API
https://baileys.whiskeysockets.io/
MIT License
3.1k stars 1.07k forks source link

[BUG] `messages.upsert` is not triggering when a new message came? even my bot send #892

Closed hacxk closed 1 week ago

hacxk commented 1 week ago

Title: [BUG] messages.upsert Event Not Triggering for Incoming Messages

I'm facing an issue where the crucial messages.upsert event is not firing consistently when new messages arrive in my WhatsApp bot. This is causing delays or even complete failures in my bot's ability to respond to user interactions.

Steps to Reproduce:

  1. Establish a new connection: The bot successfully connects to WhatsApp.
  2. Receive a message: A user or another contact sends a message to the bot.
  3. Event not triggered: The messages.upsert event handler is not called, or it is triggered with a significant delay.
  4. Consequence: My bot's logic to process and respond to the incoming message is not executed in a timely manner (or at all).

Expected Behavior:

When a new message is received by the bot, the messages.upsert event should fire immediately, providing the bot with the message data to process and respond accordingly.

Environment Details:

hacxk commented 1 week ago

i fIxed This Issue

Rippanteq7 commented 1 week ago

i fIxed This Issue

How you fixed it?

hacxk commented 1 week ago

by downgrading baileys to @6.7.4 and removing getMessage and Makeing sock to



 const sock = await makeWASocket({
            version: [2, 3000, 1014080102],
            printQRInTerminal: pairingOption === 'QR CODE',
            mobile: false,
            keepAliveIntervalMs: 10000,
            syncFullHistory: false,
            downloadHistory: false,
            markOnlineOnConnect: true,
            defaultQueryTimeoutMs: undefined,
            logger,
            Browsers: ['Hacxk-MD', 'Chrome', '113.0.5672.126'],
            auth: {
                creds: state.creds,
                keys: makeCacheableSignalKeyStore(state.keys, logger),
            },
            linkPreviewImageThumbnailWidth: 1980,
            generateHighQualityLinkPreview: true,
        });```
hacxk commented 1 week ago

i fIxed This Issue

How you fixed it?

also delete session and relogin with this sock connection still like that use a vpn and login