utils.py 409 Bytes
Newer Older
Leo Peron's avatar
Leo Peron committed
1
2
import json
from typing import Dict
Leo Peron's avatar
Leo Peron committed
3
from datetime import datetime as dt
Leo Peron's avatar
Leo Peron committed
4
5
6
7
8
9
10
11

class Utils:
    def __init__(self):
        pass

    def loadDatas(self) -> Dict[str, str]:
        with open("db_config.json", "r") as json_file:
            return json.loads(json_file.read())
Leo Peron's avatar
Leo Peron committed
12
13
14
15
16
17

    def hasAccount(self, id, datas):
        for raw in datas:
            if id in raw:
                return True
        return False