From a2483eb98b4c06e05105e15642e1dff45af5fafa Mon Sep 17 00:00:00 2001 From: Syfaro Date: Thu, 14 Apr 2016 16:30:41 -0500 Subject: [PATCH] Add helpers for callback queries. --- helpers.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/helpers.go b/helpers.go index 65480a6..6af3e65 100644 --- a/helpers.go +++ b/helpers.go @@ -537,3 +537,22 @@ func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarku InlineKeyboard: keyboard, } } + +// NewCallback creates a new callback message. +func NewCallback(id, text string) CallbackConfig { + return CallbackConfig{ + CallbackQueryID: id, + Text: text, + ShowAlert: false, + } +} + +// NewCallbackWithAlert creates a new callback message that alerts +// the user. +func NewCallbackWithAlert(id, text string) CallbackConfig { + return CallbackConfig{ + CallbackQueryID: id, + Text: text, + ShowAlert: true, + } +}