From b1a3a92e49b353dfa42b52b448cdbc3b27bb33f8 Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 27 Jul 2014 19:42:33 +0200 Subject: apply file read/save helpers --- abot.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'abot.py') diff --git a/abot.py b/abot.py index 27508a3..b728c59 100644 --- a/abot.py +++ b/abot.py @@ -1,17 +1,12 @@ -import json from helpers import * from re import compile as reg_compile -answers_filename = "plugins/redstoner-utils.py.dir/files/abot.json" -answers = [] +answers = [] def load_answers(): global answers - try: - answers = json.loads(open(answers_filename).read()) - except Exception, e: - error("Failed to load answers: %s" % e) + answers = open_json_file("abot", []) # compile answers for answer in answers: -- cgit v1.2.3