mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
We added the ability for a command to determine if it's nested or not, so we can make this prettier.
This commit is contained in:
parent
a8ce25a3ee
commit
8a7681aa51
@ -403,7 +403,12 @@ class Misc(callbacks.Privmsg):
|
||||
if cbs:
|
||||
names = [cb.name() for cb in cbs]
|
||||
names.sort()
|
||||
plugin = utils.commaAndify(names)
|
||||
if irc.nested:
|
||||
irc.reply(utils.commaAndify(names))
|
||||
else:
|
||||
irc.reply('The %s command is available in %s.' %
|
||||
(command, plugin))
|
||||
else:
|
||||
irc.error('There is no such command %s.' % command)
|
||||
|
||||
|
@ -152,7 +152,8 @@ class MiscTestCase(ChannelPluginTestCase):
|
||||
self.assertNotError('source')
|
||||
|
||||
def testPlugin(self):
|
||||
self.assertResponse('plugin plugin', 'Misc')
|
||||
self.assertRegexp('plugin plugin', 'available.*Misc')
|
||||
self.assertResponse('echo [plugin plugin]', 'Misc')
|
||||
|
||||
def testTell(self):
|
||||
m = self.getMsg('tell foo [plugin tell]')
|
||||
|
Loading…
Reference in New Issue
Block a user