🐛 Fix daily note task region type error

This commit is contained in:
omg-xtao 2023-07-24 00:43:57 +08:00 committed by GitHub
parent 32a5a51e05
commit 3977680cc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,11 +2,11 @@ import base64
from typing import TYPE_CHECKING, List, Optional from typing import TYPE_CHECKING, List, Optional
from pydantic import BaseModel, validator from pydantic import BaseModel, validator
from simnet import Region
from simnet.errors import BadRequest as SimnetBadRequest, InvalidCookies, TimedOut as SimnetTimedOut from simnet.errors import BadRequest as SimnetBadRequest, InvalidCookies, TimedOut as SimnetTimedOut
from telegram.constants import ParseMode from telegram.constants import ParseMode
from telegram.error import BadRequest, Forbidden from telegram.error import BadRequest, Forbidden
from core.basemodel import RegionEnum
from core.plugin import Plugin from core.plugin import Plugin
from core.services.task.models import Task as TaskUser, TaskStatusEnum from core.services.task.models import Task as TaskUser, TaskStatusEnum
from core.services.task.services import TaskResinServices, TaskRealmServices, TaskExpeditionServices from core.services.task.services import TaskResinServices, TaskRealmServices, TaskExpeditionServices
@ -147,7 +147,7 @@ class DailyNoteSystem(Plugin):
client: "GenshinClient", client: "GenshinClient",
user: DailyNoteTaskUser = None, user: DailyNoteTaskUser = None,
) -> List[str]: ) -> List[str]:
if client.region == RegionEnum.HOYOLAB: if client.region == Region.OVERSEAS:
notes = await client.get_genshin_notes() notes = await client.get_genshin_notes()
else: else:
notes = await client.get_genshin_notes_by_stoken() notes = await client.get_genshin_notes_by_stoken()