diff --git a/plugins/genshin/avatar_list.py b/plugins/genshin/avatar_list.py index 3c72d77..cd2f2d5 100644 --- a/plugins/genshin/avatar_list.py +++ b/plugins/genshin/avatar_list.py @@ -4,7 +4,7 @@ from typing import Iterable, List, Optional, Sequence from arkowrapper import ArkoWrapper from enkanetwork import Assets as EnkaAssets, EnkaNetworkAPI -from genshin import Client, GenshinException +from genshin import Client, GenshinException, InvalidCookies from genshin.models import CalculatorCharacterDetails, CalculatorTalent, Character from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Message, Update, User from telegram.constants import ChatAction, ParseMode @@ -198,6 +198,9 @@ class AvatarListPlugin(Plugin, BasePlugin): avatar_datas: List[AvatarData] = await self.get_avatars_data( characters, client, None if all_avatars else 20 ) + except InvalidCookies as e: + await notice.delete() + raise e except GenshinException as e: if e.retcode == -502002: self._add_delete_message_job(context, notice.chat_id, notice.message_id, 5) diff --git a/plugins/genshin/daily/material.py b/plugins/genshin/daily/material.py index c571b9d..4fa64b0 100644 --- a/plugins/genshin/daily/material.py +++ b/plugins/genshin/daily/material.py @@ -274,6 +274,8 @@ class DailyMaterial(Plugin, BasePlugin): try: skills = await self._get_skills_data(client, i.gid) i.skills = skills + except InvalidCookies: + calculator_sync = False except GenshinException as e: if e.retcode == -502002: calculator_sync = False # 发现角色养成计算器没启用 设置状态为 False 并防止下次继续获取