sumba2000 / WhatsAppGPT

ChatGPT for WhatsApp using OpenAI API(gpt-3.5-turbo) and whatsapp-web.js, written in JS using Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About The Project

ChatGPT for WhatsApp using OpenAI API(gpt-3.5-turbo) and whatsapp-web.js, written in JS using Node.js

NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.

Prerequisites

  • npm
npm install npm@latest -g

Installation

  1. Clone this Repo:

    git clone https://github.com/iamkhalid2/WhatsAppGPT.git
  2. Install Dependencies:

    npm install
  3. Create a ".env" file

  4. Open file .env in a text editor and insert the following environment variable which holds the API key from your OpenAI account:

    OPENAI_API_KEY="INSERT YOUR OPENAI API KEY HERE"
  5. To run the program you need to enter the following command on the command line:

    node index.js
  6. The output on the command line should then show the QR code correctly, Link your WhatsApp through the code.

  7. Now the Chatbot is running and listing for messages. Use the # sign and write question as a message in WhatsApp. The response is then generated by OpenAI and received as a response to the original message automatically.

    ENJOY!

About

ChatGPT for WhatsApp using OpenAI API(gpt-3.5-turbo) and whatsapp-web.js, written in JS using Node.js


Languages

Language:JavaScript 100.0%