From 8604444879c79beb5e1c4b408b2cac13be3da186 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Sat, 22 Feb 2025 23:58:51 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=8D=95=E8=8E=B7=E9=81=93?= =?UTF-8?q?=E5=85=B7=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/shop/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zhenxun/builtin_plugins/shop/__init__.py b/zhenxun/builtin_plugins/shop/__init__.py index 32897811..89282d63 100644 --- a/zhenxun/builtin_plugins/shop/__init__.py +++ b/zhenxun/builtin_plugins/shop/__init__.py @@ -18,6 +18,7 @@ from nonebot_plugin_uninfo import Uninfo from zhenxun.configs.utils import BaseBlock, Command, PluginExtraData, RegisterConfig from zhenxun.services.log import logger +from zhenxun.utils.decorator.shop import NotMeetUseConditionsException from zhenxun.utils.depends import UserName from zhenxun.utils.enum import BlockType, PluginType from zhenxun.utils.exception import GoodsNotFound @@ -202,6 +203,12 @@ async def _( await MessageUtils.build_message( f"没有找到道具 {name.result} 或道具数量不足..." ).send(reply_to=True) + except NotMeetUseConditionsException as e: + if info := e.get_info(): + await MessageUtils.build_message(info).finish() # type: ignore + await MessageUtils.build_message( + f"使用道具 {name.result} 的条件不满足..." + ).send(reply_to=True) @_matcher.assign("gold-list")