mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-17 03:09:05 +00:00
[commands] Raise TypeError if the name is not a string.
This commit is contained in:
parent
e2c9cb7f8e
commit
0466f5965b
@ -113,6 +113,9 @@ class Command:
|
|||||||
"""
|
"""
|
||||||
def __init__(self, name, callback, **kwargs):
|
def __init__(self, name, callback, **kwargs):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
if not isinstance(name, str):
|
||||||
|
raise TypeError('Name of a command must be a string.')
|
||||||
|
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
self.enabled = kwargs.get('enabled', True)
|
self.enabled = kwargs.get('enabled', True)
|
||||||
self.help = kwargs.get('help')
|
self.help = kwargs.get('help')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user