From: zonidjan Date: Sat, 7 Oct 2017 20:20:25 +0000 (-0500) Subject: trivia - bugfixes X-Git-Url: https://jfr.im/git/erebus.git/commitdiff_plain/aa0e4be4fe8c3d7a727329848eaa3d28fe523684?hp=5ed70e948f881ad7486c0aba588dd46c60ad5b36 trivia - bugfixes --- diff --git a/modules/trivia.py b/modules/trivia.py index cf75c8c..c2aea43 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