Add helpers for callback queries.
Syfaro syfaro@foxpaw.in
Thu, 14 Apr 2016 16:30:41 -0500
1 files changed,
19 insertions(+),
0 deletions(-)
jump to
M
helpers.go
→
helpers.go
@@ -537,3 +537,22 @@ return InlineKeyboardMarkup{
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, + } +}