From 101cb76503184d2597aa17934abe04428efeb2ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Wed, 2 Nov 2022 08:39:08 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20exception=20raised=20by=20?= =?UTF-8?q?empty=20gacha=20card=20pool=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/genshin/gacha/gacha.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/genshin/gacha/gacha.py b/plugins/genshin/gacha/gacha.py index cf2baf3f..f40f33c5 100644 --- a/plugins/genshin/gacha/gacha.py +++ b/plugins/genshin/gacha/gacha.py @@ -184,7 +184,11 @@ class Gacha(Plugin, BasePlugin): await message.reply_text(f"没有找到名为 {exc.gacha_name} 的卡池,可能是卡池不存在或者卡池已经结束,请检查后重试。如果你想抽取默认卡池,请不要输入参数。") return else: - gacha_base_info = await self.handle.gacha_base_info(default=True) + try: + gacha_base_info = await self.handle.gacha_base_info(default=True) + except GachaNotFound: + await message.reply_text("当前卡池正在替换中,请稍后重试。") + return logger.info(f"用户 {user.full_name}[{user.id}] 抽卡模拟器命令请求 || 参数 {gacha_name}") # 用户数据储存和处理 await message.reply_chat_action(ChatAction.TYPING)