mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-20 07:30:54 +01:00
Allow commands to be the same name as callbacks.
This commit is contained in:
parent
4352cfde5f
commit
53b29f1bf8
@ -251,6 +251,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
ambiguous commands, mapping the command to the plugins it's
|
ambiguous commands, mapping the command to the plugins it's
|
||||||
available in."""
|
available in."""
|
||||||
if ambiguousCommands is None:
|
if ambiguousCommands is None:
|
||||||
|
print '***', tokens
|
||||||
ambiguousCommands = {}
|
ambiguousCommands = {}
|
||||||
if tokens:
|
if tokens:
|
||||||
command = callbacks.canonicalName(tokens[0])
|
command = callbacks.canonicalName(tokens[0])
|
||||||
@ -267,7 +268,7 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
srcs = [name for name in names if name in self._srcPlugins]
|
srcs = [name for name in names if name in self._srcPlugins]
|
||||||
if len(srcs) == 1:
|
if len(srcs) == 1:
|
||||||
tokens.insert(0, srcs[0])
|
tokens.insert(0, srcs[0])
|
||||||
else:
|
elif command not in map(callbacks.canonicalName, names):
|
||||||
ambiguousCommands[command] = names
|
ambiguousCommands[command] = names
|
||||||
for elt in tokens:
|
for elt in tokens:
|
||||||
if isinstance(elt, list):
|
if isinstance(elt, list):
|
||||||
|
@ -539,6 +539,7 @@ class IrcObjectProxy(RichReplyMethods):
|
|||||||
if len(cbs) > 1:
|
if len(cbs) > 1:
|
||||||
for cb in cbs:
|
for cb in cbs:
|
||||||
if canonicalName(cb.name()) == name:
|
if canonicalName(cb.name()) == name:
|
||||||
|
del self.args[0]
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# This should've been caught earlier, that's why we
|
# This should've been caught earlier, that's why we
|
||||||
|
Loading…
x
Reference in New Issue
Block a user