Merge pull request #554 from nickRiNi/master

NewInlineKeyboardButtonWebApp & NewKeyboardButtonWebApp added
bot-api-6.1
Syfaro 2022-10-19 20:31:40 -04:00 committed by GitHub
commit 00ae020205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {