diff options
| author | 2020-08-24 10:10:38 -0700 | |
|---|---|---|
| committer | 2020-08-24 10:10:38 -0700 | |
| commit | fa28bf6de4dd5c5412b68d4ad448e0b4cb15cfac (patch) | |
| tree | 97bc90ff1d8f43c110f9d793c7792d26dcb12900 | |
| parent | Help: include root aliases in output (diff) | |
Type check root aliases
Just like normal aliases, they should only be tuples or lists. This is
likely done by discord.py to prevent accidentally passing a string when
only a single alias is desired.
| -rw-r--r-- | bot/command.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/command.py b/bot/command.py index 92e61d97e..0fb900f7b 100644 --- a/bot/command.py +++ b/bot/command.py @@ -13,3 +13,6 @@ class Command(commands.Command): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.root_aliases = kwargs.get("root_aliases", []) + + if not isinstance(self.root_aliases, (list, tuple)): + raise TypeError("Root aliases of a command must be a list or a tuple of strings.") |