From 0a205d3ab6bb64ef35bf257b8af7f748b0f5298a Mon Sep 17 00:00:00 2001 From: This is XiaoDeng <1744793737@qq.com> Date: Fri, 20 Oct 2023 23:42:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=20get=5Fstranger=5Finfo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- basic_api_v11.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/basic_api_v11.py b/basic_api_v11.py index 416434f..2994352 100644 --- a/basic_api_v11.py +++ b/basic_api_v11.py @@ -2,6 +2,8 @@ from api import register_action import translator import message_parser_v11 +import return_object +from client import client @register_action("v11") @@ -54,3 +56,18 @@ async def send_msg( user_id=str(user_id) ) ) + + +@register_action("v11") +async def get_stranger_info( + user_id: int, + no_cache: bool = False +) -> dict: + resp_data = translator.translate_action_response( + await basic_actions_v12.get_user_info( + str(user_id) + ) + ) + resp_data["data"]["nickname"] = resp_data["data"].get("user_name", "") + resp_data["data"]["sex"] = "unknown" + return resp_data