Commit Graph

30 Commits

Author SHA1 Message Date
537ae15998 fix: Remove ModerationResult and unused imports from AI services
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.
2026-01-27 20:10:31 +01:00
cb6049361e feat: Add user blocklist for instant media deletion
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
2026-01-27 19:58:40 +01:00
df8da05f36 docs: Update project description to reflect minimal bot focus 2026-01-27 19:30:38 +01:00
b4f29a9d5e feat: Complete minimal bot refactor - AI providers, models, docs, and migration
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.
2026-01-27 19:25:57 +01:00
d972f6f51c feat: Complete cog and service rewrites
- 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
2026-01-27 19:17:18 +01:00
08815a3dd0 WIP: Minimal bot refactor - new files and core updates
- 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
2026-01-27 18:58:56 +01:00
d4cc23f7cf update 2026-01-25 17:21:41 +01:00
9c59413cfa added help 2026-01-25 17:15:17 +01:00
f50b7fc5f0 added whitelist and more 2026-01-25 17:00:49 +01:00
a9cf50986c update 2026-01-25 16:46:50 +01:00
97c4bfd285 Reduce strike action timeout from 1 hour to 5 minutes
- Updated strike level 3 timeout duration from 3600s (1 hour) to 300s (5 minutes)
- Changes applied across models, config defaults, templates, schemas, and tests
- Makes moderation system less harsh while maintaining discipline
2026-01-25 09:40:21 +01:00
7612770625 Merge pull request 'commit, am too tired to add docs here' (#8) from feature/nsfw-only-filtering into main
Reviewed-on: #8
2026-01-25 08:09:50 +00:00
1e3acf05d0 commit, am too tired to add docs here 2026-01-25 09:09:07 +01:00
98d50dd578 Merge pull request 'feature/nsfw-only-filtering' (#7) from feature/nsfw-only-filtering into main
Reviewed-on: #7
2026-01-24 22:59:06 +00:00
32d63284c7 delete workflow 2026-01-24 23:57:31 +01:00
1250b5573c Add NSFW-only filtering mode for content moderation
Some checks failed
NSFW-Only Filtering Tests / NSFW-Only Filtering Feature Tests (push) Has been cancelled
- Add nsfw_only_filtering field to GuildSettings model
- Create database migration for new field (20260124_add_nsfw_only_filtering)
- Update AI moderation logic to respect NSFW-only mode
- Add Discord command !ai nsfwonly <true/false> for toggling mode
- Implement filtering logic in image analysis for both attachments and embeds
- Add comprehensive test suite for new functionality
- Update documentation with usage examples and feature description
- Create dedicated CI workflow for testing NSFW-only filtering feature

When enabled, only sexual/nude content is filtered while allowing:
- Violence and gore
- Harassment and bullying
- Hate speech
- Self-harm content
- Other content categories

This mode is useful for gaming communities and mature discussion
servers that have specific content policies allowing violence
but prohibiting sexual material.
2026-01-24 23:51:10 +01:00
824dd681f7 quick update
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m49s
CI/CD Pipeline / Security Scanning (push) Successful in 15s
CI/CD Pipeline / Tests (3.11) (push) Failing after 4m58s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m0s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
2026-01-24 19:14:33 +01:00
574a07d127 Update dashboard and Docker compose
Some checks failed
CI/CD Pipeline / Security Scanning (push) Has been cancelled
CI/CD Pipeline / Tests (3.11) (push) Has been cancelled
CI/CD Pipeline / Tests (3.12) (push) Has been cancelled
CI/CD Pipeline / Build Docker Image (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
2026-01-24 19:14:00 +01:00
a5811113f0 improve accuracy
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m50s
CI/CD Pipeline / Security Scanning (push) Successful in 16s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m44s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m37s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
2026-01-24 17:37:09 +01:00
136ae04388 fix giff issue
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m56s
CI/CD Pipeline / Security Scanning (push) Successful in 16s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m43s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m36s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
2026-01-24 16:53:13 +01:00
abef368a68 update
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 4m49s
CI/CD Pipeline / Security Scanning (push) Successful in 15s
CI/CD Pipeline / Tests (3.11) (push) Successful in 9m41s
CI/CD Pipeline / Tests (3.12) (push) Successful in 9m36s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
Dependency Updates / Update Dependencies (push) Successful in 29s
2026-01-17 21:57:04 +01:00
831eed8dbc quick commit
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 6m9s
CI/CD Pipeline / Security Scanning (push) Successful in 26s
CI/CD Pipeline / Tests (3.11) (push) Failing after 5m24s
CI/CD Pipeline / Tests (3.12) (push) Failing after 5m23s
CI/CD Pipeline / Build Docker Image (push) Has been skipped
CI/CD Pipeline / Deploy to Staging (push) Has been skipped
CI/CD Pipeline / Deploy to Production (push) Has been skipped
CI/CD Pipeline / Notification (push) Successful in 1s
2026-01-17 20:24:43 +01:00
95cc3cdb8f Fix: make Grafana optional and allow README in build 2026-01-17 20:24:16 +01:00
c9a26a285a update 2026-01-16 20:13:26 +01:00
2da5e8d331 Fix: initialize guild config for existing servers on startup 2026-01-16 19:47:53 +01:00
185deb5df4 Include AI dependencies in Docker image 2026-01-16 19:39:56 +01:00
d093dd7c6d Add Discord bot setup instructions to README 2026-01-16 19:36:46 +01:00
534fbaf768 Fix Docker build: copy src before pip install, update license format 2026-01-16 19:32:54 +01:00
4e16777f25 Implement GuardDen Discord moderation bot
Features:
- Core moderation: warn, kick, ban, timeout, strike system
- Automod: banned words filter, scam detection, anti-spam, link filtering
- AI moderation: Claude/OpenAI integration, NSFW detection, phishing analysis
- Verification system: button, captcha, math, emoji challenges
- Rate limiting system with configurable scopes
- Event logging: joins, leaves, message edits/deletes, voice activity
- Per-guild configuration with caching
- Docker deployment support

Bug fixes applied:
- Fixed await on session.delete() in guild_config.py
- Fixed memory leak in AI moderation message tracking (use deque)
- Added error handling to bot shutdown
- Added error handling to timeout command
- Removed unused Literal import
- Added prefix validation
- Added image analysis limit (3 per message)
- Fixed test mock for SQLAlchemy model
2026-01-16 19:27:48 +01:00
ffe42b6d51 Initial commit 2026-01-16 17:40:45 +00:00