1
0
mirror of https://github.com/serega404/VodokanalBot.git synced 2025-12-16 02:34:05 +03:00

Add Docker support

This commit is contained in:
2023-03-25 14:08:16 +03:00
parent 2a968f3528
commit 5388901294
4 changed files with 27 additions and 3 deletions

View File

@@ -20,8 +20,8 @@ if TELEGRAM_CHANNEL == '':
# Load database
db = None
if (os.path.isfile('db.json')):
with open('db.json', 'r', encoding='utf-8') as f:
if (os.path.isfile('data/db.json')):
with open('data/db.json', 'r', encoding='utf-8') as f:
db = json.load(f)
else:
print("Database not loaded")
@@ -71,6 +71,9 @@ else:
# Save database
with open('db.json', 'w', encoding='utf-8') as f:
if not os.path.exists("data"):
os.makedirs("data")
with open('data/db.json', 'w', encoding='utf-8') as f:
json.dump(elements, f, ensure_ascii=False)
print("Database updated")