aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-12-29 01:42:45 -0500
committerRapptz <[email protected]>2017-12-29 01:42:45 -0500
commite61ac8e60fdd4c155d9a3273a8a2fc8a9bb416d6 (patch)
tree9d5ead00fdcbbee377eeaf9220af305d40819762
parentPip version requires require all 3 digits. (diff)
downloaddiscord.py-e61ac8e60fdd4c155d9a3273a8a2fc8a9bb416d6.tar.xz
discord.py-e61ac8e60fdd4c155d9a3273a8a2fc8a9bb416d6.zip
[commands] Forbid passing a string to aliases in Command.
Fixes #974
-rw-r--r--discord/ext/commands/core.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index c594ec97..0463c843 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -149,6 +149,10 @@ class Command:
self.usage = kwargs.get('usage')
self.rest_is_raw = kwargs.get('rest_is_raw', False)
self.aliases = kwargs.get('aliases', [])
+
+ if not isinstance(self.aliases, (list, tuple)):
+ raise TypeError("Aliases of a command must be a list of strings.")
+
self.description = inspect.cleandoc(kwargs.get('description', ''))
self.hidden = kwargs.get('hidden', False)
signature = inspect.signature(callback)