Skip to content

A Discord interactions and webhook bot for AR Club, a World of Warcraft guild in US-Shandris/Bronzebeard

License

Notifications You must be signed in to change notification settings

johncmanuel/isabot

Repository files navigation

isabot

About

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.

Purpose

The purpose of Isabot is to promote friendly competition within the guild, recognize other guildies' hard work, and an overall sense of community.

Technology

  1. FastAPI (web server)
  2. Discord API and webhooks
  3. Blizzard API
  4. Google Cloud Run (deployment)
  5. Google Cloud Build (CI/CD)
  6. Google Cloud Scheduler (for running cron jobs)
  7. Google Cloud Secret Manager (for storing production secrets)
  8. Google Firestore (NoSQL)

Getting Started

Essentials

This project requires the following software:

Afterwards, set your .env file according to .env.example.

Poetry

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

Nix

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

Development

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

Deployment

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.

Design Document

Link to Google Document

About

A Discord interactions and webhook bot for AR Club, a World of Warcraft guild in US-Shandris/Bronzebeard

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published