Open
Description
Describe the bug
A recent change to the Roblox API has brokenBaseUser.get_friends
due to the endpoint no longer returning most fields.
To Reproduce
import asyncio
from os import getenv
from dotenv import load_dotenv
from roblox import Client
from roblox.users import User
load_dotenv()
client: Client = Client(getenv("COOKIE"))
async def main():
user: User = await client.get_authenticated_user()
print(await user.get_friends())
asyncio.run(main())
Expected behavior
A list of Friend instances is printed to the console.
Desired solution
BaseUser.get_friends()
should return a PageIterator of BaseUser
instances.
Along with this update a new endpoint has been added /v1/users/{userId}/friends/find which can be used to replace the old endpoint /v1/users/{userId}/friends.
Reasons to switch
- userSort param has been deprecated on the old endpoint.
- The new endpoint is paginated while the old endpoint returns a huge list.
- The old endpoint is capped at 200 friends, so when the max friend limit is raised it will still only return 200 friends.
- The new endpoint provides a more accurate FriendScore for sorting.
Metadata
Metadata
Assignees
Labels
No labels