Random crap I decided to create instead of living life. This bot integrates GPT functionality with WhatsApp, allowing for various features.
- Admin Panel: Access the admin panel at
http://localhost:your_port
for real-time configuration. - GPT Integration: Uses Groq to provide GPT functionality and models remotely.
- Text-to-Speech (TTS): The bot can generate audio by preprocessing text using GPT, then converts it to speech to send voice messages back to users.
- Image generation: The bot can generate images, it uses bing for it.
- Open the admin panel and scan the QR code.
- You can find available commands in the
config.json
file. - Ask any friend to send you a message using the bot name as prefix, for normal gpt response only name is required but for other actions words in config.json are required.
Follow these steps to get project up and running:
- Clone the repository:
git clone https://github.com/malvads/whatsapp-gpt-bot.git
- Install node modules
cd whatsapp-gpt-bot && npm i
To ensure proper installation, make sure you have the latest Visual C++ Build Tools installed. You can refer to the Node.js node-gyp documentation for detailed instructions on installing the required tools.
Before running the application, create an .env
file in the same folder as the start.sh
file with your API keys:
# .env
GROQ_API_KEY="API_KEY"
BING_COOKIE="API_KEY"
- GROQ_API_KEY: Replace this with your actual API key for the GROQ service.
- BING_COOKIE: Replace this with the
_U
cookie value from Bing. To obtain the_U
cookie:
- Open your browser (preferably Microsoft Edge).
- Go to Bing and sign in with your Microsoft account.
- Open Developer Tools (
F12
orCtrl + Shift + I
), and navigate to the "Application" or "Storage" tab. - Under "Cookies," select
https://www.bing.com
and locate the_U
cookie. - Copy the
_U
cookie value and use it as your BING_COOKIE.
- chrome_path: Specify the path to the Chrome executable on your system. Here’s how to find it:
- On Windows: The default path is usually:
C:\Program Files\Google\Chrome\Application\chrome.exe
If you are using a 32-bit version of Chrome on a 64-bit system, it may be:
C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
- On macOS: The path is typically:
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
- On Linux: Common paths include:
/usr/bin/google-chrome
After configuring the keys, you can start the application with the following commands:
- Make the
start.sh
script executable:
chmod +x start.sh
- Run the
start.sh
script:
./start.sh
sh start.sh # on windows
You can clean temporary files, cache, and other unnecessary content using the clean.sh
script.
- Ensure Execution Permissions: Before running the script, ensure it has the necessary permissions. Run the following command to make the script executable:
chmod +x clean.sh
- Execute the Script: Run the script from the terminal:
./clean.sh
sh clean.sh # on windows