From f4cbc2cd861cfc479477d649518455ed68dd850d Mon Sep 17 00:00:00 2001 From: Albert Khachatryan Date: Thu, 8 Aug 2024 20:43:52 +0300 Subject: [PATCH] Add access allowed field in message for Web App --- types.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/types.go b/types.go index 36c174b8..254bdc73 100644 --- a/types.go +++ b/types.go @@ -634,6 +634,12 @@ type Message struct { // // optional ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` + // WriteAccessAllowed the user allowed the bot to write messages after adding it + //to the attachment or side menu, launching a Web App from a link, + //or accepting an explicit request from a Web App sent by the method requestWriteAccess + // + // optional + WriteAccessAllowed *WriteAccessAllowed `json:"write_access_allowed,omitempty"` } // Time converts the message timestamp into a Time. @@ -814,6 +820,18 @@ func (e MessageEntity) IsTextLink() bool { return e.Type == "text_link" } +// WriteAccessAllowed this object represents a service message about a user allowing a +// bot to write messages after adding it to the attachment menu, launching a Web App from a link, +// or accepting an explicit request from a Web App sent by the method requestWriteAccess. +type WriteAccessAllowed struct { + // optional + FromRequest bool `json:"from_request,omitempty"` + // optional + WebAppName string `json:"web_app_name,omitempty"` + // optional + FromAttachmentMenu bool `json:"from_attachment_menu,omitempty"` +} + // PhotoSize represents one size of a photo or a file / sticker thumbnail. type PhotoSize struct { // FileID identifier for this file, which can be used to download or reuse