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 c32b6dd3c0c42b79f86bb00c96d6f8b7d9017fd2..fe9c6d8d283a3a7d33fec14903c9534819ea2642 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:")