Discord bot providing useful GitHub-related commands.
This project is set up as a monorepo using Rye. To get started, install Rye, then run the following command:
rye run setup
- Create a Discord bot for development.
- Enable the following privileged intents:
- Message Content: required for the refresh button on the "Show GitHub issues" message command.
- Copy the bot token.
- Create a GitHub app for development.
- Callback URL:
http://localhost:7100/login - Webhook events: No
- Permissions:
- Repository:
- Issues: Read-only
- Metadata: Read-only
- Repository:
- Where can this GitHub App be installed: Only on this account
- Callback URL:
- Generate and copy a new client secret.
- Generate and download a new private key.
- Install the GitHub app on a repository, eg. your fork of this repo.
- Copy the installation ID (this is the
GITHUB__DEFAULT_INSTALLATION_IDvalue, used for making requests on behalf of users who are not logged in).
.env:
TOKEN="Discord bot token" GITHUB="{}" GITHUB__APP_ID="GitHub app id" GITHUB__CLIENT_ID="GitHub app client id" GITHUB__CLIENT_SECRET="GitHub app client secret" GITHUB__REDIRECT_URI="http://localhost:7100/login" GITHUB__DEFAULT_INSTALLATION_ID="GitHub app repository installation id" ENVIRONMENT="dev" API_PORT="7100" API_ROOT_PATH="" DB_URL="sqlite:///db.sqlite"
.env.docker:
TOKEN="..." GITHUB__APP_ID="..." GITHUB__CLIENT_ID="..." GITHUB__CLIENT_SECRET="..." GITHUB__REDIRECT_URI="http://localhost:7100/login" GITHUB__DEFAULT_INSTALLATION_ID="..."
secrets/github__private_key: GitHub app private key file.
Local: rye run bot
Docker: docker compose up