From daa1ed199c5a3f6124aa023e9a006fa575befd64 Mon Sep 17 00:00:00 2001 From: n Date: Wed, 18 May 2022 17:45:52 +0300 Subject: [PATCH] NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added --- helpers.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/helpers.go b/helpers.go index 8220e74..096c4dc 100644 --- a/helpers.go +++ b/helpers.go @@ -618,6 +618,15 @@ func NewKeyboardButton(text string) KeyboardButton { } } +// NewKeyboardButtonWebApp creates a keyboard button with text +// which goes to a WebApp. +func NewKeyboardButtonWebApp(text string, webapp WebAppInfo) KeyboardButton { + return KeyboardButton{ + Text: text, + WebApp: &webapp, + } +} + // NewKeyboardButtonContact creates a keyboard button that requests // user contact information upon click. func NewKeyboardButtonContact(text string) KeyboardButton { @@ -673,6 +682,15 @@ func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton { } } +// NewInlineKeyboardButtonWebApp creates an inline keyboard button with text +// which goes to a WebApp. +func NewInlineKeyboardButtonWebApp(text string, webapp WebAppInfo) InlineKeyboardButton { + return InlineKeyboardButton{ + Text: text, + WebApp: &webapp, + } +} + // NewInlineKeyboardButtonLoginURL creates an inline keyboard button with text // which goes to a LoginURL. func NewInlineKeyboardButtonLoginURL(text string, loginURL LoginURL) InlineKeyboardButton {