From a92c72f46a7f023c4db1d7294d95abb0a91365fe Mon Sep 17 00:00:00 2001 From: db123 Date: Tue, 23 Jun 2026 21:44:41 +0330 Subject: [PATCH] feat: add persistent reply keyboard with Clock In / Clock Out buttons Also handle button text (English + Persian) in message router. --- internal/bot/handlers.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/bot/handlers.go b/internal/bot/handlers.go index 5766435..cfc1933 100644 --- a/internal/bot/handlers.go +++ b/internal/bot/handlers.go @@ -27,9 +27,9 @@ func (h *Handler) HandleMessage(update tgbotapi.Update) { switch msg.Text { case "/start": h.handleStart(msg) - case "/clockin": + case "/clockin", "Clock In", "ورود": h.handleClockInMsg(msg) - case "/clockout": + case "/clockout", "Clock Out", "خروج": h.handleClockOutMsg(msg) case "/remote": h.toggleRemote(msg) @@ -73,6 +73,20 @@ func (h *Handler) handleStart(msg *tgbotapi.Message) { reply := tgbotapi.NewMessage(msg.Chat.ID, text) reply.ReplyMarkup = mainKeyboard() _, _ = h.Bot.Send(reply) + + kb := quickKeyboard() + quick := tgbotapi.NewMessage(msg.Chat.ID, "Quick buttons added below:") + quick.ReplyMarkup = kb + _, _ = h.Bot.Send(quick) +} + +func quickKeyboard() tgbotapi.ReplyKeyboardMarkup { + return tgbotapi.NewReplyKeyboard( + tgbotapi.NewKeyboardButtonRow( + tgbotapi.NewKeyboardButton("Clock In"), + tgbotapi.NewKeyboardButton("Clock Out"), + ), + ) } func mainKeyboard() tgbotapi.InlineKeyboardMarkup {