去除wcf对象

This commit is contained in:
liuwei
2025-04-22 16:26:18 +08:00
parent e0a0b28807
commit ad61f61664
7 changed files with 44 additions and 53 deletions

View File

@@ -141,14 +141,12 @@ def plugin_points_cost(points: int, description: str = None, feature: Feature =
user_points = points_db.get_user_points(sender, roomid)
if user_points["total_points"] < points:
# 积分不足
wcf = message.get("wcf")
if wcf:
self.message_util.send_text(
f"❌ 积分不足\n无法使用 {plugin_name} 功能\n"
f"🪙 先参与积分活动[签到,答题/t]赚取吧!\n"
f"💰 有: {user_points['total_points']} | 需: {points} |差: {points - user_points['total_points']} ",
(roomid if roomid else sender), sender
)
self.message_util.send_text(
f"❌ 积分不足\n无法使用 {plugin_name} 功能\n"
f"🪙 先参与积分活动[签到,答题/t]赚取吧!\n"
f"💰 有: {user_points['total_points']} | 需: {points} |差: {points - user_points['total_points']} ",
(roomid if roomid else sender), sender
)
logger.info(f"用户 {sender} 积分不足,无法使用功能")
return False, "积分不足"
@@ -168,12 +166,10 @@ def plugin_points_cost(points: int, description: str = None, feature: Feature =
# 添加对 response 的类型检查
if isinstance(response, str) and "积分" not in response:
response += f"\n\n💰 已消费 {points} 积分"
wcf = message.get("wcf")
if wcf:
self.message_util.send_text(
f"💰消费 {points} 积分",
(roomid if roomid else sender), sender
)
self.message_util.send_text(
f"💰消费 {points} 积分",
(roomid if roomid else sender), sender
)
else:
logger.warning(f"用户 {sender} 积分扣除失败: {deduct_result}")