diff --git a/helpers.go b/helpers.go index 3a0e8187..a8ad392b 100644 --- a/helpers.go +++ b/helpers.go @@ -745,6 +745,15 @@ func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarku } } +// NewInlineKeyboardButtonCopyText creates an inline keyboard button with text +// that copies a verification code or other specified text to the clipboard. +func NewInlineKeyboardButtonCopyText(text string, copyText CopyTextButton) InlineKeyboardButton { + return InlineKeyboardButton{ + Text: text, + CopyText: ©Text, + } +} + // NewCallback creates a new callback message. func NewCallback(id, text string) CallbackConfig { return CallbackConfig{ diff --git a/types.go b/types.go index 36c174b8..50c01d23 100644 --- a/types.go +++ b/types.go @@ -1416,6 +1416,11 @@ type InlineKeyboardButton struct { // // optional SwitchInlineQueryCurrentChat *string `json:"switch_inline_query_current_chat,omitempty"` + // CopyText represents an inline keyboard button that copies a verification code + // or other specified text to the clipboard. + // + // optional + CopyText *CopyTextButton `json:"copy_text,omitempty"` // CallbackGame description of the game that will be launched when the user presses the button. // // optional @@ -2113,6 +2118,11 @@ type GameHighScore struct { // CallbackGame is for starting a game in an inline keyboard button. type CallbackGame struct{} +// CopyTextButton is for copy text in an inline keyboard button. +type CopyTextButton struct { + Text string `json:"text"` +} + // WebhookInfo is information about a currently set webhook. type WebhookInfo struct { // URL webhook URL, may be empty if webhook is not set up.