From 574c36ed8ea74c0f04fc0a2577d1698ea780e745 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Sun, 16 Feb 2025 15:03:35 +0800 Subject: [PATCH] =?UTF-8?q?:adhesive=5Fbandage:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BD=BF=E7=94=A8=E5=89=8D=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/shop/_data_source.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/zhenxun/builtin_plugins/shop/_data_source.py b/zhenxun/builtin_plugins/shop/_data_source.py index 33fc6d3e..7709912b 100644 --- a/zhenxun/builtin_plugins/shop/_data_source.py +++ b/zhenxun/builtin_plugins/shop/_data_source.py @@ -237,6 +237,7 @@ class ShopManage: cls, goods: Goods, param: ShopParam, + session: Uninfo, run_type: Literal["after", "before"], **kwargs, ): @@ -253,9 +254,9 @@ class ShopManage: args = inspect.signature(func).parameters if args and next(iter(args.keys())) != "kwargs": if asyncio.iscoroutinefunction(func): - await func(*cls.__parse_args(args, param, **kwargs)) + await func(*cls.__parse_args(args, param, session, **kwargs)) else: - func(*cls.__parse_args(args, param, **kwargs)) + func(*cls.__parse_args(args, param, session, **kwargs)) elif asyncio.iscoroutinefunction(func): await func() else: @@ -339,12 +340,12 @@ class ShopManage: ) if num > param.max_num_limit: return f"{goods_info.goods_name} 单次使用最大数量为{param.max_num_limit}..." - await cls.run_before_after(goods, param, "before", **kwargs) + await cls.run_before_after(goods, param, session, "before", **kwargs) result = await cls.__run(goods, param, session, **kwargs) await UserConsole.use_props( session.user.id, goods_info.uuid, num, PlatformUtils.get_platform(session) ) - await cls.run_before_after(goods, param, "after", **kwargs) + await cls.run_before_after(goods, param, session, "after", **kwargs) if not result and param.send_success_msg: result = f"使用道具 {goods.name} {num} 次成功!" return result