NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added
n git@rini.moscow
Wed, 18 May 2022 17:45:52 +0300
1 files changed,
18 insertions(+),
0 deletions(-)
jump to
M
helpers.go
→
helpers.go
@@ -618,6 +618,15 @@ Text: text,
} } +// 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 {@@ -670,6 +679,15 @@ func NewInlineKeyboardButtonData(text, data string) InlineKeyboardButton {
return InlineKeyboardButton{ Text: text, CallbackData: &data, + } +} + +// 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, } }