aboutsummaryrefslogtreecommitdiff
path: root/shared/config.py
diff options
context:
space:
mode:
authorIgor Tolmachov <me@igorek.dev>2022-07-09 12:59:06 +0900
committerIgor Tolmachov <me@igorek.dev>2022-07-09 12:59:06 +0900
commit8e2b19caa5d92ddad8a8e87b6aae724d3198a14b (patch)
tree0186c54017430fcbdab14cbfc8a22e4ea68a274d /shared/config.py
parentdd5afe2b16cf6f5acb8f3345617a7aa9d8b01c57 (diff)
downloadkarpov_ai_bot-8e2b19caa5d92ddad8a8e87b6aae724d3198a14b.tar.gz
karpov_ai_bot-8e2b19caa5d92ddad8a8e87b6aae724d3198a14b.zip
Фикс бага
Diffstat (limited to 'shared/config.py')
-rw-r--r--shared/config.py8
1 files changed, 6 insertions, 2 deletions
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 @@
1import logging
1from copy import deepcopy 2from copy import deepcopy
2from json import dump, load 3from json import dump, load
3from os import environ as env 4from os import environ as env
4from os import path 5from os import path
5from typing import Any 6from typing import Any
6 7
8logging.info("Load configs")
9
7if not path.exists("data/settings.json"): 10if not path.exists("data/settings.json"):
8 open("data/settings.json", "w").close() 11 with open("data/settings.json", "w") as f:
12 f.write("{}")
9fields: dict[str, Any] = { 13fields: dict[str, Any] = {
10 "chances": {}, 14 "chances": {},
11} 15}
@@ -21,4 +25,4 @@ def save():
21 25
22# Configs 26# Configs
23token = env["TOKEN"] 27token = env["TOKEN"]
24chances = settings["chances"] 28chances: dict[str, int] = settings["chances"]