|
@ -6,14 +6,15 @@ import os |
|
|
|
|
|
|
|
|
data.DATA_FOLDER = os.environ.get("HROCHOBOT_DATA", 'data') |
|
|
data.DATA_FOLDER = os.environ.get("HROCHOBOT_DATA", 'data') |
|
|
LOG_FOLDER = os.environ.get("HROCHOBOT_LOG", '.') |
|
|
LOG_FOLDER = os.environ.get("HROCHOBOT_LOG", '.') |
|
|
|
|
|
CONFIG_FOLDER = os.environ.get("HROCHOBOT_ETC", '.') |
|
|
|
|
|
|
|
|
logger = logging.getLogger('hrochobot') |
|
|
logger = logging.getLogger('hrochobot') |
|
|
logger.setLevel(logging.INFO) |
|
|
logger.setLevel(logging.INFO) |
|
|
handler = logging.FileHandler(filename=f'{LOG_FOLDER}/hrochobot.log', encoding='utf-8', mode='w') |
|
|
handler = logging.FileHandler(filename=os.path.join(LOG_FOLDER, 'hrochobot.log'), encoding='utf-8', mode='w') |
|
|
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) |
|
|
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s')) |
|
|
logger.addHandler(handler) |
|
|
logger.addHandler(handler) |
|
|
|
|
|
|
|
|
CONFIG = data.load_json("config") |
|
|
CONFIG = data.load_json(os.path.join(CONFIG_FOLDER, "config")) |
|
|
|
|
|
|
|
|
bot = commands.Bot() |
|
|
bot = commands.Bot() |
|
|
|
|
|
|
|
|