diff --git a/bilibili_api/user.py b/bilibili_api/user.py index 4555df1d..65ed8a84 100644 --- a/bilibili_api/user.py +++ b/bilibili_api/user.py @@ -834,19 +834,16 @@ async def get_overview_stat(self) -> dict: await Api(**api, credential=self.credential).update_params(**params).result ) - async def get_relation(self, uid: int) -> dict: + async def get_relation(self) -> dict: """ 获取与某用户的关系 - Args: - uid (int): 用户 UID - Returns: dict: 调用接口返回的内容。 """ api = API["info"]["relation"] - params = {"mid": uid} + params = {"mid": self.__uid} return ( await Api(**api, credential=self.credential).update_params(**params).result ) diff --git a/docs/modules/user.md b/docs/modules/user.md index aaf5fa2a..3550460d 100644 --- a/docs/modules/user.md +++ b/docs/modules/user.md @@ -465,9 +465,6 @@ medialist排序顺序。 获取与某用户的关系 -| name | type | description | -| - | - | - | -| uid | int | 用户 UID | **Returns:** dict: 调用接口返回的内容。 diff --git a/tests/test_user.py b/tests/test_user.py index 82eec87d..7b2f7d94 100644 --- a/tests/test_user.py +++ b/tests/test_user.py @@ -282,7 +282,7 @@ async def test_zw_get_self_jury_info(): return await user.get_self_jury_info(credential) async def test_zx_get_relation(): - return await u.get_relation(UID) + return await u.get_relation() async def test_zy_get_masterpiece(): return await u.get_masterpiece()