From 2bed5f874392fceda8f0c54d63f2cb3225b9b438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Thu, 7 Sep 2023 23:17:23 +0800 Subject: [PATCH] :bug: Fix overseas account birthday card causing cookie refresh issue Fixed an issue where obtaining birthday cards with overseas accounts caused abnormal Cookies refresh. --- plugins/tools/birthday_card.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tools/birthday_card.py b/plugins/tools/birthday_card.py index 93a307ca..ceab7f05 100644 --- a/plugins/tools/birthday_card.py +++ b/plugins/tools/birthday_card.py @@ -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: