Helper bot for Discohook.
Invite using https://discord.com/api/oauth2/authorize?client_id=633565743103082527&permissions=537250880&scope=bot.
Requires Python 3.8
python3.8 -m venv venv # Create virtual environment
source venv/bin/activate # Activate virtual environment
pip install -Ur requirements.txt # Install dependencies
This project requires a postgres database, migrations are done with agnostic
.
Create a role and a database.
CREATE ROLE discohookbot WITH LOGIN PASSWORD 'secure-password';
CREATE DATABASE discohookbot;
GRANT ALL ON DATABASE discohookbot TO discohookbot;
Bootstrap agnostic and migrate to the lastest database version.
agnostic -t postgres -u discohookbot -d discohookbot bootstrap --no-load-existing
agnostic -t postgres -u discohookbot -d discohookbot migrate
Make sure that the virtual environment is active.
Load configuration using environment variables, or using a .env
file.
Relevant environment variables are:
DISCORD_TOKEN
: Discord bot tokenDATABASE_DSN
: Database credentials in the form of the libpq connection URI format
Once configured, the bot can be started using the following command:
python main.py