add /help command

This commit is contained in:
2026-06-24 10:11:18 +03:30
parent 69c5e20d8e
commit cafa139198

View File

@@ -85,6 +85,8 @@ func (h *Handler) HandleMessage(update tgbotapi.Update) {
switch msg.Text { switch msg.Text {
case "/start": case "/start":
h.handleStart(msg) h.handleStart(msg)
case "/help":
h.handleHelp(msg)
case "/clockin": case "/clockin":
h.handleActionMsg(msg, h.clockIn) h.handleActionMsg(msg, h.clockIn)
case "/clockout": case "/clockout":
@@ -355,6 +357,25 @@ func (h *Handler) handleStart(msg *tgbotapi.Message) {
h.Bot.Send(menu) h.Bot.Send(menu)
} }
func (h *Handler) handleHelp(msg *tgbotapi.Message) {
text := `Commands:
/start - Show main menu
/clockin - Clock in
/clockout - Clock out
/worktype - Select work type
/dayoff - Toggle day off
/report - Show today report
/export - Export monthly report (Excel)
/history - View calendar history
/edit YYYY-MM-DD - Edit a specific day
/reporttoggle - Enable/disable auto report
/setreporttime HH:MM - Set daily report time
/setaccent - Select accent color
Buttons on the main menu also work.`
h.sendText(msg.Chat.ID, text)
}
func (h *Handler) handleWorkTypeMsg(msg *tgbotapi.Message) { func (h *Handler) handleWorkTypeMsg(msg *tgbotapi.Message) {
user, day, err := h.getUserToday(msg.Chat.ID) user, day, err := h.getUserToday(msg.Chat.ID)
if err != nil { if err != nil {