Nishant Gour
Nishant Gour's Blog

Nishant Gour's Blog

WhatsApp Message Scheduler | Python Hacks | Automate WhatsApp

WhatsApp Message Scheduler | Python Hacks | Automate WhatsApp

Nishant Gour
·May 8, 2021·

2 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Video Tutorial

Introduction

In this blog, we are going to automate WhatsApp using Python pywhatkit module. We will guide you with the easiest way to use pywhatkit module which utilizes WhatsApp web to send automated WhatsApp messages using python. Python offers quite a wide range of libraries to help with our work. Pywhatkit is one of those libraries that will help in sending WhatsApp messages. It has several other features too:

  • Send WhatsApp message.

  • Convert text into human writing.

  • Play a YouTube video.

  • Perform a google search.

We are going to understand the scheduling for Whatsapp.

AUTOMATE WHATSAPP USING PYTHON

pip install pywhatkit

Prerequisite

  • Python Must be installed on your device.

  • Whatsapp web must be logged in not necessary if it is open or not.

  • Chrome Must be installed on your device.

Now the Coding Part

import pywhatkit as kit

cc = input("Enter the country Code")
phone = input("Enter the Whatsapp mobile number")
message = input("Enter The Message You Want to Send")
hour = int(input("Enter the hour"))
minute = int(input("Enter The Minute"))
x = cc+'+'+phone

kit.pywhatsend(x,message,hour,minute)
# Example kit.pywhatsend(91+anynumber,"Hi There",05,15)

In case you want to know about parameter which we have passed The parameters are

  • phone_num (required) - Phone number of the target with country code

  • message (required) - Message that you want to sendwhatmsg

  • time_hour (required) - Hours at which you want to send message in 24 hour format

  • time_min (required) - Minutes at which you want to send a message

  • wait_time (optional, val=20) - Seconds after which the message will be sent after

  • opening the web

  • print_waitTime (optional, val=True) - Will print the remaining time if set to true

At last Just Run Your Program It will automatically Open your chrome and web.whatsapp and will automatically send the text msg which you have passed through the function as a parameter.

If you liked it, Please Support Me

Resources

Did you find this article valuable?

Support Nishant Gour by becoming a sponsor. Any amount is appreciated!

See recent sponsors Learn more about Hashnode Sponsors