Major Domo v2 - Discord bot for Strat-o-Matic Baseball Association
|
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m11s
The previous code attempted to register a maintenance mode gate via @self.tree.interaction_check inside setup_hook. That pattern is invalid in discord.py — interaction_check is an overridable method on CommandTree, not a decorator. The assignment was silently dropped, making maintenance mode a no-op and producing a RuntimeWarning about an unawaited coroutine. Changes: - Add MaintenanceAwareTree(discord.app_commands.CommandTree) that overrides interaction_check: blocks non-admins when bot.maintenance_mode is True, always passes admins through, no-op when maintenance mode is off - Pass tree_cls=MaintenanceAwareTree to super().__init__() in SBABot.__init__ - Add self.maintenance_mode: bool = False to SBABot.__init__ - Update /admin-maintenance command to actually toggle bot.maintenance_mode - Add tests/test_bot_maintenance_tree.py with 8 unit tests covering all maintenance mode states, admin pass-through, DM context, and missing attr Closes #82 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .gitea/workflows | ||
| .scripts | ||
| .vscode | ||
| api | ||
| commands | ||
| models | ||
| services | ||
| tasks | ||
| tests | ||
| utils | ||
| views | ||
| .dockerignore | ||
| .gitignore | ||
| bot.py | ||
| CLAUDE.md | ||
| COMMAND_LIST.md | ||
| config.py | ||
| docker-compose.dev.yml | ||
| docker-compose.yml | ||
| DOCKER.md | ||
| Dockerfile | ||
| exceptions.py | ||
| pyrightconfig.json | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| VERSION | ||