Table of Contents

discord-typecast-gpt-chatbot

Docker Image CI

This bot is a Discord-based support agent. It provides helpful responses to user queries, assists with server-related questions, and directs users to relevant resources. The bot is friendly, knowledgeable, and maintains a positive environment. It can also share opinions, preferences, and recommendations related to various topics, creating engaging and informative interactions with users.

See the bot in action

How to run the bot

Using docker

docker run -td --name cyberchatbot -e DISCORD_BOT_APP_TOKEN="INSERT YOUR BOT TOKEN HERE" -e OPENAI_API_KEY="INSERT YOUR OPENAI API KEY HERE" simeononsecurity/discord-typecast-gpt-chatbot:latest

How to run the bot manually using python

To get started with running this repository, you need to perform the following steps:

  1. Clone this repository and change into product root
git clone URL
cd repo_name
  1. create an .env file in the project root (it will be .gitignored) and paste your discord bot token and openai token:
DISCORD_BOT_APP_TOKEN=PASTE_DISCORD_TOKEN_HERE
OPENAI_API_KEY=PASTE_OPENAI_API_TOKEN_HERE
  1. Create a new virtual environment using venv:
python3 -m venv venv
  1. Activate the virtual environment:
source venv/bin/activate
  1. Install the dependencies listed in requirements.txt:
pip install -r requirements.txt
  1. If you install new dependencies with pip install, be sure to regenerate requirements.txt with:
pip freeze > requirements.txt

How to fix locales issue

sudo apt-get install locales -y
sudo locale-gen en_US.UTF-8 en_CA.UTF-8
sudo update-locale

Architecture

./
project root

bot/
discord bot's source

bot/main.py:
This is the main entry point for your application

bot/controllers/
This directory contains code that controls the main program and provides inputs into services

bot/services/
This directory contains code that do small, specific tasks

requirements.txt:
This file lists the dependencies required for your application to run