diff --git a/hertavilla/apis/audit.py b/hertavilla/apis/audit.py index 4c94e9a..5356310 100644 --- a/hertavilla/apis/audit.py +++ b/hertavilla/apis/audit.py @@ -7,10 +7,9 @@ class AuditAPIMixin(_BaseAPIMixin): 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: @@ -18,23 +17,19 @@ 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", "POST", - villa_id, data={ "audit_content": audit_content, "room_id": room_id, diff --git a/hertavilla/event.py b/hertavilla/event.py index acf1426..44584d9 100644 --- a/hertavilla/event.py +++ b/hertavilla/event.py @@ -252,7 +252,7 @@ class AuditCallbackEvent(Event): bot_tpl_id: str """机器人 id""" - room_id: int + room_id: int | None = None """房间 id(和审核接口调用方传入的值一致)""" user_id: int