ro-py/ro.py

Key error when calling get_friends()

Closed this issue · 2 comments

Describe the bug

To Reproduce
When calling user.get_friends(), the following error is thrown:

Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Thonny\lib\tkinter_init_.py", line 1921, in call
return self.func(*args)
File "D:\TkinterStuff\GUI.py", line 210, in buttonClick
asyncio.get_event_loop().run_until_complete(getID(values_list))
File "C:\Users\user\AppData\Local\Programs\Thonny\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "D:\TkinterStuff\GUI.py", line 183, in getID
friends = await user.get_friends()
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\roblox\bases\baseuser.py", line 112, in get_friends
return [Friend(shared=self._shared, data=friend_data) for friend_data in friends_data]
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\roblox\bases\baseuser.py", line 112, in
return [Friend(shared=self._shared, data=friend_data) for friend_data in friends_data]
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\roblox\friends.py", line 33, in init
self.presence_type: int = data["presenceType"]
KeyError: 'presenceType'

To Reproduce

  1. Call user.get_friends()
  2. See error

Expected behavior
Returns a list of the users friends

jmkd3v commented

This is due to a Roblox API change - this is mitigated in the latest git version. For now, pull from git (pip3 uininstall roblox; pip3 install git+https://github.com/ro-py/ro.py) and this will be fixed upstream in the next month.

That fixed it, thanks