Skip to content

vegalyraevt/Discord_LinkBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkBot - Discord Link Safety & Embed Fixer

Invite LinkBot Ko-fi License: MIT

A modular, $0-cost Discord bot that makes links safer, smarter, and more fun... with a Legend of Zelda theme?

In a society built around obfuscation and tracking, LinkBot helps make Discord servers just a bit more safe, private, and enjoyable without being intrusive.

derp-link-meme-7

What It Does

🛡️ Safety 📋 Link Enrichment ⚙️ Server Management 🎮 Fun
Phishing detection (SinkingYachts) YouTube/Twitch info embeds Per-server JSON config Zelda Easter eggs
VirusTotal scanning (70+ engines) Steam game deals & pricing Domain blacklist/whitelist Keyword reactions
Suspicious TLD detection (.tk, .xyz, etc.) Amazon product previews Rate limiting & spam protection Pot smashing animations
HTTP downgrade warnings IMDb movie details Duplicate link detection Cucco swarm reactions
Domain age check (RDAP) Wikipedia summaries Trusted role bypass Triforce reactions
Executable file danger alerts GitHub repo/code previews Notification & audit channels Rare item drops
Redirect chain inspection Music link aggregation (Odesli) Command cooldowns 5% Song chance
Safety score card (0-10) Wayback Machine archiving NSFW content warnings
URL unshortening Academic papers (DOI, arXiv) Manager role delegation
npm / PyPI package info Disabled/opt-in channels
Stack Overflow question previews
Hacker News, Dev.to, Bluesky

Slash Commands

🔍 Everyone

Command Description
/scan <url> Full safety scan with VirusTotal
/safety <url> Quick safety score check
/unshorten <url> Expand shortened URLs (show all hops)
/archive <url> Submit to Wayback Machine
/whois <domain> Domain registration lookup (configurable)
/stats Global bot usage statistics
/help Feature overview & command list
/config show View current server settings

⚙️ Management (Manage Server or manager role required)

Command Description
/setup Interactive setup wizard
/config toggle <feature> Enable/disable any feature
/config threshold <1-10> Set safety alert sensitivity
/config notify set #channel Set mod notification channel
/config log set #channel Set audit log channel
/config manager add @role Delegate management to a role
/blacklist add/remove/list <domain> Block unwanted domains
/whitelist add/remove/list <domain> Allow-only mode
/trusted add/remove/list @role Safety bypass roles

Supported Embed-Fix Platforms

LinkBot detects links from these platforms and replaces them with embed-friendly proxies, then reposts via webhook - perfectly impersonating the original author:

Platform Proxy Notes
Twitter / X fixupx.com Supports .translate.spanish suffix
TikTok tnktok.com
Instagram uuinstagram.com Backup: gginstagram.com, d.vxinstagram.com
Reddit rxddit.com
Pixiv phixiv.net Supports .translate.japanese suffix
Bluesky bskyx.app
Threads vxthreads.net

YouTube Shorts are automatically converted to regular youtube.com/watch?v= URLs.


How It Works - 15-Stage Pipeline

Every message runs through this pipeline:

Channel Filter → Rate Limiting → Duplicate Check → Trusted Bypass
→ Blacklist/Whitelist → Unshorten → Phishing Check → File Inspection
→ Suspicious TLD → HTTP Downgrade → Domain Age → VirusTotal
→ Safety Score Card → Enrichment → Tracking Strip → NSFW → Easter Eggs
→ Embed Fixer (webhook repost, delete original)

Quick Start

Prerequisites

  • Python 3.10+
  • Discord bot token with Message Content Intent enabled
  • (Optional) VirusTotal API key (free, 500 req/day)
  • (Optional) OMDb API key (free, 1000/day)

Installation

git clone https://github.com/vegalyraevt/LinkBot.git
cd LinkBot
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your DISCORD_BOT_TOKEN
python main.py

Bot Permissions Required: Read Messages, Send Messages, Manage Messages, Manage Webhooks, Read Message History, Timeout Members (optional)


Project Structure

linkbot/
├── main.py                    # Discord Bot + 15-stage message router
├── commands.py                # 12 slash command definitions
├── moderation.py              # Rate limiting, duplicates, logging, cooldowns
├── config_manager.py          # Per-server JSON config (config/{id}.json)
├── permissions.py             # RBAC (owner / Manage Server / manager roles)
├── stats.py                   # Global usage tracker (stats.json)
├── blacklist.py               # Domain blacklist/whitelist enforcement
├── channel_filter.py          # Channel allow/deny/command restriction
├── embeds.py                  # Link fixer, tracking stripper, NSFW detection
├── easter_eggs.py             # Zelda responses, reactions, rare drops
├── safety/
│   ├── __init__.py            # 7 safety check functions
│   ├── rdap.py                # Domain age lookup (free RDAP)
│   ├── virustotal.py          # VirusTotal API integration
│   └── scorecard.py           # 0-10 composite safety scoring
├── enrichment/
│   ├── __init__.py            # Router + music + Wikipedia + Discord quotes
│   ├── github.py              # GitHub blob/repo/user previews
│   ├── storefronts.py         # Steam, Amazon, IMDb
│   ├── multimedia.py          # YouTube, Twitch (oEmbed)
│   ├── academic.py            # DOI, arXiv, npm, PyPI, Stack Overflow, Gist
│   ├── social.py              # Hacker News, Dev.to, Bluesky
│   └── archive.py             # Wayback Machine auto-snapshot
├── config/
│   └── defaults.json          # Global defaults (30+ settings)
├── requirements.txt
├── README.md
├── CONTRIBUTING.md
└── SECURITY.md

Easter Eggs

The bot includes hidden Legend of Zelda references that trigger automatically, adding charm without interrupting normal conversations:

Direct Ping Response

Mention the bot with @LinkBot for one of:

  • 55% chance: Iconic quotes from Zelda games, the 1989 cartoon, and CD-i spin-offs
  • 35% chance: A random image from the images/ folder
  • 10% chance: A random sound from the sounds/ folder
  • 5% chance (on top): Special Youtube Video!

Setting up media responses: Create two folders in the bot root directory: images/ (accepts .png, .jpg, .jpeg, .gif) and sounds/ (accepts .mp3, .wav, .ogg). These folders are gitignored. The bot picks randomly from whatever you place there. No files = text responses only.

Screenshot 2026-02-22 225851 Screenshot 2026-02-22 225953

Pot Reaction

Keywords like pot, smash, vase, burglary, loot, destroy trigger custom Link + Pot emoji reactions.

Screenshot 2026-02-22 230053

Cucco Reaction

Keywords like cucco, chicken, peck, flock, revenge trigger chicken + Link emoji reactions.

Screenshot 2026-02-22 230204

Triforce Reaction

Keywords like wisdom, courage, power, triforce, goddess trigger an animated Triforce emoji.

Screenshot 2026-02-22 230222

Rare Item Drop

When a link is fixed and reposted via webhook, there's a 5% chance of:

Da-da-da-daaa! 🗝️


Troubleshooting

  • Bot not responding? Ensure Message Content Intent is enabled in the Discord Developer Portal.
  • Permission errors? Verify the bot's role has the required permissions in your server.
  • Token issues? Regenerate your token in the Discord Developer Portal.
  • Slash commands not appearing? Wait up to 1 hour for Discord to cache, or kick + re-invite the bot to force a refresh.

Contributing

See CONTRIBUTING.md for guidelines. Security professionals are especially welcome to review implementations and suggest improvements.


Security

See SECURITY.md for vulnerability reporting and safe harbor.


Disclaimer

The Legend of Zelda, Link, and all related properties are trademarks of Nintendo Co., Ltd. This project is not affiliated with, endorsed by, or sponsored by Nintendo. All Zelda-related references are used as fan tribute only in a free, non-commercial project.


License

MIT


This project was developed by me, a solo developer who wanted this project to exist not because I'm an expert in security, but because Discord servers deserve better link safety. Also note AI tools (Deepseek, Qwen via local LLM, and Cursor) were used to assist with some feature implementations and debugging.

About

HYYAAAAA! A modular Discord bot that keeps links safe with phishing detection, VirusTotal scanning, and domain age checks. Fixes broken embeds for Twitter/X, TikTok, Instagram, Reddit, Pixiv, Bluesky, and Threads. Enriches links with previews for YouTube, Twitch, Steam, GitHub, Amazon, IMDb, Wikipedia, and more. All with a Legend of Zelda theme.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages