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

Commit 9e1ec51

Browse files
committed
FavoriteGroup.build_favorite_group()
1 parent e6a5097 commit 9e1ec51

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

vrcpy/favorite.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ def __init__(self, client, obj, loop=None):
7373
del self.unfavorite
7474
self._assign(obj)
7575

76+
@staticmethod
77+
def build_favorite_group(client, obj, loop=None):
78+
switch = {
79+
"world": WorldFavoriteGroup,
80+
"friend": FriendFavoriteGroup,
81+
"avatar": AvatarFavoriteGroup
82+
}
83+
84+
logging.debug("Building favorite group of type " + obj["type"])
85+
86+
return switch[obj["type"]](client, obj, loop)
87+
7688
class WorldFavorite(BaseFavorite):
7789
def __init__(self, client, obj, loop=None):
7890
super().__init__(client, obj, loop)

0 commit comments

Comments
 (0)