how to use AI ( Microsoft copilot) to write a python script to send a whats app message using the pywhatkit library.
Before you run the code below, please remember to do a 'pip install pywhatkit', logged into whatsapp web via the browser.
*If you have an issue around running it and then the script won't execute the Enter key, try to disconnect one of your multiple monitors. The script uses selenium to interact with the browser and if the cursor is on another monitor it won't pick up the active window.
**There is also an async version of this script under development (see discord) which will allow bulk message sending and also sending of images as well. This is a fairly new project.
Thanks!
Python library
https://pypi.org/project/pywhatkit/
Github
https://github.com/Ankit404butfound/P...
Discord (If you need help from the community).
/ discord
Script used in video:
Import the required modules
import pywhatkit as kit
import datetime
Get the current date and time
now = datetime.datetime.now()
Set the message content and the recipient's phone number
message = "Hello, this is a test message from Bing."
phone = "+0000000000" # Replace with the actual number
Send the message using pywhatkit
kit.sendwhatmsg(phone, message, now.hour, now.minute + 3) # Add 3 minutes to the current time
On this page of the site you can watch the video online 🐍Whatsapp messaging with Python! with a duration of hours minute second in good quality, which was uploaded by the user The Python Turtle 09 November 2023, share the link with friends and acquaintances, this video has already been watched 663 times on youtube and it was liked by 10 viewers. Enjoy your viewing!