Skip to content

Commit

Permalink
remove legacy apis
Browse files Browse the repository at this point in the history
there are too many of these to maintain by myself especially considering roblox's stance on breaking changes with them.
  • Loading branch information
treeben77 committed Nov 2, 2024
1 parent 712f84f commit f8a0cf0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 144 deletions.
34 changes: 0 additions & 34 deletions rblxopencloud/experience.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,37 +1282,3 @@ def unban_user(self, user_id: int) -> UserRestriction:
)

return UserRestriction(data, self.__api_key)

def update_badge(
self,
badge_id: int,
enabled: bool = None,
name: str = None,
description: str = None,
):
"""
Updates a badge with the provided badge ID.
Args:
enabled: Whether it can be awarded and appear on the game page.
name: The new name for the badge.
description: The new description for the badge.
!!! warning
This endpoint uses the legacy badges API. Roblox has noted on \
the [DevForum](https://devforum.roblox.com/t/3106190) that these endpoints \
may change without notice and break your application, therefore they should \
be used with caution.
"""

send_request(
"PATCH",
f"legacy-badges/v1/badges/{badge_id}",
authorization=self.__api_key,
expected_status=[200],
json={
"name": name,
"description": description,
"enabled": enabled,
},
)
110 changes: 0 additions & 110 deletions rblxopencloud/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,113 +731,3 @@ def list_inventory(
yield InventoryGamePass(entry["gamePassDetails"])
elif "privateServerDetails" in entry.keys():
yield InventoryPrivateServer(entry["privateServerDetails"])

def fetch_experience_followings(self) -> list["UserExperienceFollowing"]:
"""
Fetches the list of experiences the user is following.
Returns:
A list of experiences the user is following, and the time they \
followed at. `can_follow`, `following_count`, and \
`following_limit` will all be `None`.
!!! warning
This endpoint uses the legacy followings API. Roblox has noted on \
the [DevForum](https://devforum.roblox.com/t/3106190) that these endpoints \
may change without notice and break your application, therefore they should \
be used with caution.
"""

_, data, _ = send_request(
"GET",
f"legacy-followings/v2/users/{self.id}/universes",
authorization=self.__api_key,
expected_status=[200],
)

followings = []

for k, v in data["followedSources"].items():
followings.append(UserExperienceFollowing(self.__api_key, k, v))

return followings

def fetch_experience_following_status(
self, experience_id: int
) -> UserExperienceFollowing:
"""
Fetches the following status of the requested experience for the user.
Args:
experience_id: The ID of the experience to fetch status for; not \
to be confused with a place ID.
Returns:
The following status object with `followed_at` being `None`.
!!! warning
This endpoint uses the legacy followings API. Roblox has noted on \
the [DevForum](https://devforum.roblox.com/t/3106190) that these endpoints \
may change without notice and break your application, therefore they should \
be used with caution.
"""

_, data, _ = send_request(
"GET",
f"legacy-followings/v1/users/{self.id}/universes/\
{experience_id}/status",
authorization=self.__api_key,
expected_status=[200],
)

return UserExperienceFollowing(
self.__api_key, experience_id, None, data
)

def follow_experience(self, experience_id: int):
"""
Follows the requested experience for the user. This means the user \
will recieve updates and notifications for the experience.
Args:
experience_id: The ID of the experience to follow; not to be \
confused with a place ID.
!!! warning
This endpoint uses the legacy followings API. Roblox has noted on \
the [DevForum](https://devforum.roblox.com/t/3106190) that these endpoints \
may change without notice and break your application, therefore they should \
be used with caution.
"""

send_request(
"POST",
f"legacy-followings/v1/users/{self.id}/universes/\
{experience_id}",
authorization=self.__api_key,
expected_status=[200],
)

def unfollow_experience(self, experience_id: int):
"""
Unfollows the requested experience for the user. This means the user \
will no longer recieve updates and notifications for the experience.
Args:
experience_id: The ID of the experience to unfollow; not to be \
confused with a place ID.
!!! warning
This endpoint uses the legacy followings API. Roblox has noted on \
the [DevForum](https://devforum.roblox.com/t/3106190) that these endpoints \
may change without notice and break your application, therefore they should \
be used with caution.
"""

send_request(
"DELETE",
f"legacy-followings/v1/users/{self.id}/universes/\
{experience_id}",
authorization=self.__api_key,
expected_status=[200],
)

0 comments on commit f8a0cf0

Please sign in to comment.