How To Create Whatsapp Bot Using Pywhatkit
How To Create Whatsapp Bot Using Pywhatkit
Pywhatkit
#2 Python Weekly
Sophia Iroegbu · Sep 30, 2021 · 3 min read
Hello there!
Today on Python weekly, We will be creating Whatsapp bot using pywhatkit.
Install PyWhatKit
This library can be installed by the pip command, open your command prompt,
and type in the following command.
COPY
import pywhatkit
Add DateTime module
The DateTime module supplies classes for manipulating dates and times. This is
a python package so no need to install it.
COPY
import pywhatkit
from DateTime import datetime
today = datetime.now()
COPY
shour = today.strftime("%H")
In the above program, %H is a format code. The strftime() method takes the
format code as an argument and returns a formatted string based on it.
%H: Is a format code for hour (24-hour clock) as a decimal number.
pywhatkit.sendwhatmsg(mobile_no,message,hour,minute)
import pywhatkit
from datetime import datetime
today = datetime.now()
shour = today.strftime("%H")
mobile_no = input('Enter Mobile Number of Receiver: ')
message = input('Enter Message you want to send : ')
hour = int(input('Enter hour : '))
minute = int(input('Enter minute : '))
pywhatkit.sendwhatmsg(mobile_no,message,hour,minute)
That's it, guys. You've just created your first Whatsapp bot using pywhatkit. I
know it's a funny name 😂
The project is on Github here is the link:
github.com/Sophyia7/whatsapp-bot.git, if you have any issues let me know.
Let's Connect
Thanks for staying till the end ❤️. Let's connect via
Email - [email protected]
Discord - Sophyia#8929
Subscribe to my newsletter
Read articles from Tekie's Corner directly inside
your inbox. Subscribe to the newsletter, and
don't miss out.
Follow
Tekie s Corner oo
Enter your email address SUBSCRIBE
Written by
Sophia Iroegbu Follow
Hello, I am a developer from Nigeria. I enjoy creating bespoke websites
and creating databases. Besides programming, I enjoy writing. I write
copies and articles. Some days, stories or poem.
ARTICLE SERIES
Python Weekly
Creating Your First Django Http Response
Apiviews
1 Hello There! 🌈 Today on Python Weekly, we would
be creating a REST API using Django for a book E-st…