Python

How To Make WhatsApp Chat Bot With Python

1. Install PYAUTOGUI module.

code -

 pip install pyautogui

2. Make a folder, in that folder make two files “spam.txt” and “spam.py” (edit these files with notepad or you can use any code editor like visual studio code, pycharm, atom, etc.)

3. In “spam.txt” type messages like

code -
 hii 
 hello 
 how are you
 fine
 what are you doing
 where are you
 why are you

You can add more messages if you want 

4. Copy the below code and paste in “spam.py”

code -

import pyautogui
import time

time.sleep(10)
f = open("./spam.txt", "r")
for word in f:
    pyautogui.typewrite(word)

5. After that open web.whatsapp.com and login

6. After that, run the spam.py file and put your cursor on the “Type a Message” on web.whatsapp.com within the 10 seconds

Leave a Comment