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

Commit 525e388

Browse files
authored
Merge pull request #12 from Katistic/master
Avatar object importer key error
2 parents 19720ce + befe702 commit 525e388

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

vrcpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__title__ = "vrcpy"
22
__author__ = "Katistic"
3-
__version__ = "0.6.2"
3+
__version__ = "0.6.5"
44

55
from vrcpy.client import Client
66
from vrcpy.client import AClient

vrcpy/aobjects.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ async def world(self):
201201
resp = await self.client.api.call("/worlds/"+self.worldId)
202202
return World(resp["data"])
203203

204+
async def join(self):
205+
await self.client.api.call("/joins", "PUT", json={"worldId": self.location})
206+
204207
# Misc
205208

206209
class Favorite(o.Favorite):

vrcpy/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,11 @@ def login(self, username, password):
274274
self.me = objects.CurrentUser(self, resp["data"])
275275
self.loggedIn = True
276276

277-
def __init__(self, verify=True):
277+
def __init__(self, verify=True, caching=True):
278278
self.api = Call(verify)
279279
self.loggedIn = False
280280
self.me = None
281+
self.caching = caching
281282

282283
class AClient(Client):
283284
'''
@@ -540,9 +541,10 @@ async def login(self, username, password):
540541

541542
await self.me.cacheTask
542543

543-
def __init__(self, verify=True):
544+
def __init__(self, verify=True, caching=True):
544545
super().__init__()
545546

546547
self.api = ACall(verify=verify)
547548
self.loggedIn = False
548549
self.me = None
550+
self.caching = caching

vrcpy/objects.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def __init__(self, client):
1515
self.arrTypes = {} # Dictionary of what keys are arrays with special types
1616
self.client = client
1717

18+
self._dict = {} # Dictionary that is assigned
19+
1820
self.cacheTask = None # cacheTask for async objects using __cinit__
1921

2022
def _assign(self, obj):
@@ -31,12 +33,14 @@ def _assign(self, obj):
3133
else:
3234
setattr(self, key, obj[key])
3335

34-
if hasattr(self, "__cinit__"):
36+
if hasattr(self, "__cinit__") and self.client.caching:
3537
if asyncio.iscoroutinefunction(self.__cinit__):
3638
self.cacheTask = asyncio.get_event_loop().create_task(self.__cinit__())
3739
else:
3840
self.__cinit__()
3941

42+
self._dict = obj
43+
4044
def _objectIntegrety(self, obj):
4145
if self.only == []:
4246
for key in self.unique:
@@ -78,8 +82,9 @@ def __init__(self, client, obj):
7882
super().__init__(client)
7983
self.unique += [
8084
"authorId",
81-
"imported",
82-
"version"
85+
"authorName",
86+
"version",
87+
"name"
8388
]
8489

8590
self.arrTypes.update({
@@ -454,6 +459,14 @@ def short_name(self):
454459

455460
return "https://vrchat.com/i/"+self.shortName
456461

462+
def join(self):
463+
'''
464+
"Joins" the instance
465+
Returns void
466+
'''
467+
468+
self.client.api.call("/joins", "PUT", json={"worldId": self.location.location})
469+
457470
def __init__(self, client, obj):
458471
super().__init__(client)
459472
self.unique += [

0 commit comments

Comments
 (0)