Ankit404butfound / PyWhatKit

Send WhatsApp message at certain time and many other things.
MIT License
1.33k stars 292 forks source link

Return status if cell number is invalid #42

Open obinakiller opened 3 years ago

obinakiller commented 3 years ago

Is there a way to return a status when the message was not sent? For example, the mobile number does not exist or is invalid or not a valid whatsapp number.

Thanks

Sem título .

aaryanrr commented 3 years ago

I dont think so that this is possible because there is no way you can determine wether a message has been sent or not. It would have been possible if there was an API. But i am not sure about this.

Ankit404butfound commented 3 years ago

I can create a flask API for that, only problem is that I don't have any spare numbers. Let's see what can be done.

aaryanrr commented 3 years ago

WhatsApp web shows this if the specified number is not found.

Screenshot (88) - Copy

So there must be a way to determine that this box popped up or not.

Ankit404butfound commented 3 years ago

WhatsApp web shows this if the specified number is not found.

Screenshot (88) - Copy

So there must be a way to determine that this box popped up or not.

Yes, we can simply call the source of the page page when there is this pop up and we can simply check if the source code contains "Phone number shared by url...". Only way of doing this is to use selenium and whatsapp doesn't allow this either so I need to keep it as a separate project so in case someone report it, I won't have to remove pywhatkit.

aaryanrr commented 3 years ago

Oh I see. Let's see if there is any other way because i can't find anything related to this.

obinakiller commented 3 years ago

I believe that this functionality would be very beneficial, as it would avoid not sending it due to human error, for example.

aaryanrr commented 3 years ago

@obinakiller Yes it would be beneficial. We are looking for a safe way to implement this.

ns23k commented 2 years ago

maybe we can take a screenshot at the time for sending message and use opencv for text recognition

ns23k commented 2 years ago

https://nanonets.com/blog/ocr-with-tesseract/ but it would take extra libraries

aaryanrr commented 2 years ago

I don't think so using OCR would be an efficient way to do this.

pellife commented 4 months ago

so, any updates about this? i'm having the same issue using pywhatkit and couldn't find any way to resolve it