Ankit404butfound / PyWhatKit

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

Tried to send message but the web is going to be opned in 24 hours! #48

Closed MeritEhab closed 3 years ago

MeritEhab commented 3 years ago

Hi, I tried to use your package in my code to send a whatsapp message but when I run the server local and try my request to post man which will call his line from your package pywhatkit.sendwhatmsg("+201001234567",report.content,datetime.datetime.now().hour, datetime.datetime.now().minute)

it gives me this in the console

image

Am I really going to wait for 24 hours for this to test?! I read the code and I saw that you set the left time with 86400 at some point, but I am not sure if this configurable or not Could you please let me know if I am using this correctly or if there is something I am missing here?

Ankit404butfound commented 3 years ago

Your time should be atleast 20 seconds ahead of current time. What is happening above is that when you send the request, it subtracts the time provided from the local time and do the operation after those seconds. But here because of the now().minute the time that is being passed may be 14:50:00 while the actual time might be 14:50:24.

Try now().minute + 1.

MeritEhab commented 3 years ago

Thank you so much for your help and your fast reply it did work when I set my time ahead of now with a couple of minutes

Thanks, I believe we can close the issue if you would like

Ankit404butfound commented 3 years ago

Glad to hear that, I am closing the issue. Thanks for being a user of PyWhatKit. 😄