Features โข Quick Start โข Usage โข Docker โข Security
Stop context-switching between Discord and GitHub. Manage your entire issue workflow from the comfort of your Discord server. Whether you're tracking bugs, managing features, or collaborating with your team, this bot brings GitHub's power directly to Discord.
Built with security in mind โ Personal OAuth authentication ensures all actions are attributed correctly, and AES-256-GCM encryption keeps your tokens safe.
|
|
Choose the best option for your needs:
|
Recommended for most users โ Zero configuration required โ Always up-to-date โ Instant setup (1 click) โ No server costs Then jump to Usage to get started! |
For advanced users โ Full control over your data โ Custom modifications possible โ Run on private networks โ No external dependencies Requires Discord Bot App & GitHub OAuth App setup. |
| Feature | Hosted Version | Self-Hosted |
|---|---|---|
| Setup Time | < 1 minute | ~15-30 minutes |
| Technical Knowledge | None required | Basic Docker/Go knowledge |
| Cost | Free | Server costs (if applicable) |
| Maintenance | Automatic | Manual updates |
| Data Control | Hosted by bot provider | Full control |
| Custom Features | Not available | Modify as needed |
| Private Network | โ | โ |
๐ก Not sure? Start with the hosted version - you can always self-host later!
โ ๏ธ Important: Self-hosting requires creating your own Discord Bot application in the Discord Developer Portal. This is different from the hosted version which uses a pre-configured bot application. You'll get your own invite link after setup.
โก Quick Deploy (Docker - Recommended)
- Docker & Docker Compose installed
- Discord Bot Application (Create one) - Required for self-hosting
- GitHub OAuth App (Create one)
# 1. Clone and configure
git clone <your-repo>
cd discord-github-bot
cp .env.example .env
# 2. Edit .env with your credentials (see configuration guide below)
nano .env
# 3. Launch!
docker-compose up -dYour bot is now running! View logs with docker-compose logs -f
๐ Detailed Self-Hosting Setup
Note: For self-hosting, you need to create your own Discord Bot application since you'll be running your own instance.
- Go to Discord Developer Portal
- Click "New Application" and give it a name
- Go to the "Bot" section and click "Add Bot"
- Under "Privileged Gateway Intents", enable:
- โ SERVER MEMBERS INTENT
- โ MESSAGE CONTENT INTENT
- Copy the bot token (you'll need this for
DISCORD_BOT_TOKEN) - Go to "OAuth2" > "General" and copy the Application ID (needed for
DISCORD_APPLICATION_ID) - Go to "OAuth2" > "URL Generator":
- Select scopes:
bot,applications.commands - Select bot permissions:
Send Messages,Use Slash Commands - Copy the generated URL - this is your personal invite link for your self-hosted bot
- Select scopes:
- Go to GitHub Settings > Developer settings > OAuth Apps
- Click "New OAuth App"
- Fill in the details:
- Application name: Discord GitHub Bot
- Homepage URL:
http://localhost:8080(or your domain) - Authorization callback URL:
http://localhost:8080/callback(or your domain)
- Click "Register application"
- Copy the Client ID
- Generate a new client secret and copy it
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand fill in your credentials:# Discord Configuration DISCORD_BOT_TOKEN=your_discord_bot_token DISCORD_APPLICATION_ID=your_application_id # GitHub OAuth Configuration GITHUB_CLIENT_ID=your_github_client_id GITHUB_CLIENT_SECRET=your_github_client_secret GITHUB_REDIRECT_URL=http://localhost:8080/callback # For Docker: GITHUB_REDIRECT_URL=http://your-domain.com/callback # Generate a random 32-byte encryption key ENCRYPTION_KEY=your_32_character_encryption_key # Server Configuration (optional) OAUTH_SERVER_PORT=8080 OAUTH_SERVER_HOST=localhost # For Docker: OAUTH_SERVER_HOST=0.0.0.0 # Public URL - The publicly accessible URL for OAuth callbacks PUBLIC_URL=http://localhost:8080 # For Docker/Production: PUBLIC_URL=https://your-domain.com # Database (optional) DATABASE_PATH=./bot.db # For Docker: DATABASE_PATH=/home/botuser/data/bot.db
-
Generate a secure encryption key:
# On Linux/Mac: openssl rand -base64 32 | head -c 32 # Or use Go: go run -c 'package main; import ("crypto/rand"; "encoding/base64"; "fmt"); func main() { b := make([]byte, 32); rand.Read(b); fmt.Println(base64.StdEncoding.EncodeToString(b)[:32]) }'
go mod downloadThe bot automatically loads environment variables from the .env file using godotenv:
go run main.goOr build and run:
go build -o discord-github-bot
./discord-github-botUsing Docker Compose (recommended):
# Build and start the container
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose downUsing Docker directly:
# Build the image
docker build -t discord-github-bot .
# Run the container
docker run -d \
--name discord-github-bot \
-p 8080:8080 \
--env-file .env \
-v bot-data:/home/botuser/data \
discord-github-bot
# View logs
docker logs -f discord-github-bot
# Stop the container
docker stop discord-github-bot
docker rm discord-github-botFor Hosted Version Users: If you invited the hosted bot, start here!
For Self-Hosters: These commands work the same way on your self-hosted instance.
The first time you use the bot, authenticate with your GitHub account:
/gh-auth # Get your personal OAuth link (only you can see it)
Click the link, authorize on GitHub, and you're ready! To revoke access later:
/gh-unauth # Remove authentication
๐ Privacy First: Authentication links are ephemeral (only visible to you)
Set up defaults so you don't repeat yourself:
/gh-set-repo repo:owner/repository # Set default repo for this channel
/gh-set-project project:123 # Link to GitHub Project| Command | Description | Example |
|---|---|---|
/gh-issue-create |
Create a new issue | /gh-issue-create title:"Login bug" body:"Users can't sign in" |
/gh-issue-list |
List issues (open/closed/all), with pagination and filtering | /gh-issue-list state:open |
/gh-issue-view |
View detailed issue info | /gh-issue-view number:42 |
/gh-issue-close |
Close an issue with a reason (completed, not_planned, or duplicate) | /gh-issue-close number:42 state_reason:completed |
/gh-issue-comment |
Add a comment to an issue | /gh-issue-comment number:42 comment:"Fixed!" |
/gh-project-item-list |
List project items (open/closed/all), with pagination and filtering | /gh-project-item-list project:123 state:open |
/gh-project-item-create |
Create a new project item | /gh-project-item-create project:123 title:"New Feature" body:"Implement X" |
/gh-project-item-view |
View detailed project item information | /gh-project-item-view project:123 item-id:456 |
/gh-project-item-archive |
Archive a project item | /gh-project-item-archive project:123 item-id:456 |
๐ก Pro Tip: All commands support optional
repo:owner/repositoryparameter to override channel defaults
discord-github-bot/
โโโ ๐ฏ main.go # Application entry point
โโโ ๐ฆ internal/
โ โโโ config/ # Configuration management
โ โโโ database/ # SQLite + encrypted token storage
โ โโโ oauth/ # GitHub OAuth flow handler
โ โโโ bot/ # Discord bot & command handlers
โโโ ๐ณ Dockerfile # Container configuration
โโโ ๐ณ docker-compose.yml # Orchestration setup
โโโ ๐ .env.example # Configuration template
Click to view detailed architecture
config/- Loads and validates environment variablesdatabase/- SQLite with AES-256-GCM encrypted token storageoauth/- Handles GitHub OAuth 2.0 flow with state validationbot/- Discord bot initialization and slash command routing
Discord User โ /command โ Bot Handler โ GitHub API
โ
Database (encrypted tokens)
| Feature | Implementation |
|---|---|
| ๐ Token Encryption | AES-256-GCM encryption at rest |
| ๐ค Personal Auth | Each user uses their own GitHub account |
| ๐ Ephemeral Messages | Auth links visible only to requesting user |
| โ OAuth 2.0 | Standard flow with state validation |
| ๐ก๏ธ No Shared Secrets | Zero token sharing between users |
- ๐ GitHub Projects API support is limited (partial implementation)
- ๐ OAuth server requires public accessibility for production
- ๐ Issue listings capped at 10 most recent per query
- ๐งช Consider using ngrok for local testing
We welcome contributions! Here's how to get started:
# 1. Fork & clone
git clone https://github.com/xxRockOnxx/discord-github-bot.git
# 2. Create a feature branch
git checkout -b feature/amazing-feature
# 3. Make your changes & commit
git commit -m "Add amazing feature"
# 4. Push & create PR
git push origin feature/amazing-feature- โ Write tests for new features
- ๐ Update documentation as needed
- ๐จ Follow existing code style
- ๐ Test thoroughly before submitting
Docker Management Commands
# Start the bot
docker-compose up -d
# View logs
docker-compose logs -f
# Restart the bot
docker-compose restart
# Stop the bot
docker-compose down
# Update to latest version
git pull
docker-compose down
docker-compose build --no-cache
docker-compose up -dOAUTH_SERVER_HOST=0.0.0.0 # Accept external connections
DATABASE_PATH=/home/botuser/data/bot.db # Use mounted volume
PUBLIC_URL=https://your-domain.com # Your public URL for OAuthRunning Without Docker (Go)
# Install dependencies
go mod download
# Run directly
go run main.go
# Or build and run
go build -o discord-github-bot
./discord-github-botThe bot automatically loads .env file for configuration.
Production Deployment Tips
- Use a reverse proxy (nginx/Caddy) for HTTPS
- Set up a domain pointing to your server
- Configure OAuth redirect URL to use HTTPS
- Enable automatic restarts with systemd or Docker restart policies
- Set up log rotation to prevent disk space issues
- Back up your database regularly (it contains encrypted tokens)
server {
listen 443 ssl;
server_name bot.yourdomain.com;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}โ Bot doesn't respond to commands
- โ Check bot permissions in Discord server settings
- โ Verify slash commands registered (check startup logs)
- โ
Confirm
DISCORD_BOT_TOKENandDISCORD_APPLICATION_IDare correct - โ Ensure bot has "Use Slash Commands" permission
๐ Authentication fails
- โ
Verify GitHub OAuth App credentials (
GITHUB_CLIENT_ID,GITHUB_CLIENT_SECRET) - โ Confirm redirect URL matches exactly (http vs https matters!)
- โ Check OAuth server is accessible at configured host/port
- โ For Docker: Ensure port 8080 is exposed and accessible externally
- โ Try using ngrok for local testing
๐พ Database errors
- โ
Ensure
DATABASE_PATHdirectory exists and is writable - โ
Verify
ENCRYPTION_KEYis exactly 32 characters - โ
Check file permissions:
chmod 644 bot.db - โ
For Docker: Verify volume is mounted correctly (
docker volume ls)
๐ณ Docker-specific issues
Container exits immediately:
docker-compose logs # Check for error messages
docker logs discord-github-botPort already in use:
- Change
OAUTH_SERVER_PORTin.env - Or modify port mapping in
docker-compose.yml:"8081:8080"
Database not persisting:
docker volume ls # Verify volume exists
docker-compose down -v # Remove and recreate
docker-compose up -dMIT License - Free to use, modify, and distribute. See LICENSE for details.
- โ๏ธ Questions or issues? The hosted bot is provided as-is
- ๐ก Feature requests? Open a discussion
- ๐ Found a bug? Open an issue
- ๐ฌ Need help? Check the troubleshooting guide
- ๐ค Want to contribute? See contributing guidelines
- โญ Star this repo if you find it useful!
- ๐ Share with others who might benefit
- ๐ข Spread the word in your communities
Made with โค๏ธ for the Discord & GitHub communities