Discord bot for AR Club's Discord Server. This bot will send weekly guild leaderboards of various types to the Discord server via webhook. Leaderboards may include: most number of mounts, most wins in Arenas/Battlegrounds, etc. For leaderboards in most wins in Arenas/Battlegrounds, this will be reset weekly at some particular date.
Data will be recorded in a cloud database.
The idea of having weekly leaderboards was inspired by Ethan's lc-dailies project.
The purpose of Isabot is to promote friendly competition within the guild, recognize other guildies' hard work, and an overall sense of community.
- FastAPI (web server)
- Discord API and webhooks
- Blizzard API
- Google Cloud Run (deployment)
- Google Cloud Build (CI/CD)
- Google Cloud Scheduler (for running cron jobs)
- Google Cloud Secret Manager (for storing production secrets)
- Google Firestore (NoSQL)
This project requires the following software:
- Python 3.9
- Text editor of your choice
Afterwards, set your .env file according to .env.example
.
Install Poetry, a tool for managing packages within a virtual environment.
Then install packages:
poetry install
Then, inject a plugin for Poetry called Export. This plugin will help with exporting poetry.lock
into other formats such as requirements.txt
.
Use the below command to convert poetry.lock
to requirements.txt
:
poetry export -f requirements.txt --output requirements.txt --without-hashes
Run the server with:
poetry run start
Alternatively, you can use Nix to setup the developer environment without manually downloading the required software (i.e Python 3.9, Poetry, project dependencies, etc).
For beginners setting up Nix for the first time, see https://nix.libdb.so/slides for guidance.
After installation, run the following command at the root of this project:
nix-shell
You are now able to run the commands mentioned above!
After some use, you can clean the Nix store before using the shell if needed:
nix-collect-garbage
Use ngrok to test features that may require HTTPS such as OAuth:
# default port of app is 8000
# do not include https:// in <your assigned domain>
ngrok http --domain=<your assigned domain>.ngrok-free.app 8000
# or (if not using a domain)
ngrok http 8000
isabot can technically be deployed anywhere. Even better if using containers! However, the application and the deployment is geared towards the Google Cloud ecosystem. In the future, the project will be more flexible with deployments.