aboutsummaryrefslogtreecommitdiff
path: root/src/Config.py
blob: bf597b78fd1823d259c676dfd7ae042c4aa18eb7 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import configparser, os

class Config(object):
    def __init__(self, location):
        self.location = location

    def load_config(self):
        if os.path.isfile(self.location):
            with open(self.location) as config_file:
                parser = configparser.ConfigParser()
                parser.read_string(config_file.read())
                return dict(parser["bot"].items())