Skip to content

Commit

Permalink
fix!: remove argument uid for User.get_relation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo2011 committed Oct 4, 2024
1 parent a312432 commit bff8f5b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
7 changes: 2 additions & 5 deletions bilibili_api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 0 additions & 3 deletions docs/modules/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,6 @@ medialist排序顺序。
获取与某用户的关系


| name | type | description |
| - | - | - |
| uid | int | 用户 UID |

**Returns:** dict: 调用接口返回的内容。

Expand Down
2 changes: 1 addition & 1 deletion tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bff8f5b

Please sign in to comment.