ro-py / ro.py

ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.
https://ro.py.jmk.gg/
MIT License
115 stars 46 forks source link

Methods that return instances of `Friend` raise `KeyError` #125

Open Jodenee opened 2 days ago

Jodenee commented 2 days ago

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