feat: Get the registered chat id in whatsapp #421
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Get the registered chat id in whatsapp.
Reason?
I'll show it in codes:
Using my phone number, the actual
client.isRegisteredUser()
return true for the valid and the invalid chatId, you guys can check there:The numbers are different, the 5548991581407 is the new rule, but in WhatsApp it doesn't exists, so I have to send the message to the old one, without this additional 9.
So, to keep the compability and resolve this problem, with some help from @guicuton I created this function at client.js:
I dont know if other countries has this problem, but in Brazil we have, and it prevent from future problems to another countries too.