Install Manually
Prerequisites
Ensure you have the following installed:
Git
-
For Debian/Ubuntu Linux run:
sudo apt install git
. -
For Fedora Linux run:
yum install git
(up to Fedora 21) ordnf install git
(Fedora 22 and later). -
For Gentoo Linux run:
emerge --ask --verbose dev-vcs/git
. -
For Arch Linux run:
pacman -S git
. -
For other Linux distributions check the git downloads page.
Python
-
For Debian/Ubuntu Linux run:
sudo apt install python3 python3-pip python3-venv
. -
For other Linux distributions, refer to your distribution’s package manager or documentation.
FFmpeg
-
For Debian/Ubuntu Linux run:
sudo apt install ffmpeg
. -
For Fedora Linux run:
sudo dnf install ffmpeg
. -
For Arch Linux run:
sudo pacman -S ffmpeg
. -
For other Linux distributions, refer to your distribution’s package manager or documentation.
screen (optional)
- If screen is not already installed, run:
sudo apt install screen
(Debian/Ubuntu) or check your distro's package manager.
Setup
Open a terminal and follow the steps below.
Clone the repository:
-
git clone https://github.com/Wesley-Playz/rulekeeperbot.git
-
cd rulekeeperbot
Create a Discord Bot:
-
Go to Discord Developer Portal.
-
Create a new application and set up your bot.
Set up environment variables:
- Create a
.env
file in the project root:
BOT_TOKEN=GET_FROM_DISCORD_DEVELOPER_PORTAL
SECRET_KEY=REPLACE_WITH_A_RANDOM_STRING
HEAD_BOT_ADMIN_USERNAME=Admin
HEAD_ADMIN_PASSWORD=CHOOSE_A_VERY_STRONG_PASSWORD
FRONTEND_URL=http://localhost:5000
API_URL=http://localhost:5003
DISCORD_CLIENT_ID=GET_FROM_DISCORD_DEVELOPER_PORTAL
DISCORD_CLIENT_SECRET=GET_FROM_DISCORD_DEVELOPER_PORTAL
DATABASE_PATH=bot/bot.db
ENABLE_LEVELING=true
ENABLE_MODERATION=true
ENABLE_APPEALS=true
TWITCH_CLIENT_ID=GET_FROM_TWITCH_DEVELOPER_CONSOLE
TWITCH_CLIENT_SECRET=GET_FROM_TWITCH_DEVELOPER_CONSOLE
YOUTUBE_API_KEY=GET_FROM_GOOGLE_CLOUD_CONSOLE
Replace all placeholder values (like GET_FROM_DISCORD_DEVELOPER_PORTAL) with the actual values from your Discord Developer Portal.
⚠️ Never share your .env file publicly — it contains sensitive secrets!
Running the Bot and Dashboard
- Start a screen session:
screen -S rulekeeperbot
- Make the virtual environment:
python3 -m venv venv
- Activate the virtual environment:
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Run the bot:
python main.py
Note: If you edit any files after starting the bot, restart it to apply the changes.
Alternatively, if you don't want to use a screen session, you can run the bot and dashboard in the background:
nohup python main.py &
Note: Logs will be written to
nohup.out
.
Once running, access the dashboard:
-
Local access: http://localhost:5000
-
Remote access: http://OtherPCsIPAddress:5000
To detach from a screen session, press
Ctrl + A
thenCtrl + D
.To reattach to your screen session later, run
screen -r rulekeeperbot
.