aboutsummaryrefslogtreecommitdiff
path: root/Config.py
diff options
context:
space:
mode:
Diffstat (limited to 'Config.py')
-rw-r--r--Config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Config.py b/Config.py
new file mode 100644
index 00000000..06a00378
--- /dev/null
+++ b/Config.py
@@ -0,0 +1,15 @@
+import json, os
+
+class Config(object):
+ def __init__(self, bot, location="bot.json"):
+ self.bot = bot
+ self.location = location
+ self.full_location = os.path.join(bot.bot_directory,
+ self.location)
+ self.bot.config = {}
+ self.load_config()
+
+ def load_config(self):
+ if os.path.isfile(self.full_location):
+ with open(self.full_location) as config_file:
+ self.bot.config = json.loads(config_file.read())