diff options
| author | Rapptz <[email protected]> | 2016-01-29 20:11:22 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-01-29 20:11:22 -0500 |
| commit | 0466f5965b8adb2f6728ee2ca1440fbc45610ded (patch) | |
| tree | f6d8a6212338a5701559629a434784ee68282e63 | |
| parent | Force content-type for file uploads. (diff) | |
| download | discord.py-0466f5965b8adb2f6728ee2ca1440fbc45610ded.tar.xz discord.py-0466f5965b8adb2f6728ee2ca1440fbc45610ded.zip | |
[commands] Raise TypeError if the name is not a string.
| -rw-r--r-- | discord/ext/commands/core.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 97aa2b9c..94f500d5 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -113,6 +113,9 @@ class Command: """ def __init__(self, name, callback, **kwargs): self.name = name + if not isinstance(name, str): + raise TypeError('Name of a command must be a string.') + self.callback = callback self.enabled = kwargs.get('enabled', True) self.help = kwargs.get('help') |