salman0ansari / whatsapp-api-nodejs

RESTful WhatsApp API with Multiple Device Support
GNU General Public License v3.0
1.27k stars 606 forks source link

message read status update #775

Open xinkyo opened 1 year ago

xinkyo commented 1 year ago

here I have implement the code to get the funtion of message read status of webhook now you could get he message status update if it is deliver or read

src/api/class/instance.js line 318

sock?.ev.on('messages.update', async (messages) => {

console.log('messages.update')
 console.log(messages)
      if (
            ['all', 'messages', 'messages.update'].some((e) =>
                config.webhookAllowedEvents.includes(e)
            )
        )
    await this.SendWebhook('messageupdate', { 
       messages
    }, this.key);

})

salman0ansari commented 1 year ago

?

xinkyo commented 1 year ago

if message was delivered, webhook would get status=3, if message was read, status=4

LuisArteModelo commented 1 year ago

Yes @xinkyo, this webhook call is correct, but.. if the recipient is offline? How to ensure that the message was sent at least to the whatsapp "server"?