diff --git a/plugins/Dunno.py b/plugins/Dunno.py index 33d9a5e75..34e3c3fcb 100644 --- a/plugins/Dunno.py +++ b/plugins/Dunno.py @@ -78,7 +78,8 @@ class Dunno(plugins.ChannelIdDatabasePlugin): if dunno is not None: dunno = dunno.text prefixName = self.registryValue('prefixNick', channel) - dunno = ircutils.standardSubstitute(irc, msg, dunno) + env = {'command': tokens[0]} + dunno = ircutils.standardSubstitute(irc, msg, dunno, env=env) irc.reply(dunno, prefixName=prefixName) diff --git a/plugins/__init__.py b/plugins/__init__.py index db7e61d16..99eb3987b 100644 --- a/plugins/__init__.py +++ b/plugins/__init__.py @@ -460,7 +460,7 @@ class ChannelIdDatabasePlugin(callbacks.Privmsg): L.append(self.searchSerializeRecord(record)) if L: L.sort() - irc.reply(utils.commaAndify(L)) + irc.reply('%s found: %s' % (len(L), utils.commaAndify(L))) else: irc.reply('No matching %s were found.' % utils.pluralize(self.name().lower())) diff --git a/test/test_Dunno.py b/test/test_Dunno.py index ad71f8349..dcc2f5550 100644 --- a/test/test_Dunno.py +++ b/test/test_Dunno.py @@ -46,14 +46,14 @@ class DunnoTestCase(ChannelPluginTestCase, PluginDocumentation): def testDunnoSearch(self): self.assertNotError('dunno add foo') - self.assertRegexp('dunno search moo', 'No dunnos found') + self.assertRegexp('dunno search moo', 'No.*dunnos.*found') self.assertNotError('dunno add moo') - self.assertRegexp('dunno search moo', r'\(1 found\)') - self.assertRegexp('dunno search m', r'\(1 found\)') + self.assertRegexp('dunno search moo', r'1 found') + self.assertRegexp('dunno search m', r'1 found') # Test multiple adds for i in range(5): self.assertNotError('dunno add moo%s' % i) - self.assertRegexp('dunno search moo', r'\(6 found\)') + self.assertRegexp('dunno search moo', r'6 found') def testDunnoGet(self): self.assertNotError('dunno add moo') @@ -67,3 +67,7 @@ class DunnoTestCase(ChannelPluginTestCase, PluginDocumentation): self.assertNotError('dunno add moo') self.assertNotError('dunno change 1 s/moo/bar/') self.assertRegexp('dunno get 1', '.*?: \'bar\'') + + def testDollarCommand(self): + self.assertNotError("dunno add I can't $command.") + self.assertResponse('asdf', "I can't asdf.")