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

Commit d5101bf

Browse files
authored
Merge pull request #19 from ShingenPizza/missing_client
Filled missing client arguments and fixed (async) Instance.join().
2 parents 889d3c1 + bbc5ba8 commit d5101bf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

vrcpy/aobjects.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def friend(self):
6161
async def favorite(self):
6262
resp = await self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.Friend,
6363
"favoriteId": self.id})
64-
return Favorite(resp["data"])
64+
return Favorite(self.client, resp["data"])
6565

6666

6767
class User(o.User, LimitedUser):
@@ -149,7 +149,7 @@ async def remove_favorite(self, id):
149149

150150
async def fetch_favorite(self, id):
151151
resp = await self.client.api.call("/favorites/"+id)
152-
return Favorite(resp)
152+
return Favorite(self.client, resp)
153153

154154
async def __cinit__(self):
155155
if hasattr(self, "currentAvatar"):
@@ -200,7 +200,7 @@ async def author(self):
200200
async def favorite(self):
201201
resp = await self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.World,
202202
"favoriteId": self.id})
203-
return Favorite(resp["data"])
203+
return Favorite(self.client, resp["data"])
204204

205205

206206
class World(o.World, LimitedWorld):
@@ -231,10 +231,10 @@ class Location(o.Location):
231231
class Instance(o.Instance):
232232
async def world(self):
233233
resp = await self.client.api.call("/worlds/"+self.worldId)
234-
return World(resp["data"])
234+
return World(self.client, resp["data"])
235235

236236
async def join(self):
237-
await self.client.api.call("/joins", "PUT", json={"worldId": self.location})
237+
await self.client.api.call("/joins", "PUT", json={"worldId": self.location.location})
238238

239239
# unityPackage objects
240240

vrcpy/objects.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def favorite(self):
183183

184184
resp = self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.Friend,
185185
"favoriteId": self.id})
186-
return Favorite(resp["data"])
186+
return Favorite(self.client, resp["data"])
187187

188188
def __init__(self, client, obj=None):
189189
super().__init__(client)
@@ -331,7 +331,7 @@ def get_favorite(self, id):
331331
'''
332332

333333
resp = self.client.api.call("/favorites/"+id)
334-
return Favorite(resp)
334+
return Favorite(self.client, resp)
335335

336336
def favorite(self):
337337
raise AttributeError("'CurrentUser' object has no attribute 'favorite'")
@@ -423,7 +423,7 @@ def favorite(self):
423423

424424
resp = self.client.api.call("/favorites", "POST", params={"type": types.FavoriteType.World,
425425
"favoriteId": self.id})
426-
return Favorite(resp["data"])
426+
return Favorite(self.client, resp["data"])
427427

428428
def __init__(self, client, obj=None):
429429
super().__init__(client)
@@ -522,7 +522,7 @@ def world(self):
522522
'''
523523

524524
resp = self.client.api.call("/worlds/"+self.worldId)
525-
return World(resp["data"])
525+
return World(self.client, resp["data"])
526526

527527
def short_name(self):
528528
'''

0 commit comments

Comments
 (0)