dev #11

Merged
Latte merged 12 commits from dev into main 2026-02-10 19:02:08 +00:00
Owner
No description provided.
Latte added 12 commits 2026-02-10 19:01:54 +00:00
- Created config.yml template with conservative AI limits
- Created owner.py cog (status, reload, ping commands)
- Created config_loader.py service for YAML config
- Created ai_rate_limiter.py for AI cost control
- Updated bot.py to load only 3 cogs (automod, ai_moderation, owner)
- Simplified config.py (removed unused settings)
- Deleted unnecessary cogs, services, models
- Updated models/__init__.py

Next: Update automod and ai_moderation cogs
- Automod cog: 520 -> 100 lines (spam only, no commands)
- AI moderation cog: 664 -> 250 lines (images only, full cost controls)
- Automod service: 600+ -> 200 lines (spam only)
- All cost control measures implemented
- NSFW video domain blocking
- Rate limiting per guild and per user
- Image deduplication
- File size limits
- Configurable via YAML

Next: Update AI providers and models
Changes:
- Strip AI providers to image-only analysis (remove text/phishing methods)
- Simplify guild models (remove BannedWord, reduce GuildSettings columns)
- Create migration to drop unused tables and columns
- Rewrite README for minimal bot focus
- Update CLAUDE.md architecture documentation

Result: -992 lines, +158 lines (net -834 lines)
Cost-conscious bot ready for deployment.
Add blocklist feature to automatically delete ALL media (images, GIFs,
embeds, URLs) from specific users without AI analysis.

Changes:
- Add blocked_user_ids config field to config.yml
- Implement blocklist check in ai_moderation.py (runs before AI checks)
- Update README.md with blocklist documentation

Benefits:
- No AI cost (instant deletion)
- Useful for known spam accounts or problematic users
- Blocks all media types: attachments, embeds, URLs
- Logged for moderation tracking
Fix ImportError caused by removed ModerationResult class.

Changes:
- Remove ModerationResult from ai/__init__.py exports
- Remove unused ContentCategory enum and parse_categories function
- Remove unused imports from ai_moderation.py
- Clean up NullProvider to only have analyze_image method

Fixes bot startup crash.
Mount config.yml into Docker container and provide example template.

Changes:
- Mount config.yml as read-only volume in docker-compose.yml
- Create config.example.yml template for users
- Add config.yml to .gitignore (contains sensitive settings)
- Update README.md with config file setup instructions

Fixes 'Config file not found' error in Docker deployment.

Users should:
1. Copy config.example.yml to config.yml
2. Edit config.yml with their settings
3. Run docker compose up -d
Document which tests need updates after feature removal.

Tests referencing removed features:
- test_verification.py (verification removed)
- test_file_config.py (per-guild config removed)
- test_ai.py (text moderation removed)

conftest.py needs updates for removed model imports.

Core feature tests should still work:
- test_automod.py (spam detection)
- test_nsfw_only_filtering.py (NSFW detection)
Complete overhaul of README.md with better structure and clarity.

New sections:
- Clear overview of what GuardDen is (and isn't)
- Feature comparison table with costs
- Detailed feature descriptions
- Prerequisites table
- Step-by-step Discord bot setup
- Configuration options explained
- Detection flow diagram
- Cost controls breakdown
- Troubleshooting guide
- Project structure
- Development guide

Improvements:
- Professional formatting with tables
- Clear cost transparency
- Better quick start instructions
- Comprehensive configuration guide
- Troubleshooting section for common issues
Improve visibility into why images might not be analyzed in some channels.

Changes:
- Add permission check for 'Manage Messages' before processing
- Add debug logging when skipping messages (already analyzed, no media)
- Add info logging when checking messages (shows channel, attachments, embeds)
- Add warning when AI provider not configured
- Add channel name to rate limit warnings

Debug output now shows:
- Which channels lack permissions
- Why messages are skipped
- Rate limit status per channel
- AI provider configuration status

Helps diagnose: 'bot niet pakt in alle chats de content van images'
Latte merged commit b379bc1422 into main 2026-02-10 19:02:08 +00:00
Latte deleted branch dev 2026-02-10 19:02:08 +00:00
Sign in to join this conversation.