A Discord bot that analyzes every URL sent in chat using VirusTotal and takes appropriate actions.
This bot helps Discord server moderators by scanning all URLs shared in the server using VirusTotal.
If malicious content is detected, it can notify the server or respond accordingly.
- 🖼️ URL Detection:
- Detects URLs from messages and edited messages using regex.
- 🔍 VirusTotal Integration:
- Analyzes each URL with VirusTotal's API to retrieve safety stats.
- 📨 User Notifications:
- Sends a message with analysis results for detected URLs.
- 🐍 Python 3.12 (Tested and stable; Python 3.13.1 caused dependency issues)
- 🤖 Discord.py
- 🛠️ VirusTotal API
- 📡 Requests
-
Clone the repository:
git clone /~https://github.com/Yajus114/virustotal-discord-bot.git cd virustotal-discord-bot
-
Install dependencies:
pip install -r requirements.txt
-
Prepare the credentials file:
- Create a
.env
file in the root directory with:TOKEN=YOUR_DISCORD_TOKEN API_KEY=YOUR_VIRUSTOTAL_API_KEY
- Create a
-
Run the bot:
python virustotal_discord_bot.py
This bot uses the VirusTotal API to analyze URLs. Ensure you comply with VirusTotal's usage policies and never use this tool maliciously.
- 🛑 Delete malicious messages automatically.
- 🚨 Notify moderators/admins about malicious links.
- 🗂️ Log scanned URLs in a database.
- 🚷 Optionally ban users for repeated malicious link sharing.