-
Notifications
You must be signed in to change notification settings - Fork 21
How To Build & Run UQCSbot
Isaac Beh edited this page May 22, 2024
·
1 revision
The following is a rough guide to building and running UQCSbot locally. For a more beginner-friendly guide or information on how to format & style code, check out How To Contribute Code.
Python, pip and Poetry are required for the following instructions.
- To get the necessary packages, run
poetry install
- Ensure that a
.env
file is set (seeexample.env
and Tokens and Environment Variables for an example and more information on the currently implemented environment variables). The following variables are required for the bot to function properly:
-
DISCORD_BOT_TOKEN
for the Discord provided bot token. This should be your own token and ensure it hasServer Members Intent
andMessage Content Intent
. See How To Contribute Code for more details. -
POSTGRES_URI_BOT
for the PostgreSQL connection string.
- Start the bot via:
poetry run botdev
You can terminate the bot with CTRL+C
.
In production, UQCSbot is deployed using docker. If you're familiar with it or want to fully simulate the production environment, you can follow these instructions instead.
Docker and Docker Compose are required for the following instructions.
- Build and start Docker by running:
docker-compose up -d --build
Note that you may need to prepend sudo
depending on your install of docker.
- Shut down the Docker environment by running:
docker-compose down