https://github.com/muhammadrafihq/whatsapp-bot-ai-gemini
WhatsApp bot that interfaces with WhatsApp Web and Google Generative AI to generate responses to incoming messages
https://github.com/muhammadrafihq/whatsapp-bot-ai-gemini
ai chatbot gemini whatsapp-bot
Last synced: about 2 months ago
JSON representation
WhatsApp bot that interfaces with WhatsApp Web and Google Generative AI to generate responses to incoming messages
- Host: GitHub
- URL: https://github.com/muhammadrafihq/whatsapp-bot-ai-gemini
- Owner: muhammadrafihq
- Created: 2024-08-29T03:46:49.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-29T06:50:45.000Z (9 months ago)
- Last Synced: 2025-03-26T02:51:12.352Z (2 months ago)
- Topics: ai, chatbot, gemini, whatsapp-bot
- Language: TypeScript
- Homepage:
- Size: 37.1 KB
- Stars: 6
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WhatsApp Bot with Express and Google Generative AI
This project is a WhatsApp bot that interfaces with WhatsApp Web and Google Generative AI to generate responses to incoming messages. The bot can now detect whether a message contains only text or a combination of text and image, enabling it to generate appropriate responses based on the message content.
## Table of Contents
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Contributing](#contributing)## Prerequisites
Before you begin, ensure you have the following installed on your system: Node.js (v14.x or later), npm (v6.x or later), Git (optional but recommended)
## Installation
1. **Clone the Repository:** `git clone https://github.com/your-username/whatsapp-bot-ai.git && cd whatsapp-bot-ai`
2. **Install Dependencies:** `npm install`
## Configuration
1. **Set Up Environment Variables:** Create a `.env` file in the root directory and add `API_KEY=your_google_generative_ai_api_key`.
2. **Modify Puppeteer Settings (if running as root):** Add `args: ['--no-sandbox', '--disable-setuid-sandbox']` to the Puppeteer configuration in your code.
## Usage
1. **Start the Application:** Run `npm run dev` if you running in local .
2. **Scan QR Code:** A QR code will be generated in the terminal. Scan it with your WhatsApp mobile app to authenticate.
3. **Interact with the Bot:** Send messages to the WhatsApp number associated with the bot; it will respond using Google Generative AI.
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request for any improvements.