File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed
Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change 99from .http import Http
1010import json
1111
12+ # User Object
13+ class User :
14+ Id = None
15+ Username = None
16+ AvatarUri = None
17+ AvatarFinal = None
18+ IsOnline = None
19+
20+ def __init__ (self ,data ):
21+ self .Id = data ["Id" ]
22+ self .Username = data ["Username" ]
23+ self .AvatarUri = data ["AvatarUri" ]
24+ self .AvatarFinal = data ["AvatarFinal" ]
25+ self .IsOnline = data ["IsOnline" ]
1226
1327class Users :
1428
@@ -29,14 +43,7 @@ def User(username):
2943 a = Http .sendRequest ("https://api.roblox.com/users/get-by-username?username=" + str (username ))
3044 b = a .decode ("utf-8" )
3145 c = json .loads (b )
32- global User
33- User = lambda : None
34- User .Id = c ["Id" ]
35- User .Username = c ["Username" ]
36- User .AvatarUrl = c ["AvatarUri" ]
37- User .AvatarFinal = c ["AvatarFinal" ]
38- User .IsOnline = c ["IsOnline" ]
39- return User
46+ return User (c )
4047
4148 # GET https://www.roblox.com/Asset/BodyColors.ashx?userId={userId}
4249 # Returns Table/Array
You can’t perform that action at this time.
0 commit comments