An NLP-based WhatsApp automation project built using Python for learning and demonstration purposes. This project combines automation, rule-based natural language processing (NLP), and emotion-aware response generation.
The goal of this project is to demonstrate how:
- Natural language input can be analyzed
- Emotions can be inferred from text
- Automated yet context-aware replies can be generated
- Messaging workflows can be automated responsibly for learning purposes
This project is not production-ready and is intended only for educational use.
-
Copy any incoming message text (e.g., from WhatsApp)
-
The system:
- Analyzes the text
- Detects the emotion using rule-based NLP
- Generates a contextual reply
-
The reply is automatically copied back to your clipboard
-
Paste the reply manually wherever required
📌 This assistant does not read WhatsApp messages directly.
- Sends the same message to multiple contacts
- Reads phone numbers from an Excel file (
.xlsx) - Uses WhatsApp Web automation
- Introduces random delays between messages to reduce spam-like behavior
📌 Intended strictly for testing and learning purposes.
This project uses rule-based NLP, not machine learning.
-
Keyword matching approach
-
Supported emotions:
- Happy
- Sad
- Stressed
- Excited
- Neutral (default)
If no emotion-related keywords are found, the message is marked as Neutral.
This design keeps the project:
- Lightweight
- Easy to understand
- Beginner-friendly
whatsapp_automation/
│
├── main.py
├── assistant.py
├── bulk_message.py
├── emotion_detection.py
├── reply.py
├── context_analyzer.py
├── requirements.txt
├── README.md
│
└── memory/
└── inbox.json
- Python 3.x
- Google Chrome
- WhatsApp Web account
pip install pyperclip pywhatkit openpyxl
or
pip install -r requirements.txt
📌 Make sure you are logged into WhatsApp Web at least once before running bulk messaging.
python main.py
You will see the following options:
- WhatsApp Bulk Messaging
- NLP Auto Reply Assistant
- Run Both
-
Choose option 2
-
Copy any message text
-
The system will:
- Detect emotion
- Generate a suggested reply
- Copy it to the clipboard
-
Paste the reply manually
Stop anytime using Ctrl + C
-
Create an Excel file (
.xlsx) -
Add phone numbers in Column A (without country code)
-
Choose option 1
-
Enter:
- Excel file path
- Message text
-
WhatsApp Web opens and sends messages automatically
🚫 WhatsApp Policy Warning
- Uses browser automation (not official APIs)
- May violate WhatsApp Terms of Service
- Can result in temporary or permanent bans
- Not fully automated
- Clipboard-based reply system
- Simple keyword-based NLP
- No ML or deep learning models
- Minimal error handling
- Not production-ready
This project is intended for:
- Learning Python automation
- Understanding basic NLP concepts
- Exploring chatbot logic
- College / academic submissions
- GitHub portfolio demonstrations
- ML-based or transformer-based emotion detection
- Context-aware multi-turn replies
- GUI or web interface
- Better memory handling
- Official messaging APIs
- Improved NLP preprocessing
This project is created strictly for educational purposes. The author is not responsible for misuse, WhatsApp bans, or policy violations.
⭐ If you find this project useful, feel free to star the repository and build on top of it!