diff --git a/db.py b/db.py new file mode 100644 index 00000000..683cb1f5 --- /dev/null +++ b/db.py @@ -0,0 +1,17 @@ +import json + +db = json.load("db.json") + +def findname(name: str): + for player in db: + if player == name: + return db[player] + else: + return None + +def findbykey(key, value): + for player in db: + if player[key] == value: + return db[player] + else: + return None