-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : Check if the given number is a whatsapp number #54
Conversation
sahalMoidu
commented
Feb 15, 2020
- Avoids sending message to non whatsapp number (as it may lead to blocking by whatsapp)
- Gets the id of the user from whatsapp server rather than generating on client
Implemented changes mentioned in SimiPrambos PR#28 (pedroslopez#52)
- Avoids sending message to non whatsapp number - Gets the id of the user from whatsapp server rather than generating on client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work fine, but error handling could be improved. Right now 404
is returned from within the browser, which isn't ideal.
Please throw the error on the nodejs side and/or make the error message clearer.
404 meaning the not found. Its the same message whatsapp sends back This is the first time I'm working with Puppeteer and I don't know the best way to pass the error to the nodejs side. Could you recommend one. |
It’s fine, you could still throw it on the chrome side but make it more descriptive. The 404 doesn’t really say what’s wrong, maybe something like “The number provided is not a registered WhatsApp user.” |
Have updated the error message. I too wanted to push the error directly to the node side so the user can better handle it. I think using emitting the error through events would be a better paradigm. |
Yeah we could do an event. We can address that in another pr or issue though. |
* feat : Check if the given number is a whatsapp number - Avoids sending message to non whatsapp number - Gets the id of the user from whatsapp server rather than generating on client