From 8e2b19caa5d92ddad8a8e87b6aae724d3198a14b Mon Sep 17 00:00:00 2001 From: Igor Tolmachov Date: Sat, 9 Jul 2022 12:59:06 +0900 Subject: Фикс бага MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/config.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'shared/config.py') diff --git a/shared/config.py b/shared/config.py index 4c64220..09ced45 100644 --- a/shared/config.py +++ b/shared/config.py @@ -1,11 +1,15 @@ +import logging from copy import deepcopy from json import dump, load from os import environ as env from os import path from typing import Any +logging.info("Load configs") + if not path.exists("data/settings.json"): - open("data/settings.json", "w").close() + with open("data/settings.json", "w") as f: + f.write("{}") fields: dict[str, Any] = { "chances": {}, } @@ -21,4 +25,4 @@ def save(): # Configs token = env["TOKEN"] -chances = settings["chances"] +chances: dict[str, int] = settings["chances"] -- cgit v1.2.3