WhatsApp Automation : Easy Python code for beginners

0

       WhatsApp automation 

Introduction:-

Dear coders today we gonna build a Whatsapp automation project which can be extremely useful, whether it be your girlfriend's birthday and you have to wish her exactly at 12 am this may help you or you own a company that provides services over the internet using WhatsApp. 

This project is beginner-friendly cause we are not going to integrate any API in our Project, So let's get straight into the algorithm for WhatsApp automation.

The major thing that you have to understand in this WhatsApp automation process is it's all the game of time and a small role of module "PYWHATKIT", This module will automatically open whatsapp.com prior 20sec and send the message exactly at the time you specified and do remember to specify the time in 24 format, for those who are new to our site let me tell you guys that we have already covered a major project of a Smart assistant "JARVIS", and we used this piece of code there to which make Jarvis send messages on our command. 

So first you have to install PYWHATKIT using -pip, once you did this, Import it into your project. Now make some variables to store the receiver's phone number and time to send the message. Once you did this use sendwhatmsg function of the module to execute the function, do remember to write the counter automation function in the case code fails if you get any bugs, check the code below. Do share !!!

elif 'send a whatsapp message' in query:
            try:
                speak("What should I say sir?")
                content = takeCommand()
                to =('+919981321049')
                speak( "mention the hours please")

                time_hour = int(takeCommand())
                speak("mention the minutes")
                time_min = int(takeCommand())
                pywhatkit.sendwhatmsg(to, content,time_hour,time_min)
                speak("message has been sent!")
            except Exception as e:
                print(e)
                speak("Sorry sir . I am not able to send this message")


Post a Comment

0 Comments
Post a Comment (0)
To Top