Compare commits

..
2 Commits
Author SHA1 Message Date
Aeru eef8fe95bd adding /whitelist
hardcoded gg gg
2026-10-18 00:01:25 +02:00
Aeru f5a45bf87c Update main.py
fr->en
2026-10-17 22:56:58 +02:00
+8 -3
View File
@@ -17,7 +17,10 @@ lanyard_link = "https://api.lanyard.rest/v1/users/1558056824387805300"
CACHE_TTL = 1.0 CACHE_TTL = 1.0
_cache = {"data": None, "time": 0.0} _cache = {"data": None, "time": 0.0}
_lock = threading.Lock() _lock = threading.Lock()
WHITELIST = [
1558056824387805300,
1179777658675007520,
] #harcode final boss
def get_lanyard(): def get_lanyard():
@@ -33,7 +36,7 @@ def get_lanyard():
_cache["time"] = time.monotonic() _cache["time"] = time.monotonic()
except requests.RequestException: except requests.RequestException:
if _cache["data"] is None: if _cache["data"] is None:
raise fastapi.HTTPException(status_code=502, detail="Lanyard indisponible") raise fastapi.HTTPException(status_code=502, detail="Lanyard not available") #I wrote this in French, lol
return _cache["data"] return _cache["data"]
@@ -43,7 +46,9 @@ def read_root():
@app.get("/discord") @app.get("/discord")
def read_lanyard(): def read_lanyard():
return get_lanyard() return get_lanyard()
@app.get("/whitelist")
def read_whitelist():
return WHITELIST
if __name__ == "__main__": if __name__ == "__main__":
import uvicorn import uvicorn