feat: add /settings command and document /history for UI-command parity

- Add /settings command handler with inline settings keyboard
- Add /history to README commands table
- Update /help command list
- Remove unused Leagu.go old reference
This commit is contained in:
2026-06-25 09:55:53 +03:30
parent d15ed46066
commit a96419f324
3 changed files with 16 additions and 0 deletions

View File

@@ -148,6 +148,8 @@ func (h *Handler) routeCommand(ctx context.Context, msg *models.Message, user *d
switch cmd {
case "/start":
h.handleStart(ctx, msg, user)
case "/settings":
h.handleSettings(ctx, msg, user)
case "/help":
h.handleHelp(ctx, msg)
case "/clockin":

View File

@@ -21,9 +21,21 @@ func (h *Handler) handleStart(ctx context.Context, msg *models.Message, user *do
h.sendWithKB(ctx, msg.Chat.ID, h.buildStatusText(user), kb)
}
func (h *Handler) handleSettings(ctx context.Context, msg *models.Message, user *domain.User) {
st, err := h.Repo.GetOrCreateSettings(user.ID)
if err != nil {
h.sendText(ctx, msg.Chat.ID, "Error loading settings")
return
}
bt := h.getTodayBreakThreshold(user)
text, kb := h.buildSettingsKeyboard(user, st, bt)
h.sendWithKB(ctx, msg.Chat.ID, text, kb)
}
func (h *Handler) handleHelp(ctx context.Context, msg *models.Message) {
text := `Commands:
/start - Show main menu
/settings - Open settings
/clockin - Clock in
/clockout - Clock out
/worktype - Select work type