mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🐛 Fix Incorrect Region
This commit is contained in:
parent
6552606cc7
commit
4aa00fc43c
@ -95,8 +95,8 @@ class SetUserCookies(Plugin.Conversation, BasePlugin.Conversation):
|
|||||||
add_user_command_data: AddUserCommandData = context.chat_data.get("add_user_command_data")
|
add_user_command_data: AddUserCommandData = context.chat_data.get("add_user_command_data")
|
||||||
if add_user_command_data is None:
|
if add_user_command_data is None:
|
||||||
add_user_command_data = AddUserCommandData()
|
add_user_command_data = AddUserCommandData()
|
||||||
add_user_command_data.region = RegionEnum.HYPERION
|
|
||||||
context.chat_data["add_user_command_data"] = add_user_command_data
|
context.chat_data["add_user_command_data"] = add_user_command_data
|
||||||
|
add_user_command_data.region = RegionEnum.HYPERION
|
||||||
try:
|
try:
|
||||||
user_info = await self.user_service.get_user_by_id(user.id)
|
user_info = await self.user_service.get_user_by_id(user.id)
|
||||||
except UserNotFoundError:
|
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")
|
add_user_command_data: AddUserCommandData = context.chat_data.get("add_user_command_data")
|
||||||
cookies = add_user_command_data.cookies
|
cookies = add_user_command_data.cookies
|
||||||
if add_user_command_data.region == RegionEnum.HYPERION:
|
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:
|
elif add_user_command_data.region == RegionEnum.HOYOLAB:
|
||||||
client = genshin.GenshinClient(cookies=cookies)
|
client = genshin.Client(cookies=cookies, region=types.Region.OVERSEAS)
|
||||||
else:
|
else:
|
||||||
logger.error("用户 %s[%s] region 异常", user.full_name, user.id)
|
logger.error("用户 %s[%s] region 异常", user.full_name, user.id)
|
||||||
await message.reply_text("数据错误", reply_markup=ReplyKeyboardRemove())
|
await message.reply_text("数据错误", reply_markup=ReplyKeyboardRemove())
|
||||||
|
Loading…
Reference in New Issue
Block a user