diff --git a/plugins/MoobotFactoids.py b/plugins/MoobotFactoids.py index da4ab9a70..e88da13ea 100644 --- a/plugins/MoobotFactoids.py +++ b/plugins/MoobotFactoids.py @@ -201,6 +201,8 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): def _checkFactoids(self, irc, msg, _): # Strip the bot name key = callbacks.addressed(irc.nick, msg) + if key.startswith('\x01'): + return # Check the factoid db for an appropriate reply cursor = self.db.cursor() cursor.execute("""SELECT fact FROM factoids WHERE key = %s""", key) diff --git a/test/test_MoobotFactoids.py b/test/test_MoobotFactoids.py index 151d1efc9..919ebf06d 100644 --- a/test/test_MoobotFactoids.py +++ b/test/test_MoobotFactoids.py @@ -189,6 +189,14 @@ if sqlite is not None: self.assertResponse('echo foo is bar', 'foo is bar') self.assertNoResponse(' ', 3) + def testNoResponseToCtcp(self): + self.assertNotError('foo is bar') + self.assertResponse('foo', 'foo is bar') + self.irc.feedMsg(ircmsgs.privmsg(self.irc.nick, '\x01VERSION\x01')) + m = self.irc.takeMsg() + self.failIf(m) + + class DunnoTestCase(PluginTestCase, PluginDocumentation): plugins = ('Misc', 'MoobotFactoids', 'User') def setUp(self):