Closed Secreto31126 closed 1 month 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
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
npm run test
and lint the project withnpm run lint
andnpm run prettier
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 isheld_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 usingmessage.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 :)