diff --git a/modules/commands/base_command.py b/modules/commands/base_command.py index 5dd10fe..b753693 100644 --- a/modules/commands/base_command.py +++ b/modules/commands/base_command.py @@ -543,6 +543,13 @@ class BaseCommand(ABC): # Check if channel matches allowed list return message_channel_normalized in allowed_normalized + def is_enabled(self) -> bool: + """Return whether this command is enabled per config.""" + for attr_name, attr_val in vars(self).items(): + if attr_name.endswith('_enabled') and isinstance(attr_val, bool): + return attr_val + return True + def can_execute(self, message: MeshMessage, skip_channel_check: bool = False) -> bool: """Check if this command can be executed with the given message. diff --git a/modules/commands/cmd_command.py b/modules/commands/cmd_command.py index b45afe5..c6eec0a 100644 --- a/modules/commands/cmd_command.py +++ b/modules/commands/cmd_command.py @@ -97,6 +97,8 @@ class CmdCommand(BaseCommand): for cmd_name, cmd_instance in self.bot.command_manager.commands.items(): # Skip system commands without keywords (like greeter) if hasattr(cmd_instance, 'keywords') and cmd_instance.keywords: + if hasattr(cmd_instance, 'is_enabled') and not cmd_instance.is_enabled(): + continue if not self._is_command_valid_for_channel(cmd_name, cmd_instance, message): continue all_commands.append(cmd_name)