Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit 8875123

Browse files
committed
Docs
1 parent adb3976 commit 8875123

File tree

2 files changed

+99
-48
lines changed

2 files changed

+99
-48
lines changed

vrcpy/aobjects.py

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import vrcpy.objects as o
22
import vrcpy.types as types
33

4+
'''
5+
Please look at objects.py for object docs
6+
Everything is in the same place and does the same thing.
7+
8+
Thanks ~ Lazy me
9+
'''
10+
411
## Avatar
512

613
class Avatar(o.Avatar):
@@ -9,10 +16,6 @@ async def author(self):
916
return User(self.client, resp["data"])
1017

1118
async def favorite(self):
12-
'''
13-
Returns favorite object
14-
'''
15-
1619
resp = await self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.Avatar,\
1720
"favoriteId": self.id})
1821
return Favorite(resp["data"])
@@ -25,10 +28,6 @@ async def fetch_full(self):
2528
return User(self.client, resp["data"])
2629

2730
async def public_avatars(self):
28-
'''
29-
Returns array of Avatar objects owned by user object
30-
'''
31-
3231
resp = await self.client.api.call("/avatars",
3332
params={"userId": self.id})
3433

@@ -39,25 +38,13 @@ async def public_avatars(self):
3938
return avatars
4039

4140
async def unfriend(self):
42-
'''
43-
Returns void
44-
'''
45-
46-
resp = await self.client.api.call("/auth/user/friends/"+self.id, "DELETE")
41+
await self.client.api.call("/auth/user/friends/"+self.id, "DELETE")
4742

4843
async def friend(self):
49-
'''
50-
Returns Notification object
51-
'''
52-
5344
resp = await self.client.api.call("/user/"+self.id+"/friendRequest", "POST")
5445
return o.Notification(self.client, resp["data"])
5546

5647
async def favorite(self):
57-
'''
58-
Returns favorite object
59-
'''
60-
6148
resp = await self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.Friend,\
6249
"favoriteId": self.id})
6350
return Favorite(resp["data"])
@@ -114,13 +101,6 @@ async def update_info(self, email=None, status=None,\
114101
return self.client.me
115102

116103
async def avatars(self, releaseStatus=types.ReleaseStatus.All):
117-
'''
118-
Returns array of Avatar objects owned by the current user
119-
120-
releaseStatus, string
121-
One of types type.ReleaseStatus
122-
'''
123-
124104
resp = await self.client.api.call("/avatars",
125105
params={"releaseStatus": releaseStatus, "user": "me"})
126106

@@ -186,10 +166,6 @@ async def author(self):
186166
return User(self.client, resp["data"])
187167

188168
async def favorite(self):
189-
'''
190-
Returns favorite object
191-
'''
192-
193169
resp = await self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.World,\
194170
"favoriteId": self.id})
195171
return Favorite(resp["data"])
@@ -200,13 +176,6 @@ async def author(self):
200176
return resp
201177

202178
async def fetch_instance(self, id):
203-
'''
204-
Returns Instance object
205-
206-
id, str
207-
InstanceID of instance
208-
'''
209-
210179
resp = await self.client.api.call("/instances/"+self.id+":"+id)
211180
return Instance(self.client, resp["data"])
212181

vrcpy/objects.py

Lines changed: 91 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ class Avatar(BaseObject):
5656
objType = "Avatar"
5757

5858
def author(self):
59+
'''
60+
Used to get author of the avatar
61+
Returns User object
62+
'''
63+
5964
resp = self.client.api.call("/users/"+self.authorId)
6065
return User(self.client, resp["data"])
6166

6267
def favorite(self):
6368
'''
69+
Used to favorite avatar
6470
Returns favorite object
6571
'''
6672

@@ -88,12 +94,18 @@ class LimitedUser(BaseObject):
8894
objType = "LimitedUser"
8995

9096
def fetch_full(self):
97+
'''
98+
Used to get full version of this user
99+
Returns User object
100+
'''
101+
91102
resp = self.client.api.call("/users/"+self.id)
92103
return User(self.client, resp["data"])
93104

94105
def public_avatars(self):
95106
'''
96-
Returns array of Avatar objects owned by user object
107+
Used to get public avatars made by this user
108+
Returns list of Avatar objects
97109
'''
98110

99111
resp = self.client.api.call("/avatars",
@@ -107,13 +119,15 @@ def public_avatars(self):
107119

108120
def unfriend(self):
109121
'''
110-
Unfriends user
122+
Used to unfriend this user
123+
Returns void
111124
'''
112125

113-
resp = self.client.api.call("/auth/user/friends/"+self.id, "DELETE")
126+
self.client.api.call("/auth/user/friends/"+self.id, "DELETE")
114127

115128
def friend(self):
116129
'''
130+
Used to friend this user
117131
Returns Notification object
118132
'''
119133

@@ -122,6 +136,7 @@ def friend(self):
122136

123137
def favorite(self):
124138
'''
139+
Used to favorite this user
125140
Returns favorite object
126141
'''
127142

@@ -165,10 +180,12 @@ def friend(self):
165180

166181
def avatars(self, releaseStatus=types.ReleaseStatus.All):
167182
'''
168-
Returns array of Avatar objects owned by the current user
183+
Used to get avatars by current user
169184
170185
releaseStatus, string
171186
One of types type.ReleaseStatus
187+
188+
Returns list of Avatar objects
172189
'''
173190

174191
resp = self.client.api.call("/avatars",
@@ -183,6 +200,26 @@ def avatars(self, releaseStatus=types.ReleaseStatus.All):
183200

184201
def update_info(self, email=None, status=None,\
185202
statusDescription=None, bio=None, bioLinks=None):
203+
'''
204+
Used to update current user info
205+
206+
email, string
207+
New email
208+
209+
status, string
210+
New status
211+
212+
statusDescription, string
213+
New website status
214+
215+
bio, string
216+
New bio
217+
218+
bioLinks, list of strings
219+
New links in bio
220+
221+
Returns updated CurrentUser
222+
'''
186223

187224
params = {"email": email, "status": status, "statusDescription": statusDescription,\
188225
"bio": bio, "bioLinks": bioLinks}
@@ -196,6 +233,15 @@ def update_info(self, email=None, status=None,\
196233
return self.client.me
197234

198235
def fetch_favorites(self, t):
236+
'''
237+
Used to get favorites
238+
239+
t, string
240+
FavoriteType
241+
242+
Returns list of Favorite objects
243+
'''
244+
199245
resp = self.client.api.call("/favorites", params={"type": t})
200246

201247
f = []
@@ -205,9 +251,27 @@ def fetch_favorites(self, t):
205251
return f
206252

207253
def remove_favorite(self, id):
208-
resp = self.client.api.call("/favorites/"+id, "DELETE")
254+
'''
255+
Used to remove a favorite via id
256+
257+
id, string
258+
ID of the favorite object
259+
260+
Returns void
261+
'''
262+
263+
self.client.api.call("/favorites/"+id, "DELETE")
209264

210265
def get_favorite(self, id):
266+
'''
267+
Used to get favorite via id
268+
269+
id, string
270+
ID of the favorite object
271+
272+
Returns Favorite object
273+
'''
274+
211275
resp = self.client.api.call("/favorites/"+id)
212276
return Favorite(resp)
213277

@@ -278,12 +342,18 @@ class LimitedWorld(BaseObject):
278342
objType = "LimitedWorld"
279343

280344
def author(self):
345+
'''
346+
Used to get author of the world
347+
Returns User object
348+
'''
349+
281350
resp = self.client.api.call("/users/"+self.authorId)
282351
return User(self.client, resp["data"])
283352

284353
def favorite(self):
285354
'''
286-
Returns favorite object
355+
Used to favorite this world object
356+
Returns Favorite object
287357
'''
288358

289359
resp = self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.World,\
@@ -309,10 +379,12 @@ class World(LimitedWorld):
309379

310380
def fetch_instance(self, id):
311381
'''
312-
Returns Instance object
382+
Used to get instance of this world via id
383+
384+
id, string
385+
ID of instance
313386
314-
id, str
315-
InstanceID of instance
387+
Returns Instance object
316388
'''
317389

318390
resp = self.client.api.call("/instances/"+self.id+":"+id)
@@ -365,10 +437,20 @@ class Instance(BaseObject):
365437
objType = "Instance"
366438

367439
def world(self):
440+
'''
441+
Used to get the world of this instance
442+
Returns World object
443+
'''
444+
368445
resp = self.client.api.call("/worlds/"+self.worldId)
369446
return World(resp["data"])
370447

371448
def short_name(self):
449+
'''
450+
Used to get shorturl of the instance
451+
Returns string
452+
'''
453+
372454
return "https://vrchat.com/i/"+self.shortName
373455

374456
def __init__(self, client, obj):

0 commit comments

Comments
 (0)