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:
Jeremy Fincher 2004-09-16 14:51:40 +00:00
parent a8ce25a3ee
commit 8a7681aa51
2 changed files with 8 additions and 2 deletions

View File

@ -403,7 +403,12 @@ class Misc(callbacks.Privmsg):
if cbs:
names = [cb.name() for cb in cbs]
names.sort()
irc.reply(utils.commaAndify(names))
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)

View File

@ -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]')