A Discord Linked Roles application that verifies GitHub contributions to specified repositories. Users who have contributed to any of the configured repositories in the last 6 months can get an automatic role in Discord.
- Discord Linked Roles: Uses Discord's native linked role system
- Configurable Repositories: Check contributions to 1 or 2 repositories via environment variables
- Recent Contributions: Only counts contributions from the last 6 months
- Automatic Re-verification: Monthly checks to keep roles up-to-date
- OAuth2 Integration: Seamless GitHub connection through Discord
- Go to https://discord.com/developers/applications
- Create a new application
- Go to "OAuth2" section and copy the Client ID and Client Secret
- Add redirect URI:
http://localhost:3000/linked-role - Go to "Bot" section and create a bot (for role metadata registration)
- Copy the bot token for
DISCORD_TOKEN
- Go to https://github.com/settings/personal-access-tokens/tokens
- Create a new fine-grained personal access token
- Grant "Contents" read permission for public repositories
- Copy the token for
GITHUB_TOKEN
- Get your Discord server ID (
GUILD_ID) - Create or identify the role ID you want to assign (
ROLE_ID)
This application uses .NET Aspire parameters for configuration management instead of .env files. For detailed setup instructions, see the Parameter Configuration Guide.
Quick Start:
- Run
aspire runto start the application - Open the Aspire dashboard (URL shown in console)
- Enter the required parameters when prompted
- Use "Save to user secrets" for sensitive values
Configuration Overview:
- Non-sensitive settings: Stored in
ContribBot.AppHost/appsettings.json - Sensitive settings: Stored securely in .NET user secrets via Aspire dashboard
# Start the application with Aspire orchestration
aspire runThe Aspire AppHost will:
- Read configuration from appsettings.json and user secrets
- Automatically install npm dependencies
- Start the Discord application with proper environment variables
- Provide a monitoring dashboard at the URL shown in console output
The app will start on http://localhost:3000 and register the linked role metadata with Discord.
- Set up a Discord role with "Linked Roles" requirement
- Configure the role to require verification from this application and GitHub
- Users will see "Connect" button in role requirements
- Navigate to the role in Discord server settings
- Click "Connect" next to the Repository Contributor requirement
- Authorize the application to check your GitHub connections
- Discord automatically assigns the role if you've contributed to any configured repositories
Visit http://localhost:3000 and click "Verify Contributions" to manually check your status.