Spaces:
Running
Running
Upload main.py
Browse files
main.py
CHANGED
@@ -245,28 +245,33 @@ def get_profile_(
|
|
245 |
user_id: int = Query(..., description="User ID in query parameter"),
|
246 |
api_key: None = Depends(validate_api_key)
|
247 |
):
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
"
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
|
|
|
|
266 |
}
|
267 |
-
|
268 |
-
|
269 |
-
|
|
|
|
|
|
|
270 |
|
271 |
@app.get("/ryuzaki/getbanlist")
|
272 |
def sibyl_get_all_banlist():
|
|
|
245 |
user_id: int = Query(..., description="User ID in query parameter"),
|
246 |
api_key: None = Depends(validate_api_key)
|
247 |
):
|
248 |
+
try:
|
249 |
+
first_name, last_name, profile_id, bio = get_profile_clone(user_id)
|
250 |
+
if last_name is None:
|
251 |
+
last_name_str = ""
|
252 |
+
else:
|
253 |
+
last_name_str = last_name
|
254 |
+
if bio is None:
|
255 |
+
bio_str = ""
|
256 |
+
else:
|
257 |
+
bio_str = bio
|
258 |
+
if all([first_name, last_name_str, profile_id, bio_str]):
|
259 |
+
return {
|
260 |
+
"status": "true",
|
261 |
+
"randydev": {
|
262 |
+
"user_id": user_id,
|
263 |
+
"first_name": first_name,
|
264 |
+
"last_name": last_name_str,
|
265 |
+
"profile_id": profile_id,
|
266 |
+
"bio": bio_str
|
267 |
+
}
|
268 |
}
|
269 |
+
print(first_name)
|
270 |
+
else:
|
271 |
+
return {"status": "false", "message": "Not Found User"}
|
272 |
+
except Exception as e:
|
273 |
+
print(str(e))
|
274 |
+
return {"status": "false", "message": f"Internal server error: {str(e)}"}
|
275 |
|
276 |
@app.get("/ryuzaki/getbanlist")
|
277 |
def sibyl_get_all_banlist():
|