]> jfr.im git - irc/rizon/acid.git/commitdiff
Allow searching for strings in quotes
authorDwarf <redacted>
Sat, 13 Jun 2015 16:03:57 +0000 (18:03 +0200)
committerDwarf <redacted>
Sat, 13 Jun 2015 16:03:57 +0000 (18:03 +0200)
pyva/pyva/src/main/python/quotes/quotes.py

index 0a9453145fd1454a166693f6eccf3689783ebc23..0859ebc24991df02d4c515e3d8a0e94e2e86d0dc 100644 (file)
@@ -252,7 +252,7 @@ class quotes(
                        elif command == 'help' and arg.startswith('quotes'):
                                self.notice(sender, "Quotes: .quote add <quote> - adds given quote to database, must have voice or higher on channel.")
                                self.notice(sender, "Quotes: .quote del <number> - removes quote number from database, must be channel founder.")
-                               self.notice(sender, "Quotes: .quote search <word> - searches database for given word.")
+                               self.notice(sender, "Quotes: .quote search <query> - searches database for given query.")
                                self.notice(sender, "Quotes: .quote read <number> - messages quote matching given number.")
                                self.notice(sender, "Quotes: .quote random - messages a random quote.")
                                self.notice(sender, "Quotes: .quote total - messages number of quotes in database.")
@@ -299,7 +299,7 @@ class quotes(
                                                return
 
                                        num = self.dbp.execute("SELECT id FROM quotes_quotes WHERE channel = %s AND quote LIKE CONCAT('%%',%s,'%%')",
-                                                       (cid, args[1]))
+                                                       (cid, ' '.join(args[1:]) ))
                                        res = self.dbp.fetchall()
                                        if num == 0:
                                                self.msg(channel, "[Quote] No quotes found.")