diff options
| -rw-r--r-- | bot/command.py | 15 | 
1 files changed, 15 insertions, 0 deletions
| diff --git a/bot/command.py b/bot/command.py new file mode 100644 index 000000000..92e61d97e --- /dev/null +++ b/bot/command.py @@ -0,0 +1,15 @@ +from discord.ext import commands + + +class Command(commands.Command): +    """ +    A `discord.ext.commands.Command` subclass which supports root aliases. + +    A `root_aliases` keyword argument is added, which is a sequence of alias names that will act as +    top-level commands rather than being aliases of the command's group. It's stored as an attribute +    also named `root_aliases`. +    """ + +    def __init__(self, *args, **kwargs): +        super().__init__(*args, **kwargs) +        self.root_aliases = kwargs.get("root_aliases", []) | 
