mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Added the plugin name to the command if the command is abiguous.
This commit is contained in:
parent
7ba9a855bb
commit
fbd08fe704
@ -166,13 +166,20 @@ class Misc(callbacks.Privmsg):
|
||||
returning a list of the commands containing that string.
|
||||
"""
|
||||
s = privmsgs.getArgs(args)
|
||||
commands = {}
|
||||
L = []
|
||||
for cb in irc.callbacks:
|
||||
if isinstance(cb, callbacks.Privmsg) and \
|
||||
not isinstance(cb, callbacks.PrivmsgRegexp):
|
||||
for attr in dir(cb):
|
||||
if s in attr and cb.isCommand(attr):
|
||||
L.append(callbacks.canonicalName(attr))
|
||||
commands.setdefault(attr, []).append(cb.name())
|
||||
for (key, names) in commands.iteritems():
|
||||
if len(names) == 1:
|
||||
L.append(key)
|
||||
else:
|
||||
for name in names:
|
||||
L.append('%s %s' % (name, key))
|
||||
L.sort()
|
||||
irc.reply(msg, utils.commaAndify(L))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user