Skip to content

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.

Running Via Poetry

Python, pip and Poetry are required for the following instructions.

  1. To get the necessary packages, run
poetry install
  1. Ensure that a .env file is set (see example.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 has Server Members Intent and Message Content Intent. See How To Contribute Code for more details.
  • POSTGRES_URI_BOT for the PostgreSQL connection string.
  1. Start the bot via:
poetry run botdev

You can terminate the bot with CTRL+C.

Running Via Docker

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.

  1. 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.

  1. Shut down the Docker environment by running:
docker-compose down
Clone this wiki locally