From 2ffef08e3e9ff6ef6101781a82ed220f7e4955b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=2E=E5=B1=B1=E5=B2=AD=E5=B1=85=E5=AE=A4?= Date: Fri, 20 May 2022 00:22:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20`getuser`=20UID=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/get_user.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/get_user.py b/plugins/get_user.py index 1bd71323..d876e8e3 100644 --- a/plugins/get_user.py +++ b/plugins/get_user.py @@ -29,10 +29,12 @@ class GetUser(BasePlugins): async def _start_get_user_info(self, user_info: UserInfoData, service: ServiceEnum, uid: int = -1) -> bytes: if service == ServiceEnum.MIHOYOBBS: client = genshin.ChineseClient(cookies=user_info.mihoyo_cookie) - uid = user_info.mihoyo_game_uid + if uid <= 0: + uid = user_info.mihoyo_game_uid else: client = genshin.GenshinClient(cookies=user_info.hoyoverse_cookie, lang="zh-cn") - uid = user_info.mihoyo_game_uid + if uid <= 0: + uid = user_info.mihoyo_game_uid try: user_info = await client.get_user(uid) except TooManyRequests as error: