签到功能加入了总天数记录。

This commit is contained in:
liuwei
2025-09-17 14:26:55 +08:00
parent 012417cdf9
commit 77ae80c06c
3 changed files with 93 additions and 2 deletions

View File

@@ -317,7 +317,16 @@ class MessageSignPlugin(MessagePluginInterface):
None # 首次签到,没有上次签到时间
)
# 在输出信息中添加每日词汇
# 记录签到历史
self.sign_in_db.create_sign_history(
sender, roomid, current_time, current_time,
False, points_to_add, streak
)
# 更新Redis中的签到总次数
total_sign_count = self.sign_in_redis.increment_user_sign_count(sender, roomid)
# 在输出信息中添加每日词汇和签到总次数
output = f"签到成功,加[{points_to_add}]积分,第[{today_signin_rank}]个!"
if streak_broken and old_streak > 0: # 只有在真的断签且之前有签到记录时才显示
@@ -325,6 +334,9 @@ class MessageSignPlugin(MessagePluginInterface):
elif streak > 1:
output += f"连签 {streak} 天!"
# 添加总签到次数信息
output += f"\n总签到次数:{total_sign_count}"
# 从内存中获取随机词汇
daily_vocab = self.get_random_vocabulary()
output += f"\n今日词汇:{daily_vocab}"