Skip to content

Commit daa1ed1

Browse files
committed
NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added
1 parent 537c005 commit daa1ed1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

helpers.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,15 @@ func NewKeyboardButton(text string) KeyboardButton {
618618
}
619619
}
620620

621+
// NewKeyboardButtonWebApp creates a keyboard button with text
622+
// which goes to a WebApp.
623+
func NewKeyboardButtonWebApp(text string, webapp WebAppInfo) KeyboardButton {
624+
return KeyboardButton{
625+
Text: text,
626+
WebApp: &webapp,
627+
}
628+
}
629+
621630
// NewKeyboardButtonContact creates a keyboard button that requests
622631
// user contact information upon click.
623632
func NewKeyboardButtonContact(text string) KeyboardButton {
@@ -673,6 +682,15 @@ func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton {
673682
}
674683
}
675684

685+
// NewInlineKeyboardButtonWebApp creates an inline keyboard button with text
686+
// which goes to a WebApp.
687+
func NewInlineKeyboardButtonWebApp(text string, webapp WebAppInfo) InlineKeyboardButton {
688+
return InlineKeyboardButton{
689+
Text: text,
690+
WebApp: &webapp,
691+
}
692+
}
693+
676694
// NewInlineKeyboardButtonLoginURL creates an inline keyboard button with text
677695
// which goes to a LoginURL.
678696
func NewInlineKeyboardButtonLoginURL(text string, loginURL LoginURL) InlineKeyboardButton {

0 commit comments

Comments
 (0)