all repos — telegram-bot-api @ c310f538bd8c76fae81f086b5eaaf5f3ebfeed4a

Golang bindings for the Telegram Bot API

Merge pull request #256 from rozha/helpers-NewOneTimeReplyKeyboard

Introduce NewOneTimeReplyKeyboard() helper function
Syfaro syfaro@huefox.com
Tue, 21 Jul 2020 03:36:40 -0500
commit

c310f538bd8c76fae81f086b5eaaf5f3ebfeed4a

parent

fe3a0a8654d017254d5a973cf69badc1c4da4aa8

1 files changed, 7 insertions(+), 0 deletions(-)

jump to
M helpers.gohelpers.go

@@ -776,6 +776,13 @@ Keyboard: keyboard,

} } +// NewOneTimeReplyKeyboard creates a new one time keyboard. +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 {