diff --git a/plugins/MoobotFactoids.py b/plugins/MoobotFactoids.py index ccdc57a05..2740f2f96 100644 --- a/plugins/MoobotFactoids.py +++ b/plugins/MoobotFactoids.py @@ -212,7 +212,7 @@ class MoobotFactoids(callbacks.PrivmsgCommandAndRegexp): return True def addFactoid(self, irc, msg, match): - r"^(.+)\s+(?:is|_is_)\s+(.+)" + r"^(.+?)\s+(?:is|_is_)\s+(.+)" # First, check and see if the entire message matches a factoid key cursor = self.db.cursor() cursor.execute("""SELECT * FROM factoids WHERE key LIKE %s""", diff --git a/test/test_MoobotFactoids.py b/test/test_MoobotFactoids.py index a203c122c..5e5496778 100644 --- a/test/test_MoobotFactoids.py +++ b/test/test_MoobotFactoids.py @@ -51,6 +51,8 @@ if sqlite is not None: self.assertError('moo!? is foo') # 'moo' already exists self.assertNotError('foo!? is foo') self.assertResponse('foo', 'foo is foo') + self.assertNotError('bar is moo is moo') + self.assertResponse('bar', 'moo is moo') def testLiteral(self): self.assertError('literal moo') # no factoids yet