https://github.com/codingtuto/what-bot
https://github.com/codingtuto/what-bot
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codingtuto/what-bot
- Owner: codingtuto
- Created: 2023-01-07T19:30:56.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T19:31:05.000Z (about 3 years ago)
- Last Synced: 2025-10-14T18:04:52.526Z (4 months ago)
- Language: JavaScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About The Project
This is a basic chat bot for WhatsApp which uses the OpenAI API (GPT-3). It is written in JavaScript using Node.js.
### Prerequisites
* npm
```sh
npm install npm@latest -g
```
* API keys from OpenAI at https://openai.com.
### Installation
1. Clone the repo
```sh
git clone https://github.com/theshanergy/whatbot.git
```
2. Install NPM packages
```sh
npm install
```
3. Create an .env file containing your OpenAI secret API key as follows:
```sh
OPENAI_SECRET_KEY=""
```
4. Optionally set a default prompt in your .env file to give your bot a different personality:
```sh
DEFAULT_PROMPT=""
```
## Example Prompts
Prompts should be written in the first person and are used to define your bots personality and ego. ie:
> My name is Albert Einstein. I am a theoretical physicist who developed the theory of relativity.
The more detail you offer in your prompt, the better your responses will be.
## Usage
1. Run the bot:
```sh
npm run start
```
2. Open WhatsApp on your phone, select 'WhatsApp Web' from the settings menu, then scan the provided QR code.
3. Choose from the list of recent chats which you would like to activate the bot for. Use space key to select.
4. Sit back and watch the bot respond automatically to incoming messages from your selected contacts.