3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

ServiceBot: break when trying to alias a command to itself

This commit is contained in:
James Lu 2017-07-10 22:18:01 -07:00
parent 63ce7ea407
commit 5ed4f8bf85

View File

@ -353,6 +353,10 @@ class ServiceBot():
# If this is an alias, store the primary command in the alias_cmds dict
if aliases is not None:
for alias in aliases:
if name == alias:
log.error('Refusing to alias command %r (in plugin %r) to itself!', name, func.__module__)
continue
self.add_cmd(func, name=alias) # Bind the alias as well.
self.alias_cmds[alias] = name