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

Commit bbc5ba8

Browse files
committed
Filled missing client arguments and fixed (async) Instance.join().
1 parent 8bedcaf commit bbc5ba8

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
@@ -180,7 +180,7 @@ def favorite(self):
180180

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

185185
def __init__(self, client, obj=None):
186186
super().__init__(client)
@@ -328,7 +328,7 @@ def get_favorite(self, id):
328328
'''
329329

330330
resp = self.client.api.call("/favorites/"+id)
331-
return Favorite(resp)
331+
return Favorite(self.client, resp)
332332

333333
def favorite(self):
334334
raise AttributeError("'CurrentUser' object has no attribute 'favorite'")
@@ -420,7 +420,7 @@ def favorite(self):
420420

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

425425
def __init__(self, client, obj=None):
426426
super().__init__(client)
@@ -518,7 +518,7 @@ def world(self):
518518
'''
519519

520520
resp = self.client.api.call("/worlds/"+self.worldId)
521-
return World(resp["data"])
521+
return World(self.client, resp["data"])
522522

523523
def short_name(self):
524524
'''

0 commit comments

Comments
 (0)