Skip to content

Commit

Permalink
Add helpers for callback queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Syfaro committed Apr 14, 2016
1 parent 0d1bc8c commit a2483eb
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit a2483eb

Please sign in to comment.