home · contact · privacy
Fix crash when just commanding "!quote".
authorChristian Heller <c.heller@plomlompom.de>
Sun, 24 Jan 2016 09:37:46 +0000 (10:37 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 24 Jan 2016 09:37:46 +0000 (10:37 +0100)
plomlombot.py

index c32b6dd..fe9c6d8 100755 (executable)
@@ -169,8 +169,8 @@ def lineparser_loop(io, nickname):
                 notice("ADDED QUOTE #" + str(len(lines) - 1))
             elif tokens[0] == "quote":
                 if (len(tokens) > 2 and tokens[1] != "search") or \
-                    (len(tokens) < 3 and tokens[1] == "search") or \
-                    (len(tokens) == 2 and not tokens[1].isdigit()):
+                    (len(tokens) == 2 and
+                        (tokens[1] == "search" or not tokens[1].isdigit())):
                     notice("SYNTAX: !quote [int] OR !quote search QUERY")
                     notice("QUERY may be a boolean grouping of quoted or "\
                         + "unquoted search terms, examples:")