Inspect AI image generation metadata from Discord uploads. Enhanced fork with powerful security features and streamlined setup.
- Features
- Quick Start
- How to Use
- Security System
- AI Provider Setup
- R2 Upload Feature
- Configuration
- Permissions
- Troubleshooting
- Legal
- 🔍 Comprehensive Metadata Parsing - Supports Forge/A111, 200+ ComfyUI nodes (FLUX, PixArt, Griptape, etc.) as well as SwarmUI etc.
- ✨ JPG Upload Support Where Discord fails, there is a R2 bucketing support for Jpeg/WebP Upload/Processing support.
- 1️⃣2️⃣3️⃣ Multiple Interaction Styles - Numbered emoji reactions, slash commands, or context menus
- 📦 Batch Processing - Handle 6+ images with a single reaction
- 👥 PluralKit Support - Automatically resolves proxied messages
- 💾 Lightweight - Runs metadata parser in separate process (~100MB RAM)
- ✨
/describe- Generate AI descriptions (Danbooru tags or natural language) - 💬
/ask- Conversational AI with context memory - 💬
/coder- Coding Help with AI context. - 💬
/techsupport- Will ask you if you turned it off and on again. - 🔄 Multi-Provider - Gemini + Claude with automatic fallback
- 🛡️ Anti-Scam Detection - Behavior-based crypto/wallet spam detection
- 🚫 Cross-Posting Protection - Instant ban for spam across multiple channels
- 🔒 Malware Prevention - Magic bytes check on attachments and embeds
- 📊 Smart Scoring - Context-aware detection (allows emotional spam from trusted users)
Local Setup
# Clone and setup
git clone https://github.com/Ktiseos-Nyx/PromptInspectorBot.git
cd PromptInspectorBot
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# Configure
cp config.example.toml config.toml
# Edit config.toml with your settings
# Run (new modular version)
python3 main.pyDocker Deployment
# Build
docker build -t prompt-inspector-bot .
# Run with .env file
docker run -d --env-file .env prompt-inspector-botEnvironment Variables (Required)
BOT_TOKEN=your_discord_bot_token
# Optional but recommended
GEMINI_API_KEY=your_gemini_key
ANTHROPIC_API_KEY=your_claude_key- Post an image in a monitored channel
- Click emoji reactions:
- 1️⃣ 2️⃣ 3️⃣ 4️⃣ 5️⃣ - View individual image metadata (1-5 images)
- 📦 - Download all metadata as files (6+ images)
- Or use commands:
/metadata <image>- Parse uploaded image- Right-click image → "View Prompt"
/ask <question>- Chat with AI (remembers context per user)/describe <image> <style>- Generate AI tags/descriptions
🛡️ Anti-Scam Features
Type 1: Wallet Scammers
- Currency symbols in username (£, €, ¥, ₿)
- Hoisting characters (=, !, #)
- ALL CAPS crypto spam
- Keywords: WALLET, SOL, PAY, DEAD TOKENS
Type 2: Screenshot Spammers
- 4+ images cross-posted to multiple channels
- Gibberish text or empty messages
- Auto-generated usernames (word.word1234_5678)
| Score | Action |
|---|---|
| 100+ | Instant Ban - User banned, all messages deleted |
| 75-99 | Delete + Alert - Message removed, admins notified |
| 50-74 | Watchlist - Logged for monitoring |
✅ Magic Bytes Check - Scans attachments AND embeds for malware ✅ Cross-Posting - Same message in 2+ channels = ban ✅ Gibberish Detection - Context-aware (allows "AAAA" from users with roles) ✅ Username Analysis - Hoisting, currency symbols, auto-generated patterns ✅ Role Tracking - CATCHER role exploitation detection
# config.toml
CATCHER_ROLE_ID = 1336289642789470228 # Self-assignable role scammers exploit
TRUSTED_USER_IDS = [123456789] # Bypass security (mods, bots)
ADMIN_CHANNEL_ID = 1234567890 # Ban notification channelAutomatic Bypasses:
- ✅ Server owners
- ✅ Trusted users (configured above)
🤖 Multi-Provider System
The bot supports both Gemini and Claude with automatic fallback!
# Set API keys for providers you want
GEMINI_API_KEY=your_gemini_key
ANTHROPIC_API_KEY=your_claude_key
# Provider priority (tries first, falls back to next)
LLM_PROVIDER_PRIORITY=claude,geminiGEMINI_PRIMARY_MODEL=gemini-flash-latest
GEMINI_FALLBACK_MODELS=gemini-flash-latest,gemini-2.5-pro,gemini-2.5-flashModel Recommendations:
| Model | Speed | Quality | Free Tier | Best For |
|---|---|---|---|---|
gemini-flash-latest |
⚡⚡⚡ | Good | 15/min | Recommended |
gemini-2.5-pro |
⚡ | Excellent | 2/min | Complex tasks |
gemini-2.5-flash |
⚡⚡⚡ | Good | 15/min |
CLAUDE_PRIMARY_MODEL=claude-3-5-haiku-20241022Model Recommendations:
| Model | Speed | Cost (per 1M tokens) | Best For |
|---|---|---|---|
claude-3-5-haiku-20241022 |
⚡⚡⚡ | $0.25 / $1.25 | Recommended |
claude-3-5-sonnet-20241022 |
⚡⚡ | $3 / $15 | Higher quality |
Budget tip: $5 starter credit = ~1,500 image descriptions with Haiku!
If Gemini blocks artistic content (PG-13/R-rated, not NC-17):
NSFW_PROVIDER_OVERRIDE=claudeThis skips Gemini entirely for /describe and uses only Claude.
📤 Cloudflare R2 Integration
Upload JPEG/WebP files to extract metadata without Discord stripping it.
- 🔒 Rate Limited - Generous rate limiting to prevent CPU overload.
- 🗑️ Auto-Delete - 30-day retention
- 📏 Size Limited - 10MB max to keep to Non-Nitro.
- Create R2 Bucket in Cloudflare
- Set environment variables:
R2_ACCOUNT_ID=your_account_id
R2_ACCESS_KEY_ID=your_access_key
R2_SECRET_ACCESS_KEY=your_secret_key
R2_BUCKET_NAME=your_bucket_name
UPLOADER_URL=https://your-pages.pages.dev/uploader.html- Deploy
uploader.htmlto Cloudflare Pages - Set lifecycle rule for 30-day auto-deletion:
- Prefix:
uploads/ - Action: Delete object
- Days: 30
- Prefix:
- ✅ Rate limiting (5/day per user)
- ✅ File validation (10MB, JPEG/WebP only)
- ✅ Presigned URL expiry (1 hour)
- ✅ Auto-deletion (30 days)
⚠️ Users warned about security risks
⚙️ Full Configuration Options
# Allowed servers (empty = all servers)
ALLOWED_GUILD_IDS = [123456789, 987654321]
# Monitored channels (empty = all channels)
MONITORED_CHANNEL_IDS = []
# Per-channel features
[channel_features]
1234567890 = ["metadata", "describe"]
9876543210 = ["ask"]REACT_ON_NO_METADATA = false
EMOJI_METADATA_FOUND = "🔎"
EMOJI_NO_METADATA = "⛔"
SCAN_LIMIT_BYTES = 10485760 # 10MBLLM_PROVIDER_PRIORITY = ["claude", "gemini"]
GEMINI_PRIMARY_MODEL = "gemini-flash-latest"
CLAUDE_PRIMARY_MODEL = "claude-3-5-haiku-20241022"CATCHER_ROLE_ID = 1336289642789470228
TRUSTED_USER_IDS = []
ADMIN_CHANNEL_ID = 0- ✅ Read Messages/View Channel
- ✅ Send Messages
- ✅ Read Message History
- ✅ Add Reactions
- ✅ Attach Files
- 🛡️ Ban Members - Auto-ban scammers
- 🛡️ Manage Messages - Delete spam
Common Issues
Bot not responding:
- Check bot is online
- Verify permissions (see above)
- Check logs for errors
Describe feature not working:
- Ensure
GEMINI_API_KEYorANTHROPIC_API_KEYis set - Check API quotas
- Review logs for API errors
Images not processed:
- Check file format (PNG, JPEG, WebP)
- Verify size is under
SCAN_LIMIT_BYTES - Ensure channel is in
MONITORED_CHANNEL_IDS(if configured)
Security system banning legit users:
- Add user ID to
TRUSTED_USER_IDS - Server owners are automatically trusted
- Users with roles can post emotional spam ("AAAA")
🍴 Important Notes for Forks
If you're forking this bot for your own use, please update the following:
-
Ko-fi Links - Replace with your own: -
uploader.html: Lines 112, 114bot_enhanced.py: Search forko-fi.com/OTNAngelandko-fi.com/duskfallcrew- Update to your Ko-fi/donation links
-
Discord Invite - Replace with your server:
uploader.html: Line 117 -discord.gg/HhBSvM9gBYbot_enhanced.py: Search fordiscord.gg/HhBSvM9gBY- Update to your support server invite
-
Ko-fi Role ID - Set your role ID:
config.toml: AddKOFI_SUPPORTER_ROLE_ID = your_role_id- Get from Discord → Server Settings → Roles → Right-click role → Copy ID
- Keep the Ko-fi link in
uploader.htmlif you want to support the original developer - Credit this fork in your README
- Share improvements back via pull requests!
You can adjust these in bot_enhanced.py:
MAX_UPLOADS_PER_MINUTE = 10 # Burst protection
MAX_UPLOADS_PER_DAY_FREE = 100 # Free users
MAX_UPLOADS_PER_DAY_SUPPORTER = 500 # Ko-fi supporters- 📄 Privacy Policy - How we handle data (TL;DR: we don't store it)
- 📜 Terms of Service - The rules
Quick Summary:
- ✅ Extract metadata, send to you
- ✅ Delete images immediately after processing
- ❌ Don't store images or metadata
- ❌ Don't track or sell data
🤖 This bot is a fork of PromptInspectorBot with significant enhancements.




