Secreto31126 / whatsapp-api-js

A TypeScript server agnostic Whatsapp's Official API framework
MIT License
128 stars 31 forks source link

Emitters update #334

Closed Secreto31126 closed 1 month ago

Secreto31126 commented 2 months ago

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

Tests

Based on #325, I decided to implement the requested changes with a different perspective.

The message_status property is still missing from my tests to the API, so I decided to implement it as an optional, and rather than asumming success, use it to indicate the user that the message is held_for_quality_assessment if the value says so.

On the other hand, the timestamp argument was added to the OnStatus emitter, which was not able to access it otherwise. OnMessage can read the property by using message.timestamp. OnSent has no way to know the timestamp, and using the client timestamp might be inconsistent with the API timezone, hence omitted.

Thanks @ekoeryanto for all the help! I tried to be as loyal to your original PR as I could, while also being consistent with the API. I will look into the package manager action eventually. Can't promise anything yet :)

github-actions[bot] commented 2 months ago

Visit the preview URL for this PR (updated for commit a657fe9):

https://whatsappapijs--pr334-emitters-update-gc7kd21e.web.app

(expires Sat, 25 May 2024 06:55:35 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 80a8dc4ceea5c783aae1d47b75797ee5b6c2f4be