Skip to content

Instantly share code, notes, and snippets.

@Logic2apply
Last active June 18, 2021 12:11
Show Gist options
  • Save Logic2apply/d6b08a54f764adf7bc4a6e62b7a464a0 to your computer and use it in GitHub Desktop.
Save Logic2apply/d6b08a54f764adf7bc4a6e62b7a464a0 to your computer and use it in GitHub Desktop.
Send Bulk messages on Whatsapp using Python.

Automate Whatsapp

This Python Program can send millions of whatsapp text messages at a time.

Installation

You wil require thes python packages as dependencies of this program.

Install it using pip

pip install PyAutoGUI==0.9.52
import pyautogui
import webbrowser as wb
import time
usrInp = int(input("\nSend Messages to:\n\t1. Chat\n\t2. Group\n: "))
if usrInp == 1:
countryCode = str(input("\nEnter Country Code:\n: "))
phoneNo = int(input("\nEnter Phone Number:\n: "))
phone = f"{countryCode}{phoneNo}"
url = f"https://web.whatsapp.com/send?phone={phone}"
elif usrInp == 2:
url = str(input("\nEnter Group URL:\n: "))
url = url.replace("https://chat.whatsapp.com/", "https://web.whatsapp.com/accept?code=") # Replaces the group invite link to whatsapp web link
else:
print("\nInvalid Input*`!!")
exit()
iterations = int(input("\nEnter No of Iterations:\n: "))
message = str(input("\nEnter Message:\n: "))
wb.open(url)
time.sleep(25)
for i in range(iterations+1):
msg = f"{i}. {message}"
pyautogui.write(msg)
pyautogui.press("enter")
print("\nYour Work Done...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment