X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/5ed70e948f881ad7486c0aba588dd46c60ad5b36..4b5f28dde311d1f8cc5cce200329207e95f4d8f0:/modules/trivia.py diff --git a/modules/trivia.py b/modules/trivia.py index cf75c8c..1f949bd 100644 --- a/modules/trivia.py +++ b/modules/trivia.py @@ -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 *") 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 *") 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):