bug: maintenance mode interaction_check is never registered (no-op) #82
Labels
No Label
ai-changes-requested
ai-pr-opened
ai-reviewed
ai-reviewing
ai-working
in-next-release
status/in-progress
status/pr-open
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-v2#82
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
setup_hookinbot.pyuses@self.tree.interaction_checkas a decorator, butCommandTree.interaction_checkis an async method meant to be overridden via subclassing, not a decorator factory. The result:Impact
/admin-maintenanceappears to toggle maintenance mode but no commands are actually blocked for non-admin users.Fix
MaintenanceAwareTree(discord.app_commands.CommandTree)subclass that overridesinteraction_checktree_cls=MaintenanceAwareTreetoBot.__init__@self.tree.interaction_checkblock fromsetup_hookIntroduced in commit
e3610e8.Fixed in PR #84.
Approach: Added
MaintenanceAwareTree(discord.app_commands.CommandTree)that overridesinteraction_checkwith the maintenance check logic. Passedtree_cls=MaintenanceAwareTreetoSBABot.__init__and removed the broken@self.tree.interaction_checkdecorator block fromsetup_hook. 945 tests passing.