A FAC discord ai chatbot Made by Emma & Egbie
in order to get this bot working, we need access to the following things
Server ID of a guild where you can add members to.
Token of a discord bot which you can create & manage the permissions of.
An Open AI Key linked to an account with some form of credit.
If you're setting this up for the first time, you'll also need your bot's Client ID and an appropriate bot Permission Integer.
If you have all the above, please skip to the Installation Steps instead.
Note: If you want to add the bot to someone else's guild, make sure to have their permissions first. If you don't have the required permissions, you'll also need to ask them to add the bot to the guild for you.
Assuming you're generating a discord app for the first time:
1995012435014
https://discord.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=PERMISSIONS_INTEGER
, replacing CLIENT_ID
and PERMISSIONS_INTEGER
with the values found above.This is assuming this is your first time dealing with OpenAI's API:
git clone
the repository & navigate into itnpm install
to install all packages required.env
file and copy the contents into it from .env-template
.env
file, fill in the values of the Server ID, Discord Bot Token, and OpenAI API key with the values you've acquired from following the Prerequisite steps.npm start
If all went well and you've added your bot successfully to a guild, you should be able to interact with it by mentioning, followed by a prompt, like so:
@BOT_NAME Hey, can you tell me a fun fact
You can also see your chat history by typing:
@BOT_NAME !showMyChatHistory
The bot will also delete & notify you of any messages which are flagged by the OpenAI's moderation API, and will issue timeouts (up to an hour) for repeat offenders.
This project uses ESLint
and Prettier
to try and maintain some form of formatting consistency. It's helping us write cleaner and more readable code collaboratively.