feat: add /summary, /setbreak, weekly totals, and fix command dispatch for arg-bearing commands
- Add /summary [YYYY-MM] command for monthly work/break/day-off totals - Add weekly totals row to main menu status - Add /setbreak <minutes> for configurable daily break threshold - Fix HandleMessage routing: extract command name instead of exact match (fixes /export YYYY-MM, /edit, /note, /summary, /setbreak) - Update README with full command table and configurable break docs
This commit is contained in:
@@ -49,6 +49,16 @@ func (h *Handler) buildStatusText(chatID int64) string {
|
||||
text += fmt.Sprintf("\nToday: %s worked", formatDuration(totals.TotalSeconds))
|
||||
}
|
||||
|
||||
loc := loadLocation(user.Timezone)
|
||||
weekTotal := h.computeWeekTotals(user, loc)
|
||||
if weekTotal > 0 {
|
||||
text += fmt.Sprintf("\nWeek: %s", formatDuration(weekTotal))
|
||||
}
|
||||
|
||||
if day.MinBreakThreshold > 0 {
|
||||
text += fmt.Sprintf("\nBreak threshold: %dm", day.MinBreakThreshold/60)
|
||||
}
|
||||
|
||||
text += "\n\nChoose an action:"
|
||||
return text
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user