From b478ff9669daca239e94cf0659e7c941a5071a6c Mon Sep 17 00:00:00 2001 From: rozha Date: Sun, 11 Aug 2019 13:20:40 +0300 Subject: [PATCH 1/2] Introduce NewOneTimeReplyKeyboard() helper function --- helpers.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helpers.go b/helpers.go index 3dabe11..fc19313 100644 --- a/helpers.go +++ b/helpers.go @@ -704,6 +704,13 @@ func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup { } } +// NewOneTimeReplyKeyboard creates a new one time keyboard using NewReplyKeyboard() +func NewOneTimeReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup { + markup := NewReplyKeyboard(rows...) + markup.OneTimeKeyboard = true + return markup +} + // NewInlineKeyboardButtonData creates an inline keyboard button with text // and data for a callback. func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton { From ce395c2286e5532256440120e145eb551e558555 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Tue, 21 Jul 2020 03:35:48 -0500 Subject: [PATCH 2/2] Update comment on NewOneTimeReplyKeyboard. --- helpers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers.go b/helpers.go index fc19313..bf256b8 100644 --- a/helpers.go +++ b/helpers.go @@ -704,7 +704,7 @@ func NewReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup { } } -// NewOneTimeReplyKeyboard creates a new one time keyboard using NewReplyKeyboard() +// NewOneTimeReplyKeyboard creates a new one time keyboard. func NewOneTimeReplyKeyboard(rows ...[]KeyboardButton) ReplyKeyboardMarkup { markup := NewReplyKeyboard(rows...) markup.OneTimeKeyboard = true