From 97d0edce4b5564d2a52f61ec6f712b8de46cda06 Mon Sep 17 00:00:00 2001 From: Krishnendu Das <86651039+itskdhere@users.noreply.github.com> Date: Mon, 23 Oct 2023 00:12:43 +0530 Subject: [PATCH] Update LEARN.md --- LEARN.md | 88 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/LEARN.md b/LEARN.md index d2fd5ff..ca4527d 100644 --- a/LEARN.md +++ b/LEARN.md @@ -3,7 +3,7 @@ ChatGPT Discord BOT

-v3.2.1 +v3.2.2

@@ -66,15 +66,15 @@ This BOT uses [ChatGPT API](https://github.com/transitive-bullshit/chatgpt-api) ## 📡 Quick Start [Self-Hosting] : -### 0. Requirements: +### Requirements: - [Git](https://git-scm.com/) - - [Node.js v18](https://nodejs.org/) + - [Node.js v18](https://nodejs.org/) or, [Docker](https://www.docker.com/) - [OpenAI Account](https://chat.openai.com/) - [Discord Account](https://discord.com/) - [Google Account](https://accounts.google.com/) For [Firebase](https://firebase.google.com/) - - Atleast 1vCPU , 0.25GB RAM & 0.5GB Storage for the Bot. + - Atleast 1vCPU , 0.5GB RAM & 1GB Storage for the Bot. -### 1. Bot Setup: +### Setting Up The Bot: 0. Create **New Application** (BOT) from [Discord Developer Portal](https://discord.com/developers/applications) and invite that bot to your Discord Server with:
**Scopes:** `bot` & `application.commands`
**Bot Permissions:** `2734284602433`
@@ -95,44 +95,10 @@ Then navigate to the folder: cd ChatGPT-Discord-BOT ``` -3. Install all dependencies: -```bash -npm install -``` - -4. To setup Environment Variables, Copy & Rename the `.env.example` file to `.env` -```bash -cp .env.example .env -``` -```bash -nano .env -``` -Then, fill the credentials properly by following [this instruction](https://github.com/itskdhere/ChatGPT-Discord-BOT#-environment-variables-setup). - -5. Setup Firebase Firestore Database by following [this instruction](https://github.com/itskdhere/ChatGPT-Discord-BOT#-database-setup). - -6. Start the BOT: -```bash -npm run start -``` -*Or,* During Development: -```bash -npm run dev -``` -*Or,* In Production with [PM2](https://pm2.keymetrics.io/docs/usage/quick-start): -```bash -npm install pm2 -g -``` -```bash -npm run prod -``` - -7. Use the BOT 🎉 +3. To setup Environment Variables, Copy & Rename the `.env.example` file to `.env` and open in any Text Editor. Then, fill the credentials properly by following this instruction: - -

• Environment Variables Setup:

-(expand/collapse) +Expand / Collapse Instruction - `DISCORD_CLIENT_ID` - Client ID of the bot from *OAuth2* section. @@ -165,9 +131,12 @@ npm run prod
-

• Database Setup:

+
+ +4. Setup Firebase Firestore Database by following this instruction: +
-(expand/collapse) +Expand / Collapse Instruction 0. Goto **Firebase Console:** [console.firebase.google.com](https://console.firebase.google.com/) (No Card Required) @@ -196,6 +165,39 @@ npm run prod
+### Running The Bot: + +#### **🐳 Using Docker:** + +```bash +docker build -t itskdhere/chatgpt:3.2.2 . +``` +```bash +docker run --name chatgpt -d itskdhere/chatgpt:3.2.2 +``` + +#### **🟢 Without Docker:** + +1. Install all dependencies: +```bash +npm install +``` + +2. Start the BOT: +```bash +npm run start +``` +*Or,* During Development: +```bash +npm run dev +``` +*Or,* In Production with [PM2](https://pm2.keymetrics.io/docs/usage/quick-start): +```bash +npm install pm2 -g +``` +```bash +npm run prod +``` ## 💬 Support: