Aliases passed as a list or as a tuple

Nothing too important, felt like some people would appreciate it;
This commit is contained in:
Saphielle Akiyama 2020-05-10 12:17:50 +02:00 committed by Rapptz
parent 128c9f4eb8
commit 1e9937a234

View File

@ -147,7 +147,7 @@ class Command(_BaseCommand):
then the first line of the long help text is used instead.
usage: :class:`str`
A replacement for arguments in the default help text.
aliases: :class:`list`
aliases: Union[:class:`list`, :class:`tuple`]
The list of aliases the command can be invoked under.
enabled: :class:`bool`
A boolean that indicates if the command is currently enabled.
@ -234,7 +234,7 @@ class Command(_BaseCommand):
self.aliases = kwargs.get('aliases', [])
if not isinstance(self.aliases, (list, tuple)):
raise TypeError("Aliases of a command must be a list of strings.")
raise TypeError("Aliases of a command must be a list or a tuple of strings.")
self.description = inspect.cleandoc(kwargs.get('description', ''))
self.hidden = kwargs.get('hidden', False)