]> jfr.im git - erebus.git/blobdiff - modules/trivia.py
bugfixes
[erebus.git] / modules / trivia.py
index cf75c8cf765451b243b55a73d77cfa8194274561..1f949bd7aa22e4c0950b039a873af1c0bc4c035d 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
@@ -838,7 +838,8 @@ def triviahelp(bot, user, chan, realtarget, *args):
 @lib.hooknum(417)
 def num_417(bot, textline):
 #      bot.fastmsg(state.db['chan'], "Whoops, it looks like that question didn't quite go through! (E:417). Let's try another...")
-       state.nextquestion(qskipped=False, skipwait=True)
+       if state.curq is not None:
+               state.nextquestion(qskipped=False, skipwait=True)
 
 @lib.hooknum(332)
 def num_TOPIC(bot, textline):