mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Plugin: make @plugins take non-first words into account. Closes GH-68.
This commit is contained in:
parent
8e427838cd
commit
f7943a6697
@ -92,8 +92,9 @@ class Plugin(callbacks.Plugin):
|
||||
for cb in irc.callbacks:
|
||||
if not hasattr(cb, 'getCommand'):
|
||||
continue
|
||||
commandlist = cb.getCommand(command)
|
||||
if commandlist:
|
||||
longest_matching_command = cb.getCommand(command)
|
||||
if len(longest_matching_command) >= len(command):
|
||||
# Actually, this is equivalent to use ==
|
||||
plugin_list.append(cb.name())
|
||||
return plugin_list
|
||||
|
||||
|
@ -38,6 +38,8 @@ class PluginTestCase(PluginTestCase):
|
||||
def testPlugins(self):
|
||||
self.assertRegexp('plugins join', '(Format.*Admin|Admin.*Format)')
|
||||
self.assertRegexp('plugins plugin', 'Plugin')
|
||||
self.assertNotRegexp('plugins ignore add', 'Utilities')
|
||||
self.assertNotRegexp('plugins ignore', 'Admin')
|
||||
|
||||
def testHelp(self):
|
||||
self.assertRegexp('plugin help plugin', 'manage their plugins')
|
||||
|
Loading…
Reference in New Issue
Block a user