Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
Go to file
Cal Corum b61cad2478 CLAUDE: Refactor dice roll functions to use DiceRoll dataclass
Replaced dictionary return values with a DiceRoll dataclass for better
type safety and cleaner code.

Changes:
- Added DiceRoll dataclass with fields: dice_notation, num_dice, die_sides, rolls, total
- Updated _parse_and_roll_single_dice() to return Optional[DiceRoll]
- Updated _parse_and_roll_multiple_dice() to return list[DiceRoll]
- Updated _roll_weighted_scout_dice() to return list[DiceRoll]
- Updated _create_multi_roll_embed() to accept list[DiceRoll]
- Updated _create_fielding_embed() to accept list[DiceRoll]
- Changed all dict key access (result['total']) to dataclass attributes (result.total)
- Updated logging statements to use dataclass attributes
- Updated all 34 test cases to use DiceRoll dataclass

Benefits:
- Improved type safety with explicit dataclass types
- Better IDE autocomplete and type checking
- More maintainable code with clear data structures
- No runtime changes - all functionality preserved

All 34 dice command tests pass.
2025-10-14 14:28:19 -05:00
api CLAUDE: Fix /set-image command to use query parameters for API updates 2025-10-13 17:52:14 -05:00
commands CLAUDE: Refactor dice roll functions to use DiceRoll dataclass 2025-10-14 14:28:19 -05:00
models CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
services CLAUDE: Add graceful error handling for missing creators in custom commands 2025-10-13 17:53:58 -05:00
tasks CLAUDE: Comprehensive bot improvements and test infrastructure 2025-10-02 11:35:26 -05:00
tests CLAUDE: Refactor dice roll functions to use DiceRoll dataclass 2025-10-14 14:28:19 -05:00
utils CLAUDE: Fix type annotations in CacheManager for JSON-serializable types 2025-10-14 00:22:01 -05:00
views CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
.gitignore CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
bot.py CLAUDE: Implement soak easter egg with disappointment GIFs and tracking 2025-10-13 23:25:22 -05:00
config.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
constants.py CLAUDE: Implement custom help commands system 2025-10-10 13:14:13 -05:00
exceptions.py CLAUDE: Initial commit for discord-app-v2 rebuild 2025-08-15 00:04:50 -05:00
PRE_LAUNCH_ROADMAP.md CLAUDE: Implement player image management system 2025-10-10 13:54:12 -05:00
requirements.txt CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00
test_real_data.py CLAUDE: Major bot enhancements - Admin commands, player stats, standings, schedules 2025-08-28 15:32:38 -05:00