randydev commited on
Commit
d82dee8
·
verified ·
1 Parent(s): 15bf604

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -2
main.py CHANGED
@@ -28,7 +28,14 @@ async def hello():
28
 
29
  @fast_app.get("/user/get_user")
30
  async def get_user(user_id=None):
31
- get_users = await client.get_users(user_id)
 
 
 
 
 
 
 
32
  return {
33
  "id": get_users.id,
34
  "is_self": get_users.is_self,
@@ -58,7 +65,8 @@ async def get_user(user_id=None):
58
  "big_file_id": get_users.photo.big_file_id,
59
  "has_animation": get_users.photo.has_animation,
60
  "is_personal": get_users.photo.is_personal
61
- }
 
62
  }
63
 
64
  run_fast(build=fast_app, port=7860)
 
28
 
29
  @fast_app.get("/user/get_user")
30
  async def get_user(user_id=None):
31
+ try:
32
+ get_users = await client.get_users(user_id)
33
+ response = js.get_creation_date(
34
+ api_key="akeno_OSrXhljIomunACd5JY18jFIeIuuB6Pdx",
35
+ user_id=get_users.id
36
+ )
37
+ except Exception:
38
+ return {"error": "Error try again invalid"}
39
  return {
40
  "id": get_users.id,
41
  "is_self": get_users.is_self,
 
65
  "big_file_id": get_users.photo.big_file_id,
66
  "has_animation": get_users.photo.has_animation,
67
  "is_personal": get_users.photo.is_personal
68
+ },
69
+ "creation_date": response
70
  }
71
 
72
  run_fast(build=fast_app, port=7860)