is there any other way to solve automation of whatsapp message?

Viewed 345

I have typed this code in VS code using the base interpreter 'conda' i.e., miniconda 3

import pywhatkit

pywhatkit.sendwhatmsg("xxxxxxxx", " good morning from python",10,00) x is the phone number

The problem is, all it does is load the message in WhatsApp's textbox, it does not send. Is something wrong with my program or need to install something else?

4 Answers

I had the same issue, I found that it is needed to set an enough interval of time between the executed code and the time that whatsapp web gets fully open to paste the message and send it, try with at least 30 seconds or more (wait_time = 30 or more). Otherwise "trigger is pulled before bullet is in site"

You are using 00 as leading zeros in decimal integer literals are not permitted. use an 0o prefix for octal integers Or Start your time with a number other than 0

I'm using this code for send message it will send message in one minutes from current time and it will wail 20 second and send the message

import threading
import pywhatkit
import datetime
now = datetime.datetime.now()
hur = now.hour
min = now.minute

print(hur)
print(min+1)
pywhatkit.sendwhatmsg('+number', 'SENDING MESSAGE', now.hour,min+1)
import pyautogui #importing the gui for mouse 
import time 
import pywhatkit #python WhatsApp package

# time.sleep(12)  #to wait for sometime after the webwhatapp is opened and able to get the positon of trigger button 
# print(pyautogui.position())


# Here I had found the position of trigger button of web whats app 
pywhatkit.sendwhatmsg("+91 70029XXXX","hello bro",0,42)
#You are advice to to change the time and number so to message your desired number 
time.sleep(5)
pyautogui.click(1240,640)  #this click the trigger button so our message which was in textbox able to send the message 
Related