Skip to content

Commit a2483eb

Browse files
author
Syfaro
committed
Add helpers for callback queries.
1 parent 0d1bc8c commit a2483eb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

helpers.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,3 +537,22 @@ func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarku
537537
InlineKeyboard: keyboard,
538538
}
539539
}
540+
541+
// NewCallback creates a new callback message.
542+
func NewCallback(id, text string) CallbackConfig {
543+
return CallbackConfig{
544+
CallbackQueryID: id,
545+
Text: text,
546+
ShowAlert: false,
547+
}
548+
}
549+
550+
// NewCallbackWithAlert creates a new callback message that alerts
551+
// the user.
552+
func NewCallbackWithAlert(id, text string) CallbackConfig {
553+
return CallbackConfig{
554+
CallbackQueryID: id,
555+
Text: text,
556+
ShowAlert: true,
557+
}
558+
}

0 commit comments

Comments
 (0)