{"id":30997485,"url":"https://github.com/codedbyasim/whatsapp-bot","last_synced_at":"2026-04-10T15:06:42.255Z","repository":{"id":311768385,"uuid":"1044931785","full_name":"codedbyasim/WhatsApp-Bot","owner":"codedbyasim","description":"A smart WhatsApp bot with tone-aware replies in Roman Urdu, group management tools, and LLM-powered features via Google Gemini API + Flask.","archived":false,"fork":false,"pushed_at":"2025-08-26T12:27:50.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-26T16:37:27.544Z","etag":null,"topics":["chatbot","flask","gemini-api","nodejs","python","whatsapp-bot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codedbyasim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-26T12:12:12.000Z","updated_at":"2025-08-26T12:27:53.000Z","dependencies_parsed_at":"2025-08-26T16:47:57.831Z","dependency_job_id":"dd7a3f97-5e68-4155-bf28-33d65efe0acd","html_url":"https://github.com/codedbyasim/WhatsApp-Bot","commit_stats":null,"previous_names":["codedbyasim/whatsapp-bot"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codedbyasim/WhatsApp-Bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedbyasim%2FWhatsApp-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedbyasim%2FWhatsApp-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedbyasim%2FWhatsApp-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedbyasim%2FWhatsApp-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codedbyasim","download_url":"https://codeload.github.com/codedbyasim/WhatsApp-Bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codedbyasim%2FWhatsApp-Bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274892113,"owners_count":25369267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chatbot","flask","gemini-api","nodejs","python","whatsapp-bot"],"created_at":"2025-09-12T23:01:07.943Z","updated_at":"2025-12-30T21:24:24.623Z","avatar_url":"https://github.com/codedbyasim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌟 Tone-Aware WhatsApp Bot 🤖\n\nA **sophisticated WhatsApp bot** designed to enhance group interactions and automate tasks.  \nIt features **tone-aware replies**, **Roman Urdu language generation**, **group management commands**, and integrates a **Python Flask server** for advanced Large Language Model (LLM) capabilities using **Google’s Gemini API**.\n\n---\n\n## ✨ Features\n\n### 🎭 Tone \u0026 Fun  \n\n✔ Tone-aware replies (funny, chill, serious) in Roman Urdu  \n✔ `!joke` → Sends a short joke  \n✔ `!fact` → Provides an interesting fact  \n✔ `!roast @user` → Light-hearted roast for a tagged user  \n✔ `!quote` → Motivational or funny quote  \n\n### 👥 Group Management  \n\n✔ `!tagall` or `!tag [message]` → Tags all group members  \n✔ `!spam [@user] \"\u003cmessage\u003e\" \u003ccount\u003e` → Sends a message multiple times (max 20)  \n✔ `Stop @[BotName]` → Stops spam (only by initiator)  \n\n### 🛠 Utilities  \n\n✔ `!mood` → Analyzes recent group messages \u0026 reports mood  \n✔ `!news` → Fetches \u0026 summarizes today’s top 5 news (Roman Urdu, News API key required)  \n✔ `!help` → Shows available commands  \n\n### 🌸 Auto Reactions  \n\n* Replies with 🌸 to \"Good morning\" and \"Good night\"  \n* Detects spam \u0026 roasts the sender  \n\n---\n\n## 🏗️ Architecture  \n\n**Hybrid setup:**  \n\n* **Node.js (main.js):** Handles WhatsApp communication, commands, and orchestrates requests  \n* **Python (hf_inference_server.py):** Runs a Flask server connected to **Google Gemini API** for LLM-powered tasks  \n\n---\n\n## 🚀 Quick Start  \n\n### 1. Clone Repository  \n\n```bash\ngit clone https://github.com/codedbyasim/WhatsApp-Bot\ncd WhatsApp-Bot\n```\n\n### 2. Install Dependencies  \n\n**Node.js:**  \n\n```bash\nnpm install\n```\n\n**Python:**  \n\n```bash\npip install Flask requests python-dotenv\n```\n\n### 3. Configure Environment Variables  \n\nCreate a file named `.env` in the project root:  \n\n```ini\nFIREBASE_PROJECT_ID=\nFIREBASE_CLIENT_EMAIL=\nFIREBASE_PRIVATE_KEY_PATH=\nFIREBASE_STORAGE_BUCKET=\n\nBOT_ID=\"1234567874@s.whatsapp.net\"  \n\n# Authorized WhatsApp IDs\nREHAN_ID=69510287589385@lid  \nSAAD_ID=12345678902@s.whatsapp.net  \nASIM_ID=1234567878@s.whatsapp.net  \n\n# Target group/contact JID\nCODE_ON_REMOTEJ_ID=120363403535865809@g.us  \n\n# Servers \u0026 APIs\nPYTHON_INFERENCE_URL=http://localhost:5000  \nGEMINI_API_KEY=\"YOUR_GEMINI_API_KEY\"  \nNEWS_API_KEY=\"YOUR_NEWS_API_KEY\"  \n```\n\n---\n\n## 🏃 Running the Bot  \n\n### Start Python Server  \n\n```bash\npython hf_inference_server.py\n```\n\n(Starts Flask server on `http://localhost:5000`)  \n\n### Start Node.js Bot  \n\n```bash\nnode main.js\n```\n\nScan the QR code in your terminal using **WhatsApp \u003e Linked Devices**.  \nIf successful, you’ll see:  \n\n```\nWhatsApp connection opened successfully!\n```\n\n---\n\n## 💬 Example Usage  \n\n* `!help`  \n* `!joke`  \n* `!roast @SomeUser`  \n* `!tagall \"Meeting in 5 minutes!\"`  \n* `Good morning` → 🌸  \n\n---\n\n## 🛠 Troubleshooting  \n\n❌ **Unauthorized to use this command**  \n→ Ensure your WhatsApp ID is in `.env` under allowed users  \n\n❌ **Gemini API key is None**  \n→ Check `.env` and restart `hf_inference_server.py`  \n\n❌ **Bot looping on \"Good morning\"**  \n→ Update to latest `main.js` (bot ignores its own messages)  \n\n---\n\n## 🤝 Contributing  \n\nWant to improve this bot? Fork the repo and submit a PR!  \nSome ideas for contributions:  \n\n* Add new fun commands (`!riddle`, `!shayari`)  \n* Add tone categories (angry, sarcastic, polite)  \n* Improve group management features  \n\n---\n\n## 📄 License  \n\nThis project is licensed under the **ISC License**.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedbyasim%2Fwhatsapp-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodedbyasim%2Fwhatsapp-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodedbyasim%2Fwhatsapp-bot/lists"}