Skip to content

Commit

Permalink
Merge pull request #578 from TZFC/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
z0z0r4 authored Nov 25, 2023
2 parents 39c5126 + 0392958 commit 30cd2e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
7 changes: 3 additions & 4 deletions bilibili_api/data/api/live.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,13 +313,12 @@
"comment": "封禁用户"
},
"del_block": {
"url": "https://api.live.bilibili.com/banned_service/v1/Silent/del_room_block_user",
"url": "https://api.live.bilibili.com/xlive/web-ucenter/v1/banned/DelSilentUser",
"method": "POST",
"verify": true,
"params": {
"roomid": "int: 真实房间号",
"id": "int: 封禁 ID,从 ID.info.black_list 中获取或者 ID.operate.black_list 的返回值获取",
"visit_id": "str: 空"
"room_id": "int: 真实房间号",
"tuid": "int: 封禁用户 UID"
},
"comment": "解封用户"
},
Expand Down
9 changes: 4 additions & 5 deletions bilibili_api/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,22 +477,21 @@ async def ban_user(self, uid: int) -> dict:
}
return await Api(**api, credential=self.credential).update_data(**data).result

async def unban_user(self, block_id: int) -> dict:
async def unban_user(self, uid: int) -> dict:
"""
解封用户
Args:
block_id (int): 封禁用户时会返回该封禁事件的 ID,使用该值
uid (int): 用户 UID
Returns:
dict: 调用 API 返回的结果
"""
self.credential.raise_for_no_sessdata()
api = API["operate"]["del_block"]
data = {
"roomid": self.room_display_id,
"id": block_id,
"visit_id": "",
"room_id": self.room_display_id,
"tuid": uid,
}
return await Api(**api, credential=self.credential).update_data(**data).result

Expand Down
6 changes: 3 additions & 3 deletions docs/modules/live.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ from bilibili_api import live

#### async def unban_user()

| name | type | description |
| -------- | ---- | ----------------------------------------- |
| block_id | int | 封禁事件 ID,使用 `get_black_list()` 获取 |
| name | type | description |
| ---- | ---- | ----------- |
| uid | int | 用户 UID |

解封用户

Expand Down

0 comments on commit 30cd2e1

Please sign in to comment.