Skip to content

Commit

Permalink
支持 get_stranger_info
Browse files Browse the repository at this point in the history
  • Loading branch information
This-is-XiaoDeng committed Oct 20, 2023
1 parent 19d965b commit 0a205d3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions basic_api_v11.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

0 comments on commit 0a205d3

Please sign in to comment.