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")