fix: compute work hours from events at runtime; add Achievements button to RPG view
This commit is contained in:
@@ -73,7 +73,8 @@ func (h *Handler) clockOut(chatID int64) (string, error) {
|
||||
streak, _ := h.updateStreak(user.ID, today, true)
|
||||
xp, leveledUp, newLevel, _ := h.computeAndAwardXP(user.ID, sessionWork, streak, today)
|
||||
stats, _ := h.DB.GetOrCreateRPGStats(user.ID)
|
||||
unlocked := h.checkAchievements(user.ID, stats, sessionWork, today, isWeekend)
|
||||
totalHours := float64(h.totalWorkSeconds(user.ID, loc)) / secondsPerHour
|
||||
unlocked := h.checkAchievements(user.ID, stats, sessionWork, today, isWeekend, totalHours)
|
||||
|
||||
text += fmt.Sprintf("\n\n+%d XP (Lv.%d)", xp, newLevel)
|
||||
if leveledUp {
|
||||
|
||||
Reference in New Issue
Block a user