mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-08 21:30:01 +08:00
✨ Compatible with pydantic 2.0 using the pydantic compatibility layer provided by nonebot
This commit is contained in:
@@ -174,6 +174,8 @@ class UserConsole(Model):
|
||||
if goods_uuid not in user.props or user.props[goods_uuid] < num:
|
||||
raise GoodsNotFound("未找到商品或道具数量不足...")
|
||||
user.props[goods_uuid] -= num
|
||||
if user.props[goods_uuid] <= 0:
|
||||
del user.props[goods_uuid]
|
||||
await user.save(update_fields=["props"])
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user