🐛 Fix overseas account birthday card causing cookie refresh issue

Fixed an issue where obtaining birthday cards with overseas accounts caused abnormal Cookies refresh.
This commit is contained in:
洛水居室 2023-09-07 23:17:23 +08:00
parent b4ef81dae6
commit 2bed5f8743
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -1,6 +1,7 @@
from datetime import datetime
from typing import TYPE_CHECKING, List, Optional
from simnet import Region
from simnet.client.routes import Route
from simnet.errors import BadRequest as SimnetBadRequest, RegionNotSupported, InvalidCookies, TimedOut as SimnetTimedOut
from simnet.utils.player import recognize_genshin_game_biz, recognize_genshin_server
@ -8,7 +9,6 @@ from sqlalchemy.orm.exc import StaleDataError
from telegram.constants import ParseMode
from telegram.error import BadRequest, Forbidden
from core.basemodel import RegionEnum
from core.plugin import Plugin
from core.services.task.models import TaskStatusEnum
from core.services.task.services import TaskCardServices
@ -100,7 +100,7 @@ class BirthdayCardSystem(Plugin):
self,
client: "GenshinClient",
) -> str:
if client.region == RegionEnum.HOYOLAB:
if client.region == Region.OVERSEAS:
raise RegionNotSupported
today_list = self.get_today_birthday()
if not today_list: