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

Commit d5ee1fd

Browse files
committed
CurrentUser.fetch_favorite_groups()
1 parent 9e1ec51 commit d5ee1fd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

vrcpy/user.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from vrcpy.errors import ObjectErrors
22
from vrcpy.baseobject import BaseObject
3+
from vrcpy.favorite import FavoriteGroup
34
from vrcpy.enum import FavoriteType, SortOrder, SortType, ReleaseStatus
45
import vrcpy.util
56

@@ -564,3 +565,20 @@ async def update(self, email=None, birthday=None, tags=None, status=None,
564565
status=status, bio=bio, bio_Links=bio_links,
565566
accepted_tos_version=accepted_tos_version,
566567
allow_avatar_copying=allow_avatar_copying)
568+
569+
async def fetch_favorite_groups(self, n: int = 50):
570+
'''
571+
Fetches favorite groups for worlds, avatars and users
572+
573+
n, int
574+
Max number of favorites groups to fetch
575+
'''
576+
577+
resp = await self.client.request.get("/favorite/groups", params={"n": str(n)})
578+
groups = {}
579+
580+
for group in resp["data"]:
581+
groups.append(FavoriteGroup.build_favorite_group(
582+
self.client, group, self.loop))
583+
584+
return groups

0 commit comments

Comments
 (0)