From fa28bf6de4dd5c5412b68d4ad448e0b4cb15cfac Mon Sep 17 00:00:00 2001 From: MarkKoz Date: Mon, 24 Aug 2020 10:10:38 -0700 Subject: 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. --- bot/command.py | 3 +++ 1 file changed, 3 insertions(+) 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.") -- cgit v1.2.3