Added defensive error handling to prevent crashes when custom command
creators are missing from the database.
Changes Made:
1. services/custom_commands_service.py:
- Added try/except blocks in get_popular_commands()
- Added try/except blocks in get_commands_needing_warning()
- Added try/except blocks in get_commands_eligible_for_deletion()
- Catches BotException when get_creator_by_id() fails
- Logs warning with command details and continues processing
- Skips problematic commands instead of failing entire operation
2. commands/help/main.py:
- Removed redundant emoji from success message title
- EmbedTemplate.success() already includes check mark emoji
3. tests/test_models_help_command.py:
- Updated test assertions to match new message format
4. tests/test_services_help_commands.py:
- Updated test expectations for error handling behavior
Impact:
- Prevents service crashes when creator data is orphaned or deleted
- Maintains functionality for commands with valid creator data
- Provides visibility into data integrity issues via warning logs
- Ensures automated cleanup tasks can complete successfully
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive admin-managed help system for league documentation,
resources, FAQs, and guides. Replaces planned /links command with a
more flexible and powerful solution.
Features:
- Full CRUD operations via Discord commands (/help, /help-create, /help-edit, /help-delete, /help-list)
- Permission-based access control (admins + Help Editor role)
- Markdown-formatted content with category organization
- View tracking and analytics
- Soft delete with restore capability
- Full audit trail (creator, editor, timestamps)
- Autocomplete for topic discovery
- Interactive modals and paginated list views
Implementation:
- New models/help_command.py with Pydantic validation
- New services/help_commands_service.py with full CRUD API integration
- New views/help_commands.py with interactive modals and views
- New commands/help/ package with command handlers
- Comprehensive README.md documentation in commands/help/
- Test coverage for models and services
Configuration:
- Added HELP_EDITOR_ROLE_NAME constant to constants.py
- Updated bot.py to load help commands
- Updated PRE_LAUNCH_ROADMAP.md to mark system as complete
- Updated CLAUDE.md documentation
Requires database migration for help_commands table.
See .claude/DATABASE_MIGRATION_HELP_COMMANDS.md for details.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>