From 4aa00fc43c178877b97114dc1498c918e028f7ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Tue, 27 Dec 2022 14:30:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Incorrect=20Region?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/cookies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/genshin/cookies.py b/plugins/genshin/cookies.py index 38c3b95..401c73f 100644 --- a/plugins/genshin/cookies.py +++ b/plugins/genshin/cookies.py @@ -95,8 +95,8 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation): add_user_command_data: AddUserCommandData = context.chat_data.get("add_user_command_data") if add_user_command_data is None: add_user_command_data = AddUserCommandData() - add_user_command_data.region = RegionEnum.HYPERION context.chat_data["add_user_command_data"] = add_user_command_data + add_user_command_data.region = RegionEnum.HYPERION try: user_info = await self.user_service.get_user_by_id(user.id) except UserNotFoundError: @@ -238,9 +238,9 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation): add_user_command_data: AddUserCommandData = context.chat_data.get("add_user_command_data") cookies = add_user_command_data.cookies if add_user_command_data.region == RegionEnum.HYPERION: - client = genshin.ChineseClient(cookies=cookies) + client = genshin.Client(cookies=cookies, region=types.Region.CHINESE) elif add_user_command_data.region == RegionEnum.HOYOLAB: - client = genshin.GenshinClient(cookies=cookies) + client = genshin.Client(cookies=cookies, region=types.Region.OVERSEAS) else: logger.error("用户 %s[%s] region 异常", user.full_name, user.id) await message.reply_text("数据错误", reply_markup=ReplyKeyboardRemove())