A Discord bot that automatically fixes URLs posted in your server by applying customizable transformations to links from specific domains.
- Domain-Specific Fixes: Configure different fixes for different domains
- Multiple Fixer Types:
- Replace: Simple string replacement in URLs
- Regex Replace: Advanced pattern matching with capture groups
- Prepend: Add prefixes to URLs
- Per-Server Configuration: Each Discord server maintains its own set of URL fixers
Perfect for fixing common URL issues like:
- Converting mobile links to desktop versions
- Adding bypass parameters for paywalled content
- Redirecting through privacy-friendly frontends
- Fixing broken social media embeds
Run the latest Docker image using:
docker run carreter/discord-linkfixer-bot -token YOUR_DISCORD_BOT_TOKENRelease binaries are also available here.
- Go 1.24.4 or later
- Discord bot token
git clone https://github.com/carreter/discord-linkfixer-bot
cd discord-linkfixer-botgo build -o linkfixer-bot
./linkfixer-bot -token YOUR_DISCORD_BOT_TOKENFlags:
-token YOUR_DISCORD_BOT_TOKEN: Your Discord bot token-db PATH: Path to database file (default:./fixers.db)
Register a simple string replacement fixer.
domain: The domain to apply this fixer toold: Substring to replacenew: Replacement substring
Example: Fix Twitter mobile links
/replace-fixer domain:twitter.com old:mobile.twitter.com new:twitter.com
Register a regex-based fixer with capture groups.
domain: The domain to apply this fixer topattern: Regular expression patternreplacement: Replacement string (use$1,$2, etc. for capture groups)
Example: Convert Reddit mobile links
/regexp-replace-fixer domain:reddit.com pattern:m\.reddit\.com replacement:old.reddit.com
Add a prefix to URLs from a domain.
domain: The domain to apply this fixer toprefix: String to prepend to the URL
Example: Add privacy redirect
/prepend-fixer domain:youtube.com prefix:https://invidio.us/
List all registered fixers for the current server.
Remove a fixer for a specific domain.
domain: Domain of the fixer to delete
Register fixers from a CSV file attachment.
Currently, rows can haven one of two formats:
prepend,<domain>,<prefix>, orreplace,<domain>,<old>,<new>
These correspond to the /prepend-fixer and /replace-fixer commands, respectively.
├── main.go # Entry point
├── pkg/
│ ├── fixer/ # URL fixer implementations
│ │ ├── fixer.go # Fixer interfaces and types
│ │ └── store.go # BoltDB storage layer
│ └── linkfixerbot/ # Discord bot implementation
│ ├── bot.go # Main bot logic
│ └── commands/ # Slash command handlers
MIT License - see LICENSE file for details.
Contributions welcome! Please open an issue or submit a pull request.
