Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
docs: write more instructions to configure the app
Browse files Browse the repository at this point in the history
  • Loading branch information
khammami committed Jul 9, 2023
1 parent 91db1ca commit fe78823
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# PFA Discord Bot GPT (TODO)

[TODO App Description]

The PFA Discord Bot GPT is a Discord bot that uses the GPT-3 language model to generate text and answer your questions in an informative way.

This project aims to help learn DevOps by automating the CI/CD process. The project uses GitHub Actions to trigger workflows that build and deploy the app to GitHub Registry, DockerHub, and Azure Container Service.

[![Build & Test Node app (CI) for dev](https://github.com/ENET-Com-22/pfa-discord-bot-gpt/actions/workflows/node.js.yml/badge.svg)](https://github.com/ENET-Com-22/pfa-discord-bot-gpt/actions/workflows/node.js.yml)
[![Build & publish Docker image for dev](https://github.com/ENET-Com-22/pfa-discord-bot-gpt/actions/workflows/docker.yml/badge.svg)](https://github.com/ENET-Com-22/pfa-discord-bot-gpt/actions/workflows/docker.yml)
Expand Down Expand Up @@ -63,7 +66,35 @@ Next, you need to fill enviroment vars inside [.env](./.env) with your own APIs
- OPENAI_ORG - [OpenAI Organization settings](https://platform.openai.com/account/org-settings)
- OPENAI_KEY - [OpenAI API keys](https://platform.openai.com/account/api-keys)

### Setup Discord

To make a Discord bot, you need to create a discord application through [Discord Developer Portal](https://discord.com/developers/applications):

1. Click on `New Application` button

2. Give your application a name , check the terms of servive box and then`Create`.

3. In `Bot` section, name your bot and make sure the following options are enabled:

- PUBLIC BOT
- MESSAGE CONTENT INTENT

4. Go to `OAuth2` section then `URL Generator`. You need to check `bot` in scopes and `Administrator` in permissions (it's not recemmeded to grant adminstrator permission to a bot, we're doing so for demo purposes). Copy the generated URL at bottom of the page and run it on your browser. You'll be prompted to select your Discord server where you want to add your bot.

5. In `General` section under`OAuth2`, regenerate an new "CLIENT SECRET" key by clicking on `Reset secret`. Copy the new client secret key to your `.env` as DISCORD_TOKEN.

### OpenAi API
You need to have an OpenAi account in order to access their API.

1. Login or create a new account on https://platform.openai.com/overview

2. Create a new secret key for the bot (https://platform.openai.com/account/api-keys). Once generated, copy and paste it in `.env` as OPENAI_KEY

3. Finally, to fill the last environment variable OPENAI_ORG, just go to `settings` then copy your Organization ID.


## Running the project

$ npm start

The bot will now be available in your Discord server.

0 comments on commit fe78823

Please sign in to comment.