Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

object-Object/discord-github-utils

Repository files navigation

discord-github-utils

Discord bot providing useful GitHub-related commands.

Setup

This project is set up as a monorepo using Rye. To get started, install Rye, then run the following command:

rye run setup

Discord bot

  1. Create a Discord bot for development.
  2. Enable the following privileged intents:
    • Message Content: required for the refresh button on the "Show GitHub issues" message command.
  3. Copy the bot token.

GitHub app

  1. Create a GitHub app for development.
    • Callback URL: http://localhost:7100/login
    • Webhook events: No
    • Permissions:
      • Repository:
        • Issues: Read-only
        • Metadata: Read-only
    • Where can this GitHub App be installed: Only on this account
  2. Generate and copy a new client secret.
  3. Generate and download a new private key.
  4. Install the GitHub app on a repository, eg. your fork of this repo.
  5. Copy the installation ID (this is the GITHUB__DEFAULT_INSTALLATION_ID value, used for making requests on behalf of users who are not logged in).

Environment variables

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

Running

Local: rye run bot

Docker: docker compose up

About

A Discord bot providing useful GitHub-related commands. Not affiliated with Discord or GitHub.

Resources

License

Stars

Watchers

Forks

Packages

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /