Ankit404butfound / PyWhatKit

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

Instant message to group gets error "'sleep_time' not defined" #211

Open NoamikoT opened 2 years ago

NoamikoT commented 2 years ago

Description

When trying to use the pywhatkit.sendwhatmsg_to_group_instantly() function, with correct params, I get an error saying:

Traceback (most recent call last):
  File "C:\Users\Noam\PycharmProjects\Whatsapp\Whatsappdo.py", line 4, in <module>
    pywhatkit.sendwhatmsg_to_group_instantly('XXXXXXXXXXXXXXXX', 'Test')
  File "C:\Users\Noam\PycharmProjects\Whatsapp\venv\lib\site-packages\pywhatkit\whats.py", line 128, in sendwhatmsg_to_group_instantly
    time.sleep(sleep_time)
NameError: name 'sleep_time' is not defined

https://stackoverflow.com/questions/72545794/pywhatkit-instant-message-to-group-gets-error-sleep-time-not-defined#comment128150880_72545794

To Reproduce

Copy the following code:

import pywhatkit

# syntax: phone number with country code, message
pywhatkit.sendwhatmsg_to_group_instantly('XXXXXXXXXXXXXXXX', 'Test')

Change the group code (XXXXXXXXXXXXXXXX) to a valid one then run it.

Version Information

ns23k commented 2 years ago

Try pip install git+https://github.com/Ankit404butfound/PyWhatKit.git@master