]> jfr.im git - erebus.git/commitdiff
update trivia to use bot.config to find trivia.json; update bot.config.example
authorzonidjan <redacted>
Mon, 7 Sep 2015 00:24:19 +0000 (19:24 -0500)
committerzonidjan <redacted>
Mon, 7 Sep 2015 00:24:19 +0000 (19:24 -0500)
bot.config.example
modules/trivia.py

index b1773905c869980eaea51190c14450523fd1a7ad..a22902e53af21781f155b311ba2cdb214ea6b702 100644 (file)
@@ -13,3 +13,11 @@ trigger = !
 [autoloads]
 module = 1
 eval = 1
+
+[trivia]
+jsonpath = /bla/foo/bar/modules/contrib/trivia/trivia.json.example
+con = twitter consumer
+con_sec = twitter consumer secret
+token = twitter token
+token_sec = twitter token secret
+
index 7e9283c4cef13b621be5a85a6188adb9a0164fa0..81dd7d2ffef7ce2ad42e6ab0da063979f2159e76 100644 (file)
@@ -39,7 +39,7 @@ def findnth(haystack, needle, n): #http://stackoverflow.com/a/1884151
 class TriviaState(object):
        def __init__(self, questionfile, parent=None, pointvote=False):
                self.parent = parent
-               self.questionfile = questionfile
+               self.questionfile = self.getbot().parent.cfg.get('trivia', 'jsonpath')
                self.db = json.load(open(questionfile, "r"))
                self.chan = self.db['chan']
                self.curq = None