Skip to content

Commit

Permalink
update friends endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Snayt1k3 committed Apr 29, 2024
1 parent 0f938e8 commit 525c6a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion shikimori/endpoints/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@ async def signOut(self) -> None | RequestError:

return response

async def friends(self) -> List[User] | RequestError:
async def friends(self, page: int = None, limit: int = None) -> List[User] | RequestError:
"""
Show user's friends
:param limit: 100 maximum
:param page: Must be a number between 1 and 100000.
"""
response = await self._request.make_request(
"GET",
url=f"{self._base_url}/api/users/friends",
headers=self.headers,
json=filter_none_parameters({"page": page, "limit": limit})
)
if not isinstance(response, RequestError):
return [User.from_dict(u) for u in response]
Expand Down

0 comments on commit 525c6a4

Please sign in to comment.