all repos — telegram-bot-api @ a2483eb98b4c06e05105e15642e1dff45af5fafa

Golang bindings for the Telegram Bot API

Add helpers for callback queries.
Syfaro syfaro@foxpaw.in
Thu, 14 Apr 2016 16:30:41 -0500
commit

a2483eb98b4c06e05105e15642e1dff45af5fafa

parent

0d1bc8c4e2e3740319208dda167ea15cbd0a2cb6

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

jump to
M helpers.gohelpers.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, + } +}