devlikeapro / waha

WAHA - WhatsApp HTTP API (REST API) that you can configure in a click! Two engines: chromium-based WEBJS and pure-websocket NOWEB
https://waha.devlike.pro/
Apache License 2.0
878 stars 273 forks source link

[feature] message delete webhook events not received #190

Closed ehussain closed 10 months ago

ehussain commented 12 months ago

Hello,

We would like to receive 'message.delete' ack event when someone deletes a message from their whatsapp phone. Event is important for us to know if sent message was deleted by user, and our system should get the webhook and should get updated of such actions.

allburov commented 11 months ago

@ehussain hi! just to make sure it doesn't work - you mentioned here https://github.com/devlikeapro/whatsapp-http-api/issues/209

We receive a delete webhook for messages sent by client (any incoming message)

Does it mean that message.any covers message.delete event case? Or I misunderstood it...

ehussain commented 11 months ago

Hello @allburov .

I tested this morning only, we have subscribed to 'message.any' event but still we are not receiving any webhook for delete case. It seems I mistakenly wrote about delete webhook.

So as per my understanding and testing. I can say that neither 'delete' api is available nor we are receiving the delete webhook for any messages which is deleted by client.

allburov commented 10 months ago

Added new message.revoked event in 2023.10.12 (Plus yet)


message.revoked

The message.revoked event is triggered when a user, whether it be you or any other participant, revokes a previously sent message.

{
  "event": "message.ack",
  "session": "default",
  "payload": {
    "before": {
      "id": "some-id-here",
      "timestamp": "some-timestamp-here",
      "body": "Hi there!"
    },
    "after": {
      "id": "some-id-here",
      "timestamp": "some-timestamp-here",
      "body": ""
    }
  }
}

Important notes:

  1. The above messages' ids don't match any of the ids you'll receive in the message event, it's a different id.
  2. In order to find the message that was revoked, you'll need to search for the message with the same timestamp and chat id as the one in the after object.
  3. before field can be null in some cases.