mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 11:34:18 +00:00
21 lines
404 B
Python
21 lines
404 B
Python
import json
|
|
import filemanager
|
|
|
|
db = json.loads(filemanager.readfile("db.json"))
|
|
|
|
|
|
def findbyname(name: str):
|
|
for player in db:
|
|
if db[player]["telegram"]["username"] == 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
|
|
|