Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods that return instances of Friend raise KeyError #125

Open
Jodenee opened this issue Nov 14, 2024 · 0 comments
Open

Methods that return instances of Friend raise KeyError #125

Jodenee opened this issue Nov 14, 2024 · 0 comments

Comments

@Jodenee
Copy link
Contributor

Jodenee commented Nov 14, 2024

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant