Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Update voice channel commands to require Major League team ownership for both public and private channels: ## Key Changes - **Major League Team Validation**: Added `_get_user_major_league_team()` method to filter teams by `RosterType.MAJOR_LEAGUE` - **Enhanced Requirements**: Both `/voice-channel public` and `/voice-channel private` now require Major League team ownership - **Improved Error Messages**: Updated error messages to clearly indicate Major League team requirement - **Schedule Integration**: Private channels now properly validate Major League teams for weekly game schedules ## Technical Implementation - **Team Filtering**: Uses `team.roster_type() == RosterType.MAJOR_LEAGUE` to identify 3-character abbreviation teams - **Service Integration**: Leverages existing team service and roster type logic from team model - **Backward Compatibility**: Maintains existing `_get_user_team()` method for potential future use ## Team Type Validation - **Major League**: 3-character abbreviations (NYY, BOS, LAD) - **Required for voice channels** - **Minor League**: 4+ characters ending in "MIL" (NYYMIL, BOSMIL) - **Not eligible** - **Injured List**: Ending in "IL" (NYYIL, BOSIL) - **Not eligible** ## Updated Tests - **Mock Team Updates**: Added `roster_type()` method mocking to test team objects - **Async Service Mocking**: Fixed team service mocks to return proper async results - **Error Message Assertions**: Updated test assertions for new error messages - **Type Safety**: Enhanced mock objects with proper Discord voice channel specifications ## Documentation Updates - **README.md**: Added comprehensive team validation logic explanation - **Architecture Documentation**: Detailed team type requirements and rationale - **Code Examples**: Included implementation snippets for team filtering logic **Rationale**: Voice channels are for scheduled gameplay between Major League teams. Minor League and Injured List teams don't participate in weekly games, so restricting access ensures proper schedule integration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| api | ||
| commands | ||
| models | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| views | ||
| .gitignore | ||
| bot.py | ||
| config.py | ||
| constants.py | ||
| exceptions.py | ||
| requirements.txt | ||
| test_real_data.py | ||