[commands] Add basic support for extensions.

This commit is contained in:
Rapptz
2016-01-09 18:33:37 -05:00
parent 0a07fc088c
commit b87d5e5337
2 changed files with 58 additions and 1 deletions

View File

@@ -316,6 +316,12 @@ class GroupMixin:
self.commands = {}
super().__init__(**kwargs)
def recursively_remove_all_commands(self):
for command in self.commands.copy().values():
if isinstance(command, GroupMixin):
command.recursively_remove_all_commands()
self.remove_command(command.name)
def add_command(self, command):
"""Adds a :class:`Command` or its superclasses into the internal list
of commands.