NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added

bot-api-6.1
n 2022-05-18 17:45:52 +03:00
parent 537c005643
commit daa1ed199c
1 changed files with 18 additions and 0 deletions

View File

@ -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 {