Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
👽 make room_id of /audit optional
Browse files Browse the repository at this point in the history
  • Loading branch information
MingxuanGame committed Dec 16, 2023
1 parent f6d43d9 commit bed1979
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions hertavilla/apis/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ async def audit(
self,
villa_id: int,
audit_content: str,
room_id: int,
uid: int,
room_id: int | None = None,
pass_through: str | None = None,
content_type: AuditContentType = AuditContentType.TEXT,
) -> str:
Expand All @@ -20,16 +20,14 @@ async def audit(
Args:
villa_id (int): 大别野 id
audit_content (str): 待审核内容
room_id (int): 房间 id
uid (int): 用户 id
room_id (int | None, optional): 房间 id,选填. Defaults to None.
pass_through (str | None, optional): 透传信息,该字段会在审核结果回调时携带给开发者,选填. Defaults to None.
content_type (AuditContentType, optional): 审核内容的类型. Defaults to AuditContentType.TEXT.
Returns:
str: 审核事件 id
""" # noqa: E501
# FIXME: 文档所说 room_id 和 uid 为选填
# 但是不填会 -1,所以这里设置成了必填
return (
await self.base_request(
"/audit",
Expand Down
2 changes: 1 addition & 1 deletion hertavilla/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ class AuditCallbackEvent(Event):
bot_tpl_id: str
"""机器人 id"""

room_id: int
room_id: int | None = None
"""房间 id(和审核接口调用方传入的值一致)"""

user_id: int
Expand Down

0 comments on commit bed1979

Please sign in to comment.