]> jfr.im git - erebus.git/commitdiff
trivia - bugfixes
authorzonidjan <redacted>
Sat, 7 Oct 2017 20:20:25 +0000 (15:20 -0500)
committerzonidjan <redacted>
Sat, 7 Oct 2017 20:20:25 +0000 (15:20 -0500)
modules/trivia.py

index cf75c8cf765451b243b55a73d77cfa8194274561..c2aea431d30c7df1505420d9870a11182021e63d 100644 (file)
@@ -298,7 +298,7 @@ class TriviaState(object):
                        nextqid = None
                        nextq = specialQuestion(nextq)
 
-               if len(nextq) > 2 and nextq[2] - time.time() < 7*24*60*60 and iteration < 10:
+               if len(nextq) > 2 and time.time() - nextq[2] < 7*24*60*60 and iteration < 10:
                        return self._nextquestion(iteration=iteration+1) #short-circuit to pick another question
                if len(nextq) > 2:
                        nextq[2] = time.time()
@@ -466,7 +466,7 @@ def setnextid(bot, user, chan, realtarget, *args):
 @lib.argsGE(1)
 def setnext(bot, user, chan, realtarget, *args):
        line = ' '.join([str(arg) for arg in args])
-       linepieces = line.split('*')
+       linepieces = line.split('*', 1)
        if len(linepieces) < 2:
                bot.msg(user, "Error: need <question>*<answer>")
                return
@@ -752,7 +752,7 @@ def addq(bot, user, chan, realtarget, *args):
                questions = state.questions
 
        line = ' '.join([str(arg) for arg in args])
-       linepieces = line.split('*')
+       linepieces = line.split('*', 1)
        if len(linepieces) < 2:
                bot.msg(user, "Error: need <question>*<answer>")
                return