Merge pull request #554 from nickRiNi/master NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added
Syfaro syfaro@huefox.com
Wed, 19 Oct 2022 20:31:40 -0400
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, } }