Usually, my close friends WhatsApp me late at night regarding some work thinking that I'm awake and will reply before morning. Thus, I made this WhatsApp bot using selenium in Python which automatically responds to your close friend's text (if they send one) that you're sleeping and thus won't be able to reply before morning! Also, when you wake up, you'll know who texted you!
- Python 3.x with selenium installed
- Chrome Driver
Install Python from here: https://www.python.org/downloads/
Install Selenium Using command: pip install selenium
Install Chrome Driver:
-
Go to Customize and Control Google Chrome > Help > About Google Chrome to check the version of Chrome Driver.
-
Click on https://chromedriver.chromium.org/downloads and download the desired driver.
- Run the code.
- The code will automatically open Whatsapp Web in Chrome where you're supposed to scan the QR code.
- Sleep Well! :)
After every 5 minutes, the bot checks for every person you've specified in the closefriends list, that if there is any unread text from their side or not. If you've received one, then it replies with the message specified. Else does nothing.
- This is a bot for website verison of Whatsapp(Whatsapp Web) only, however we can extend it to the Desktop Application version too.
- The QR code needs to be scanned manually every time you run the code.
- Security concern is there as one is supposed to keep the Whatsapp Web open the whole night, however you can run the code and put the laptop on sleep mode the code will still run.