A real-time, synchronous junior.guru Discord bot.
All junior.guru automation happens asynchronously (with up-to-24h delay) in the main monolith codebase, except of the following tasks provided by this bot:
Please, update the above list if adding features.
The original, asynchronous bot installs and uses this codebase to run the same code and perform the same tasks, idempotently:
git clone git@github.com:juniorguru/chick.git
cd chick
poetry install
Running locally:
DISCORD_API_KEY
environment variable to your Discord bot token.
Set the GITHUB_API_KEY
environment variable to your GitHub API token.
Using direnv might help setting environment variables automatically in your shell when you navigate to the project directory.poetry run chick
to start the bot.Useful commands:
poetry run chick --prod
to temporarily replace the production instance with the local one if you need to test something.pytest
.ruff format
.ruff check --fix
.The bot is deployed to fly.io.
Everything related to deployment is in the Dockerfile
.
There's also fly.toml
, but that's something the flyctl
has generated and only they know what it is good for.
There is no need to deploy this bot manually.
Everything merged to the main
branch of the GitHub repo gets automatically deployed to Fly.
For this to work, the output of flyctl auth token
must be set as FLY_API_TOKEN
secret in the GitHub repo settings.
The rest of the setup is in .github/workflows/build.yml
.
If you insist to deploy manually from your local machine, follow these steps:
flyctl
installed and be logged in.flyctl secrets set DISCORD_API_KEY=...
flyctl launch
in the project directory.flyctl deploy
if not deployed already.Inspired by Hosting a Python Discord Bot for Free with Fly.io by Jonah Lawrence.
AGPL-3.0-only, copyright (c) 2024 Jan Javorek, and contributors.