import pywhatkit
import time
try:
# Send WhatsApp message
pywhatkit.sendwhatmsg(“+271xxxxxxx”, “Hi We are triallinggg the code to not only create but send automatically”, 15, 1
)
print("Message scheduled successfully.")
except Exception as e:
print(f”An error occurred: {e}”)
Wait to ensure the message is sent
This delay should be longer than the scheduled time to allow for message sending
time.sleep(60) # Adjust as needed
I am expecting the code to create the whatsapp and send it not only create it
New contributor
Andrew Templeton is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.