Enable an entire category of commands. :param category: the category to enable
(self, category: str)
| 5623 | del self.disabled_commands[command] |
| 5624 | |
| 5625 | def enable_category(self, category: str) -> None: |
| 5626 | """Enable an entire category of commands. |
| 5627 | |
| 5628 | :param category: the category to enable |
| 5629 | """ |
| 5630 | # If the category is already enabled, then return |
| 5631 | if category not in self.disabled_categories: |
| 5632 | return |
| 5633 | |
| 5634 | for command in list(self.disabled_commands): |
| 5635 | command_func = self.disabled_commands[command].command_func |
| 5636 | if self._get_command_category(command_func) == category: |
| 5637 | self.enable_command(command) |
| 5638 | |
| 5639 | del self.disabled_categories[category] |
| 5640 | |
| 5641 | def disable_command(self, command: str, message_to_print: str) -> None: |
| 5642 | """Disable a command and replace its functions with disabled versions. |