1.尝试修复签到不加分的错误2.移除注册时间显示

This commit is contained in:
2025-10-29 11:51:15 +08:00
parent 7483a00a99
commit 003ff9a94e
4 changed files with 30 additions and 17 deletions

View File

@@ -71,20 +71,25 @@ class PointsGame(BaseGame):
return f"❌ 今日已签到,明天再来吧!\n\n📅 签到日期:{today}"
# 执行签到
if self.db.daily_checkin(user_id, checkin_points):
# 获取用户积分信息
points_info = self.db.get_user_points(user_id)
text = f"## ✅ 签到成功!\n\n"
text += f"**获得积分**+{checkin_points}\n\n"
text += f"**当前积分**{points_info['available_points']}\n\n"
text += f"**积分**{points_info['total_points']}\n\n"
text += f"📅 签到日期:{today}\n\n"
text += "💡 提示:每天签到可获得固定积分奖励!"
return text
else:
return "❌ 签到失败,请稍后重试"
try:
result = self.db.daily_checkin(user_id, checkin_points)
if result:
# 获取用户积分信息
points_info = self.db.get_user_points(user_id)
text = f"## ✅ 签到成功!\n\n"
text += f"**获得积分**+{checkin_points}\n\n"
text += f"**当前积分**{points_info['available_points']}\n\n"
text += f"**总积分**{points_info['total_points']}\n\n"
text += f"📅 签到日期:{today}\n\n"
text += "💡 提示:每天签到可获得固定积分奖励!"
return text
else:
return "❌ 签到失败,请稍后重试"
except Exception as e:
logger.error(f"签到过程中发生错误: {e}", exc_info=True)
return f"❌ 签到过程中发生错误: {str(e)}"
def _get_user_points(self, user_id: int) -> str:
"""获取用户积分信息
@@ -100,7 +105,6 @@ class PointsGame(BaseGame):
text = f"## 💎 个人积分\n\n"
text += f"**可用积分**{points_info['available_points']}\n\n"
text += f"**总积分**{points_info['total_points']}\n\n"
text += f"**注册时间**{datetime.fromtimestamp(points_info['created_at']).strftime('%Y-%m-%d %H:%M')}\n\n"
text += "---\n\n"
text += "💡 提示:\n"
text += "• 每日签到可获得 10 积分\n"