diff --git a/client/function.go b/client/function.go index 27f7285..44e7348 100755 --- a/client/function.go +++ b/client/function.go @@ -2200,6 +2200,25 @@ func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { return UnmarshalChats(result.Data) } +// Returns a list of channel chats, which can be used as a personal chat +func (client *Client) GetSuitablePersonalChats() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSuitablePersonalChats", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type LoadSavedMessagesTopicsRequest struct { // The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached Limit int32 `json:"limit"` @@ -3133,6 +3152,56 @@ func (client *Client) ClickChatSponsoredMessage(req *ClickChatSponsoredMessageRe return UnmarshalOk(result.Data) } +type ReportChatSponsoredMessageRequest struct { + // Chat identifier of the sponsored message + ChatId int64 `json:"chat_id"` + // Identifier of the sponsored message + MessageId int64 `json:"message_id"` + // Option identifier chosen by the user; leave empty for the initial request + OptionId []byte `json:"option_id"` +} + +// Reports a sponsored message to Telegram moderators +func (client *Client) ReportChatSponsoredMessage(req *ReportChatSponsoredMessageRequest) (ReportChatSponsoredMessageResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportChatSponsoredMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "option_id": req.OptionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(result.Data) + + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(result.Data) + + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(result.Data) + + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(result.Data) + + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -4260,6 +4329,91 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState return UnmarshalOk(result.Data) } +type SendBusinessMessageRequest struct { + // Unique identifier of business connection on behalf of which to send the request + BusinessConnectionId string `json:"business_connection_id"` + // Target chat + ChatId int64 `json:"chat_id"` + // Information about the message to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` + // Pass true to disable notification for the message + DisableNotification bool `json:"disable_notification"` + // Pass true if the content of the message must be protected from forwarding and saving + ProtectContent bool `json:"protect_content"` + // Markup for replying to the message; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // The content of the message to be sent + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Sends a message on behalf of a business account; for bots only. Returns the message after it was sent +func (client *Client) SendBusinessMessage(req *SendBusinessMessageRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendBusinessMessage", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "reply_to": req.ReplyTo, + "disable_notification": req.DisableNotification, + "protect_content": req.ProtectContent, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type SendBusinessMessageAlbumRequest struct { + // Unique identifier of business connection on behalf of which to send the request + BusinessConnectionId string `json:"business_connection_id"` + // Target chat + ChatId int64 `json:"chat_id"` + // Information about the message to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` + // Pass true to disable notification for the message + DisableNotification bool `json:"disable_notification"` + // Pass true if the content of the message must be protected from forwarding and saving + ProtectContent bool `json:"protect_content"` + // Contents of messages to be sent. At most 10 messages can be added to an album + InputMessageContents []InputMessageContent `json:"input_message_contents"` +} + +// Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +func (client *Client) SendBusinessMessageAlbum(req *SendBusinessMessageAlbumRequest) (*BusinessMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendBusinessMessageAlbum", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "reply_to": req.ReplyTo, + "disable_notification": req.DisableNotification, + "protect_content": req.ProtectContent, + "input_message_contents": req.InputMessageContents, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessages(result.Data) +} + type CheckQuickReplyShortcutNameRequest struct { // The name of the shortcut; 1-32 characters Name string `json:"name"` @@ -5719,6 +5873,32 @@ func (client *Client) HideSuggestedAction(req *HideSuggestedActionRequest) (*Ok, return UnmarshalOk(result.Data) } +type GetBusinessConnectionRequest struct { + // Identifier of the business connection to return + ConnectionId string `json:"connection_id"` +} + +// Returns information about a business connection by its identifier; for bots only +func (client *Client) GetBusinessConnection(req *GetBusinessConnectionRequest) (*BusinessConnection, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessConnection", + }, + Data: map[string]interface{}{ + "connection_id": req.ConnectionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessConnection(result.Data) +} + type GetLoginUrlInfoRequest struct { // Chat identifier of the message with the button ChatId int64 `json:"chat_id"` @@ -6494,6 +6674,8 @@ type SendChatActionRequest struct { ChatId int64 `json:"chat_id"` // If not 0, the message thread identifier in which the action was performed MessageThreadId int64 `json:"message_thread_id"` + // Unique identifier of business connection on behalf of which to send the request; for bots only + BusinessConnectionId string `json:"business_connection_id"` // The action description; pass null to cancel the currently active action Action ChatAction `json:"action"` } @@ -6507,6 +6689,7 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, + "business_connection_id": req.BusinessConnectionId, "action": req.Action, }, }) @@ -9451,7 +9634,7 @@ type SendStoryRequest struct { Content InputStoryContent `json:"content"` // Clickable rectangle areas to be shown on the story media; pass null if none Areas *InputStoryAreas `json:"areas"` - // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters + // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") Caption *FormattedText `json:"caption"` // The privacy settings for the story; ignored for stories sent to supergroup and channel chats PrivacySettings StoryPrivacySettings `json:"privacy_settings"` @@ -13353,7 +13536,7 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques type GetArchivedStickerSetsRequest struct { // Type of the sticker sets to return StickerType StickerType `json:"sticker_type"` - // Identifier of the sticker set from which to return the result + // Identifier of the sticker set from which to return the result; use 0 to get results from the beginning OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` // The maximum number of sticker sets to return; up to 100 Limit int32 `json:"limit"` @@ -13673,7 +13856,7 @@ type AddRecentStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP format can be added to this list. Emoji stickers can't be added to recent stickers +// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -13774,7 +13957,7 @@ type AddFavoriteStickerRequest struct { Sticker InputFile `json:"sticker"` } -// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP format can be added to this list. Emoji stickers can't be added to favorite stickers +// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. Emoji stickers can't be added to favorite stickers func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14518,6 +14701,58 @@ func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) return UnmarshalOk(result.Data) } +type SetBirthdateRequest struct { + // The new value of the current user's birthdate; pass null to remove the birthdate + Birthdate *Birthdate `json:"birthdate"` +} + +// Changes the birthdate of the current user +func (client *Client) SetBirthdate(req *SetBirthdateRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBirthdate", + }, + Data: map[string]interface{}{ + "birthdate": req.Birthdate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetPersonalChatRequest struct { + // Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats + ChatId int64 `json:"chat_id"` +} + +// Changes the personal chat of the current user +func (client *Client) SetPersonalChat(req *SetPersonalChatRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setPersonalChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetEmojiStatusRequest struct { // New emoji status; pass null to switch to the default badge EmojiStatus *EmojiStatus `json:"emoji_status"` @@ -14597,7 +14832,7 @@ func (client *Client) SetBusinessLocation(req *SetBusinessLocationRequest) (*Ok, } type SetBusinessOpeningHoursRequest struct { - // The new opening hours of the business; pass null to remove the opening hours + // The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified OpeningHours *BusinessOpeningHours `json:"opening_hours"` } @@ -14674,6 +14909,32 @@ func (client *Client) SetBusinessAwayMessageSettings(req *SetBusinessAwayMessage return UnmarshalOk(result.Data) } +type SetBusinessIntroRequest struct { + // The new intro of the business; pass null to remove the intro + Intro *InputBusinessIntro `json:"intro"` +} + +// Changes the business intro of the current user. Requires Telegram Business subscription +func (client *Client) SetBusinessIntro(req *SetBusinessIntroRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessIntro", + }, + Data: map[string]interface{}{ + "intro": req.Intro, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ChangePhoneNumberRequest struct { // The new phone number of the user in international format PhoneNumber string `json:"phone_number"` @@ -17144,7 +17405,7 @@ type SetNewChatPrivacySettingsRequest struct { Settings *NewChatPrivacySettings `json:"settings"` } -// Changes privacy settings for new chat creation; for Telegram Premium users only +// Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings") func (client *Client) SetNewChatPrivacySettings(req *SetNewChatPrivacySettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18774,15 +19035,13 @@ type CreateNewStickerSetRequest struct { UserId int64 `json:"user_id"` // Sticker set title; 1-64 characters Title string `json:"title"` - // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters + // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 0-64 characters. If empty, then the name returned by getSuggestedStickerSetName will be used automatically Name string `json:"name"` - // Format of the stickers in the set - StickerFormat StickerFormat `json:"sticker_format"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` // Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only NeedsRepainting bool `json:"needs_repainting"` - // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown + // List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown Stickers []*InputSticker `json:"stickers"` // Source of the sticker set; may be empty if unknown Source string `json:"source"` @@ -18798,7 +19057,6 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti "user_id": req.UserId, "title": req.Title, "name": req.Name, - "sticker_format": req.StickerFormat, "sticker_type": req.StickerType, "needs_repainting": req.NeedsRepainting, "stickers": req.Stickers, @@ -18817,15 +19075,15 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti } type AddStickerToSetRequest struct { - // Sticker set owner + // Sticker set owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise Name string `json:"name"` // Sticker to add to the set Sticker *InputSticker `json:"sticker"` } -// Adds a new sticker to a set; for bots only +// Adds a new sticker to a set func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18848,16 +19106,53 @@ func (client *Client) AddStickerToSet(req *AddStickerToSetRequest) (*Ok, error) return UnmarshalOk(result.Data) } -type SetStickerSetThumbnailRequest struct { - // Sticker set owner +type ReplaceStickerInSetRequest struct { + // Sticker set owner; ignored for regular users UserId int64 `json:"user_id"` - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user Name string `json:"name"` - // Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set - Thumbnail InputFile `json:"thumbnail"` + // Sticker to remove from the set + OldSticker InputFile `json:"old_sticker"` + // Sticker to add to the set + NewSticker *InputSticker `json:"new_sticker"` } -// Sets a sticker set thumbnail; for bots only +// Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet +func (client *Client) ReplaceStickerInSet(req *ReplaceStickerInSetRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceStickerInSet", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "name": req.Name, + "old_sticker": req.OldSticker, + "new_sticker": req.NewSticker, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStickerSetThumbnailRequest struct { + // Sticker set owner; ignored for regular users + UserId int64 `json:"user_id"` + // Sticker set name. The sticker set must be owned by the current user + Name string `json:"name"` + // Thumbnail to set; pass null to remove the sticker set thumbnail + Thumbnail InputFile `json:"thumbnail"` + // Format of the thumbnail; pass null if thumbnail is removed + Format StickerFormat `json:"format"` +} + +// Sets a sticker set thumbnail func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18867,6 +19162,7 @@ func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) "user_id": req.UserId, "name": req.Name, "thumbnail": req.Thumbnail, + "format": req.Format, }, }) if err != nil { @@ -18881,13 +19177,13 @@ func (client *Client) SetStickerSetThumbnail(req *SetStickerSetThumbnailRequest) } type SetCustomEmojiStickerSetThumbnailRequest struct { - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user Name string `json:"name"` // Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail CustomEmojiId JsonInt64 `json:"custom_emoji_id"` } -// Sets a custom emoji sticker set thumbnail; for bots only +// Sets a custom emoji sticker set thumbnail func (client *Client) SetCustomEmojiStickerSetThumbnail(req *SetCustomEmojiStickerSetThumbnailRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18910,13 +19206,13 @@ func (client *Client) SetCustomEmojiStickerSetThumbnail(req *SetCustomEmojiStick } type SetStickerSetTitleRequest struct { - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user Name string `json:"name"` // New sticker set title Title string `json:"title"` } -// Sets a sticker set title; for bots only +// Sets a sticker set title func (client *Client) SetStickerSetTitle(req *SetStickerSetTitleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18939,11 +19235,11 @@ func (client *Client) SetStickerSetTitle(req *SetStickerSetTitleRequest) (*Ok, e } type DeleteStickerSetRequest struct { - // Sticker set name + // Sticker set name. The sticker set must be owned by the current user Name string `json:"name"` } -// Deleted a sticker set; for bots only +// Completely deletes a sticker set func (client *Client) DeleteStickerSet(req *DeleteStickerSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18971,7 +19267,7 @@ type SetStickerPositionInSetRequest struct { Position int32 `json:"position"` } -// Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot +// Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user func (client *Client) SetStickerPositionInSet(req *SetStickerPositionInSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -18994,11 +19290,11 @@ func (client *Client) SetStickerPositionInSet(req *SetStickerPositionInSetReques } type RemoveStickerFromSetRequest struct { - // Sticker + // Sticker to remove from the set Sticker InputFile `json:"sticker"` } -// Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot +// Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user func (client *Client) RemoveStickerFromSet(req *RemoveStickerFromSetRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19026,7 +19322,7 @@ type SetStickerEmojisRequest struct { Emojis string `json:"emojis"` } -// Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +// Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user func (client *Client) SetStickerEmojis(req *SetStickerEmojisRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19055,7 +19351,7 @@ type SetStickerKeywordsRequest struct { Keywords []string `json:"keywords"` } -// Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +// Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user func (client *Client) SetStickerKeywords(req *SetStickerKeywordsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19084,7 +19380,7 @@ type SetStickerMaskPositionRequest struct { MaskPosition *MaskPosition `json:"mask_position"` } -// Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot +// Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user func (client *Client) SetStickerMaskPosition(req *SetStickerMaskPositionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19106,6 +19402,35 @@ func (client *Client) SetStickerMaskPosition(req *SetStickerMaskPositionRequest) return UnmarshalOk(result.Data) } +type GetOwnedStickerSetsRequest struct { + // Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning + OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` + // The maximum number of sticker sets to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns sticker sets owned by the current user +func (client *Client) GetOwnedStickerSets(req *GetOwnedStickerSetsRequest) (*StickerSets, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getOwnedStickerSets", + }, + Data: map[string]interface{}{ + "offset_sticker_set_id": req.OffsetStickerSetId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickerSets(result.Data) +} + type GetMapThumbnailFileRequest struct { // Location of the map center Location *Location `json:"location"` @@ -19517,6 +19842,32 @@ func (client *Client) AssignGooglePlayTransaction(req *AssignGooglePlayTransacti return UnmarshalOk(result.Data) } +type GetBusinessFeaturesRequest struct { + // Source of the request; pass null if the method is called from settings or some non-standard source + Source BusinessFeature `json:"source"` +} + +// Returns information about features, available to Business users +func (client *Client) GetBusinessFeatures(req *GetBusinessFeaturesRequest) (*BusinessFeatures, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBusinessFeatures", + }, + Data: map[string]interface{}{ + "source": req.Source, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessFeatures(result.Data) +} + type AcceptTermsOfServiceRequest struct { // Terms of service identifier TermsOfServiceId string `json:"terms_of_service_id"` @@ -19765,6 +20116,32 @@ func GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInf func (client *Client) GetPhoneNumberInfoSync(req *GetPhoneNumberInfoSyncRequest) (*PhoneNumberInfo, error) { return GetPhoneNumberInfoSync(req)} +type GetCollectibleItemInfoRequest struct { + // Type of the collectible item. The item must be used by a user and must be visible to the current user + Type CollectibleItemType `json:"type"` +} + +// Returns information about a given collectible item that was purchased at https://fragment.com +func (client *Client) GetCollectibleItemInfo(req *GetCollectibleItemInfoRequest) (*CollectibleItemInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCollectibleItemInfo", + }, + Data: map[string]interface{}{ + "type": req.Type, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCollectibleItemInfo(result.Data) +} + type GetDeepLinkInfoRequest struct { // The link Link string `json:"link"` @@ -21064,12 +21441,27 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(result.Data) + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(result.Data) + case TypeUpdateAddChatMembersPrivacyForbidden: return UnmarshalUpdateAddChatMembersPrivacyForbidden(result.Data) case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(result.Data) + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(result.Data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(result.Data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(result.Data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(result.Data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(result.Data) diff --git a/client/type.go b/client/type.go index 036f037..1fe1ffd 100755 --- a/client/type.go +++ b/client/type.go @@ -38,6 +38,7 @@ const ( ClassInputMessageReplyTo = "InputMessageReplyTo" ClassMessageSource = "MessageSource" ClassMessageSponsorType = "MessageSponsorType" + ClassReportChatSponsoredMessageResult = "ReportChatSponsoredMessageResult" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassChatType = "ChatType" ClassChatList = "ChatList" @@ -54,6 +55,7 @@ const ( ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" ClassPageBlock = "PageBlock" + ClassCollectibleItemType = "CollectibleItemType" ClassInputCredentials = "InputCredentials" ClassPaymentProvider = "PaymentProvider" ClassInputInvoice = "InputInvoice" @@ -99,6 +101,7 @@ const ( ClassLanguagePackStringValue = "LanguagePackStringValue" ClassPremiumLimitType = "PremiumLimitType" ClassPremiumFeature = "PremiumFeature" + ClassBusinessFeature = "BusinessFeature" ClassPremiumStoryFeature = "PremiumStoryFeature" ClassPremiumSource = "PremiumSource" ClassStorePaymentPurpose = "StorePaymentPurpose" @@ -188,11 +191,15 @@ const ( ClassBotCommands = "BotCommands" ClassBotMenuButton = "BotMenuButton" ClassChatLocation = "ChatLocation" + ClassBirthdate = "Birthdate" + ClassCloseBirthdayUser = "CloseBirthdayUser" ClassBusinessLocation = "BusinessLocation" ClassBusinessRecipients = "BusinessRecipients" ClassBusinessAwayMessageSettings = "BusinessAwayMessageSettings" ClassBusinessGreetingMessageSettings = "BusinessGreetingMessageSettings" ClassBusinessConnectedBot = "BusinessConnectedBot" + ClassBusinessIntro = "BusinessIntro" + ClassInputBusinessIntro = "InputBusinessIntro" ClassBusinessOpeningHoursInterval = "BusinessOpeningHoursInterval" ClassBusinessOpeningHours = "BusinessOpeningHours" ClassBusinessInfo = "BusinessInfo" @@ -259,9 +266,12 @@ const ( ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" + ClassBusinessMessage = "BusinessMessage" + ClassBusinessMessages = "BusinessMessages" ClassMessageSponsor = "MessageSponsor" ClassSponsoredMessage = "SponsoredMessage" ClassSponsoredMessages = "SponsoredMessages" + ClassReportChatSponsoredMessageOption = "ReportChatSponsoredMessageOption" ClassFileDownload = "FileDownload" ClassDownloadedFileCounts = "DownloadedFileCounts" ClassFoundFileDownloads = "FoundFileDownloads" @@ -297,6 +307,8 @@ const ( ClassForumTopic = "ForumTopic" ClassForumTopics = "ForumTopics" ClassLinkPreviewOptions = "LinkPreviewOptions" + ClassSharedUser = "SharedUser" + ClassSharedChat = "SharedChat" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" @@ -306,6 +318,7 @@ const ( ClassCountryInfo = "CountryInfo" ClassCountries = "Countries" ClassPhoneNumberInfo = "PhoneNumberInfo" + ClassCollectibleItemInfo = "CollectibleItemInfo" ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" @@ -396,6 +409,7 @@ const ( ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" ClassImportedContacts = "ImportedContacts" + ClassBusinessConnection = "BusinessConnection" ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" ClassAttachmentMenuBot = "AttachmentMenuBot" ClassSentWebAppMessage = "SentWebAppMessage" @@ -416,7 +430,9 @@ const ( ClassLocalizationTargetInfo = "LocalizationTargetInfo" ClassPremiumLimit = "PremiumLimit" ClassPremiumFeatures = "PremiumFeatures" + ClassBusinessFeatures = "BusinessFeatures" ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" + ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation" ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" ClassThemeSettings = "ThemeSettings" @@ -589,6 +605,8 @@ const ( TypeBotCommands = "botCommands" TypeBotMenuButton = "botMenuButton" TypeChatLocation = "chatLocation" + TypeBirthdate = "birthdate" + TypeCloseBirthdayUser = "closeBirthdayUser" TypeBusinessAwayMessageScheduleAlways = "businessAwayMessageScheduleAlways" TypeBusinessAwayMessageScheduleOutsideOfOpeningHours = "businessAwayMessageScheduleOutsideOfOpeningHours" TypeBusinessAwayMessageScheduleCustom = "businessAwayMessageScheduleCustom" @@ -597,6 +615,8 @@ const ( TypeBusinessAwayMessageSettings = "businessAwayMessageSettings" TypeBusinessGreetingMessageSettings = "businessGreetingMessageSettings" TypeBusinessConnectedBot = "businessConnectedBot" + TypeBusinessIntro = "businessIntro" + TypeInputBusinessIntro = "inputBusinessIntro" TypeBusinessOpeningHoursInterval = "businessOpeningHoursInterval" TypeBusinessOpeningHours = "businessOpeningHours" TypeBusinessInfo = "businessInfo" @@ -722,6 +742,8 @@ const ( TypeMessagePositions = "messagePositions" TypeMessageCalendarDay = "messageCalendarDay" TypeMessageCalendar = "messageCalendar" + TypeBusinessMessage = "businessMessage" + TypeBusinessMessages = "businessMessages" TypeMessageSourceChatHistory = "messageSourceChatHistory" TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory" TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory" @@ -740,6 +762,12 @@ const ( TypeMessageSponsor = "messageSponsor" TypeSponsoredMessage = "sponsoredMessage" TypeSponsoredMessages = "sponsoredMessages" + TypeReportChatSponsoredMessageOption = "reportChatSponsoredMessageOption" + TypeReportChatSponsoredMessageResultOk = "reportChatSponsoredMessageResultOk" + TypeReportChatSponsoredMessageResultFailed = "reportChatSponsoredMessageResultFailed" + TypeReportChatSponsoredMessageResultOptionRequired = "reportChatSponsoredMessageResultOptionRequired" + TypeReportChatSponsoredMessageResultAdsHidden = "reportChatSponsoredMessageResultAdsHidden" + TypeReportChatSponsoredMessageResultPremiumRequired = "reportChatSponsoredMessageResultPremiumRequired" TypeFileDownload = "fileDownload" TypeDownloadedFileCounts = "downloadedFileCounts" TypeFoundFileDownloads = "foundFileDownloads" @@ -823,6 +851,8 @@ const ( TypeForumTopic = "forumTopic" TypeForumTopics = "forumTopics" TypeLinkPreviewOptions = "linkPreviewOptions" + TypeSharedUser = "sharedUser" + TypeSharedChat = "sharedChat" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -884,6 +914,9 @@ const ( TypeCountryInfo = "countryInfo" TypeCountries = "countries" TypePhoneNumberInfo = "phoneNumberInfo" + TypeCollectibleItemTypeUsername = "collectibleItemTypeUsername" + TypeCollectibleItemTypePhoneNumber = "collectibleItemTypePhoneNumber" + TypeCollectibleItemInfo = "collectibleItemInfo" TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" TypeBankCardInfo = "bankCardInfo" TypeAddress = "address" @@ -1258,6 +1291,7 @@ const ( TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" TypeSpeechRecognitionResultText = "speechRecognitionResultText" TypeSpeechRecognitionResultError = "speechRecognitionResultError" + TypeBusinessConnection = "businessConnection" TypeAttachmentMenuBotColor = "attachmentMenuBotColor" TypeAttachmentMenuBot = "attachmentMenuBot" TypeSentWebAppMessage = "sentWebAppMessage" @@ -1402,6 +1436,18 @@ const ( TypePremiumFeatureSavedMessagesTags = "premiumFeatureSavedMessagesTags" TypePremiumFeatureMessagePrivacy = "premiumFeatureMessagePrivacy" TypePremiumFeatureLastSeenTimes = "premiumFeatureLastSeenTimes" + TypePremiumFeatureBusiness = "premiumFeatureBusiness" + TypeBusinessFeatureLocation = "businessFeatureLocation" + TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" + TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" + TypeBusinessFeatureGreetingMessage = "businessFeatureGreetingMessage" + TypeBusinessFeatureAwayMessage = "businessFeatureAwayMessage" + TypeBusinessFeatureAccountLinks = "businessFeatureAccountLinks" + TypeBusinessFeatureIntro = "businessFeatureIntro" + TypeBusinessFeatureBots = "businessFeatureBots" + TypeBusinessFeatureEmojiStatus = "businessFeatureEmojiStatus" + TypeBusinessFeatureChatFolderTags = "businessFeatureChatFolderTags" + TypeBusinessFeatureUpgradedStories = "businessFeatureUpgradedStories" TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" @@ -1411,12 +1457,15 @@ const ( TypePremiumStoryFeatureVideoQuality = "premiumStoryFeatureVideoQuality" TypePremiumLimit = "premiumLimit" TypePremiumFeatures = "premiumFeatures" + TypeBusinessFeatures = "businessFeatures" TypePremiumSourceLimitExceeded = "premiumSourceLimitExceeded" TypePremiumSourceFeature = "premiumSourceFeature" + TypePremiumSourceBusinessFeature = "premiumSourceBusinessFeature" TypePremiumSourceStoryFeature = "premiumSourceStoryFeature" TypePremiumSourceLink = "premiumSourceLink" TypePremiumSourceSettings = "premiumSourceSettings" TypePremiumFeaturePromotionAnimation = "premiumFeaturePromotionAnimation" + TypeBusinessFeaturePromotionAnimation = "businessFeaturePromotionAnimation" TypePremiumState = "premiumState" TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" @@ -1540,6 +1589,7 @@ const ( TypeStoryPrivacySettingsSelectedUsers = "storyPrivacySettingsSelectedUsers" TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" + TypeUserPrivacySettingRuleAllowPremiumUsers = "userPrivacySettingRuleAllowPremiumUsers" TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" TypeUserPrivacySettingRuleAllowChatMembers = "userPrivacySettingRuleAllowChatMembers" TypeUserPrivacySettingRuleRestrictAll = "userPrivacySettingRuleRestrictAll" @@ -1552,6 +1602,7 @@ const ( TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" + TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -1720,6 +1771,7 @@ const ( TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium" TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium" TypeSuggestedActionGiftPremiumForChristmas = "suggestedActionGiftPremiumForChristmas" + TypeSuggestedActionSetBirthdate = "suggestedActionSetBirthdate" TypeCount = "count" TypeText = "text" TypeSeconds = "seconds" @@ -1876,8 +1928,13 @@ const ( TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" + TypeUpdateContactCloseBirthdays = "updateContactCloseBirthdays" TypeUpdateAddChatMembersPrivacyForbidden = "updateAddChatMembersPrivacyForbidden" TypeUpdateAutosaveSettings = "updateAutosaveSettings" + TypeUpdateBusinessConnection = "updateBusinessConnection" + TypeUpdateNewBusinessMessage = "updateNewBusinessMessage" + TypeUpdateBusinessMessageEdited = "updateBusinessMessageEdited" + TypeUpdateBusinessMessagesDeleted = "updateBusinessMessagesDeleted" TypeUpdateNewInlineQuery = "updateNewInlineQuery" TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" @@ -2064,6 +2121,11 @@ type MessageSponsorType interface { MessageSponsorTypeType() string } +// Describes result of sponsored message report +type ReportChatSponsoredMessageResult interface { + ReportChatSponsoredMessageResultType() string +} + // Describes the types of chats to which notification settings are relevant type NotificationSettingsScope interface { NotificationSettingsScopeType() string @@ -2144,6 +2206,11 @@ type PageBlock interface { PageBlockType() string } +// Describes a collectible item that can be purchased at https://fragment.com +type CollectibleItemType interface { + CollectibleItemTypeType() string +} + // Contains information about the payment method chosen by the user type InputCredentials interface { InputCredentialsType() string @@ -2369,6 +2436,11 @@ type PremiumFeature interface { PremiumFeatureType() string } +// Describes a feature available to Business user accounts +type BusinessFeature interface { + BusinessFeatureType() string +} + // Describes a story feature available to Premium users type PremiumStoryFeature interface { PremiumStoryFeatureType() string @@ -4006,7 +4078,7 @@ func (*ThumbnailFormatPng) ThumbnailFormatType() string { return TypeThumbnailFormatPng } -// The thumbnail is in TGS format. It will be used only for TGS sticker sets +// The thumbnail is in TGS format. It will be used only for sticker sets type ThumbnailFormatTgs struct{ meta } @@ -4031,7 +4103,7 @@ func (*ThumbnailFormatTgs) ThumbnailFormatType() string { return TypeThumbnailFormatTgs } -// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +// The thumbnail is in WEBM format. It will be used only for sticker sets type ThumbnailFormatWebm struct{ meta } @@ -4056,7 +4128,7 @@ func (*ThumbnailFormatWebm) ThumbnailFormatType() string { return TypeThumbnailFormatWebm } -// The thumbnail is in WEBP format. It will be used only for some stickers +// The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets type ThumbnailFormatWebp struct{ meta } @@ -5022,7 +5094,7 @@ func (voiceNote *VoiceNote) UnmarshalJSON(data []byte) error { // Describes an animated or custom representation of an emoji type AnimatedEmoji struct { meta - // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs + // Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format Sticker *Sticker `json:"sticker"` // Expected width of the sticker, which can be used if the sticker is null StickerWidth int32 `json:"sticker_width"` @@ -5522,6 +5594,8 @@ type UserTypeBot struct { InlineQueryPlaceholder string `json:"inline_query_placeholder"` // True, if the location of the user is expected to be sent with every inline query to this bot NeedLocation bool `json:"need_location"` + // True, if the bot supports connection to Telegram Business accounts + CanConnectToBusiness bool `json:"can_connect_to_business"` // True, if the bot can be added to attachment or side menu CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` } @@ -5671,6 +5745,58 @@ func (*ChatLocation) GetType() string { return TypeChatLocation } +// Represents a birthdate of a user +type Birthdate struct { + meta + // Day of the month; 1-31 + Day int32 `json:"day"` + // Month of the year; 1-12 + Month int32 `json:"month"` + // Birth year; 0 if unknown + Year int32 `json:"year"` +} + +func (entity *Birthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Birthdate + + return json.Marshal((*stub)(entity)) +} + +func (*Birthdate) GetClass() string { + return ClassBirthdate +} + +func (*Birthdate) GetType() string { + return TypeBirthdate +} + +// Describes a user that had or will have a birthday soon +type CloseBirthdayUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // Birthdate of the user + Birthdate *Birthdate `json:"birthdate"` +} + +func (entity *CloseBirthdayUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CloseBirthdayUser + + return json.Marshal((*stub)(entity)) +} + +func (*CloseBirthdayUser) GetClass() string { + return ClassCloseBirthdayUser +} + +func (*CloseBirthdayUser) GetType() string { + return TypeCloseBirthdayUser +} + // Send away messages always type BusinessAwayMessageScheduleAlways struct{ meta @@ -5780,6 +5906,8 @@ type BusinessRecipients struct { meta // Identifiers of selected private chats ChatIds []int64 `json:"chat_ids"` + // Identifiers of private chats that are always excluded; for businessConnectedBot only + ExcludedChatIds []int64 `json:"excluded_chat_ids"` // True, if all existing private chats are selected SelectExistingChats bool `json:"select_existing_chats"` // True, if all new private chats are selected @@ -5914,6 +6042,81 @@ func (*BusinessConnectedBot) GetType() string { return TypeBusinessConnectedBot } +// Describes settings for a business account intro +type BusinessIntro struct { + meta + // Title text of the intro + Title string `json:"title"` + // Message text of the intro + Message string `json:"message"` + // Greeting sticker of the intro; may be null if none + Sticker *Sticker `json:"sticker"` +} + +func (entity *BusinessIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessIntro + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessIntro) GetClass() string { + return ClassBusinessIntro +} + +func (*BusinessIntro) GetType() string { + return TypeBusinessIntro +} + +// Describes settings for a business account intro to set +type InputBusinessIntro struct { + meta + // Title text of the intro; 0-getOption("business_intro_title_length_max") characters + Title string `json:"title"` + // Message text of the intro; 0-getOption("business_intro_message_length_max") characters + Message string `json:"message"` + // Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji + Sticker InputFile `json:"sticker"` +} + +func (entity *InputBusinessIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBusinessIntro + + return json.Marshal((*stub)(entity)) +} + +func (*InputBusinessIntro) GetClass() string { + return ClassInputBusinessIntro +} + +func (*InputBusinessIntro) GetType() string { + return TypeInputBusinessIntro +} + +func (inputBusinessIntro *InputBusinessIntro) UnmarshalJSON(data []byte) error { + var tmp struct { + Title string `json:"title"` + Message string `json:"message"` + Sticker json.RawMessage `json:"sticker"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputBusinessIntro.Title = tmp.Title + inputBusinessIntro.Message = tmp.Message + + fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) + inputBusinessIntro.Sticker = fieldSticker + + return nil +} + // Describes an interval of time when the business is open type BusinessOpeningHoursInterval struct { meta @@ -5975,6 +6178,8 @@ type BusinessInfo struct { GreetingMessageSettings *BusinessGreetingMessageSettings `json:"greeting_message_settings"` // The away message; may be null if none or the Business account is not of the current user AwayMessageSettings *BusinessAwayMessageSettings `json:"away_message_settings"` + // Information about intro of the business; may be null if none + Intro *BusinessIntro `json:"intro"` } func (entity *BusinessInfo) MarshalJSON() ([]byte, error) { @@ -7005,7 +7210,7 @@ type Usernames struct { ActiveUsernames []string `json:"active_usernames"` // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive DisabledUsernames []string `json:"disabled_usernames"` - // The active username, which can be changed with setUsername or setSupergroupUsername + // The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo EditableUsername string `json:"editable_username"` } @@ -7298,6 +7503,10 @@ type UserFullInfo struct { SetChatBackground bool `json:"set_chat_background"` // A short user bio; may be null for bots Bio *FormattedText `json:"bio"` + // Birthdate of the user; may be null if unknown + Birthdate *Birthdate `json:"birthdate"` + // Identifier of the personal chat of the user; 0 if none + PersonalChatId int64 `json:"personal_chat_id"` // The list of available options for gifting Telegram Premium to the user PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` // Number of group chats where both the other user and the current user are a member; 0 for the current user @@ -7339,6 +7548,8 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` SetChatBackground bool `json:"set_chat_background"` Bio *FormattedText `json:"bio"` + Birthdate *Birthdate `json:"birthdate"` + PersonalChatId int64 `json:"personal_chat_id"` PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"` GroupInCommonCount int32 `json:"group_in_common_count"` BusinessInfo *BusinessInfo `json:"business_info"` @@ -7362,6 +7573,8 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException userFullInfo.SetChatBackground = tmp.SetChatBackground userFullInfo.Bio = tmp.Bio + userFullInfo.Birthdate = tmp.Birthdate + userFullInfo.PersonalChatId = tmp.PersonalChatId userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount userFullInfo.BusinessInfo = tmp.BusinessInfo @@ -10090,6 +10303,8 @@ type Message struct { IsOutgoing bool `json:"is_outgoing"` // True, if the message is pinned IsPinned bool `json:"is_pinned"` + // True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message + IsFromOffline bool `json:"is_from_offline"` // True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application CanBeEdited bool `json:"can_be_edited"` // True, if the message can be forwarded @@ -10148,8 +10363,10 @@ type Message struct { SelfDestructIn float64 `json:"self_destruct_in"` // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never AutoDeleteIn float64 `json:"auto_delete_in"` - // If non-zero, the user identifier of the bot through which this message was sent + // If non-zero, the user identifier of the inline bot through which this message was sent ViaBotUserId int64 `json:"via_bot_user_id"` + // If non-zero, the user identifier of the business bot that sent this message + SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"` // Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead SenderBoostCount int32 `json:"sender_boost_count"` // For channel posts and anonymous group messages, optional author signature @@ -10189,6 +10406,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { SchedulingState json.RawMessage `json:"scheduling_state"` IsOutgoing bool `json:"is_outgoing"` IsPinned bool `json:"is_pinned"` + IsFromOffline bool `json:"is_from_offline"` CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` @@ -10219,6 +10437,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { SelfDestructIn float64 `json:"self_destruct_in"` AutoDeleteIn float64 `json:"auto_delete_in"` ViaBotUserId int64 `json:"via_bot_user_id"` + SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"` SenderBoostCount int32 `json:"sender_boost_count"` AuthorSignature string `json:"author_signature"` MediaAlbumId JsonInt64 `json:"media_album_id"` @@ -10236,6 +10455,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.ChatId = tmp.ChatId message.IsOutgoing = tmp.IsOutgoing message.IsPinned = tmp.IsPinned + message.IsFromOffline = tmp.IsFromOffline message.CanBeEdited = tmp.CanBeEdited message.CanBeForwarded = tmp.CanBeForwarded message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat @@ -10264,6 +10484,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.SelfDestructIn = tmp.SelfDestructIn message.AutoDeleteIn = tmp.AutoDeleteIn message.ViaBotUserId = tmp.ViaBotUserId + message.SenderBusinessBotUserId = tmp.SenderBusinessBotUserId message.SenderBoostCount = tmp.SenderBoostCount message.AuthorSignature = tmp.AuthorSignature message.MediaAlbumId = tmp.MediaAlbumId @@ -10474,6 +10695,54 @@ func (*MessageCalendar) GetType() string { return TypeMessageCalendar } +// Describes a message from a business account as received by a bot +type BusinessMessage struct { + meta + // The message + Message *Message `json:"message"` + // Message that is replied by the message in the same chat; may be null if none + ReplyToMessage *Message `json:"reply_to_message"` +} + +func (entity *BusinessMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessMessage) GetClass() string { + return ClassBusinessMessage +} + +func (*BusinessMessage) GetType() string { + return TypeBusinessMessage +} + +// Contains a list of messages from a business account as received by a bot +type BusinessMessages struct { + meta + // List of business messages + Messages []*BusinessMessage `json:"messages"` +} + +func (entity *BusinessMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessMessages + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessMessages) GetClass() string { + return ClassBusinessMessages +} + +func (*BusinessMessages) GetType() string { + return TypeBusinessMessages +} + // The message is from a chat history type MessageSourceChatHistory struct{ meta @@ -10981,6 +11250,8 @@ type SponsoredMessage struct { MessageId int64 `json:"message_id"` // True, if the message needs to be labeled as "recommended" instead of "sponsored" IsRecommended bool `json:"is_recommended"` + // True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage + CanBeReported bool `json:"can_be_reported"` // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` // Information about the sponsor of the message @@ -11011,6 +11282,7 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { MessageId int64 `json:"message_id"` IsRecommended bool `json:"is_recommended"` + CanBeReported bool `json:"can_be_reported"` Content json.RawMessage `json:"content"` Sponsor *MessageSponsor `json:"sponsor"` ButtonText string `json:"button_text"` @@ -11024,6 +11296,7 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { sponsoredMessage.MessageId = tmp.MessageId sponsoredMessage.IsRecommended = tmp.IsRecommended + sponsoredMessage.CanBeReported = tmp.CanBeReported sponsoredMessage.Sponsor = tmp.Sponsor sponsoredMessage.ButtonText = tmp.ButtonText sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo @@ -11059,6 +11332,160 @@ func (*SponsoredMessages) GetType() string { return TypeSponsoredMessages } +// Describes an option to report a sponsored message +type ReportChatSponsoredMessageOption struct { + meta + // Unique identifier of the option + Id []byte `json:"id"` + // Text of the option + Text string `json:"text"` +} + +func (entity *ReportChatSponsoredMessageOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageOption + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageOption) GetClass() string { + return ClassReportChatSponsoredMessageOption +} + +func (*ReportChatSponsoredMessageOption) GetType() string { + return TypeReportChatSponsoredMessageOption +} + +// The message was reported successfully +type ReportChatSponsoredMessageResultOk struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultOk) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultOk) GetType() string { + return TypeReportChatSponsoredMessageResultOk +} + +func (*ReportChatSponsoredMessageResultOk) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultOk +} + +// The sponsored message is too old or not found +type ReportChatSponsoredMessageResultFailed struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultFailed + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultFailed) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultFailed) GetType() string { + return TypeReportChatSponsoredMessageResultFailed +} + +func (*ReportChatSponsoredMessageResultFailed) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultFailed +} + +// The user must choose an option to report the message and repeat request with the chosen option +type ReportChatSponsoredMessageResultOptionRequired struct { + meta + // Title for the option choice + Title string `json:"title"` + // List of available options + Options []*ReportChatSponsoredMessageOption `json:"options"` +} + +func (entity *ReportChatSponsoredMessageResultOptionRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultOptionRequired + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultOptionRequired) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultOptionRequired) GetType() string { + return TypeReportChatSponsoredMessageResultOptionRequired +} + +func (*ReportChatSponsoredMessageResultOptionRequired) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultOptionRequired +} + +// Sponsored messages were hidden for the user in all chats +type ReportChatSponsoredMessageResultAdsHidden struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultAdsHidden) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultAdsHidden + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultAdsHidden) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultAdsHidden) GetType() string { + return TypeReportChatSponsoredMessageResultAdsHidden +} + +func (*ReportChatSponsoredMessageResultAdsHidden) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultAdsHidden +} + +// The user asked to hide sponsored messages, but Telegram Premium is required for this +type ReportChatSponsoredMessageResultPremiumRequired struct{ + meta +} + +func (entity *ReportChatSponsoredMessageResultPremiumRequired) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ReportChatSponsoredMessageResultPremiumRequired + + return json.Marshal((*stub)(entity)) +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) GetClass() string { + return ClassReportChatSponsoredMessageResult +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) GetType() string { + return TypeReportChatSponsoredMessageResultPremiumRequired +} + +func (*ReportChatSponsoredMessageResultPremiumRequired) ReportChatSponsoredMessageResultType() string { + return TypeReportChatSponsoredMessageResultPremiumRequired +} + // Describes a file added to file download list type FileDownload struct { meta @@ -11503,7 +11930,7 @@ type ChatFolder struct { Title string `json:"title"` // The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder Icon *ChatFolderIcon `json:"icon"` - // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled + // The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription ColorId int32 `json:"color_id"` // True, if at least one link has been created for the folder IsShareable bool `json:"is_shareable"` @@ -12780,6 +13207,12 @@ type KeyboardButtonTypeRequestUsers struct { UserIsPremium bool `json:"user_is_premium"` // The maximum number of users to share MaxQuantity int32 `json:"max_quantity"` + // Pass true to request name of the users; bots only + RequestName bool `json:"request_name"` + // Pass true to request username of the users; bots only + RequestUsername bool `json:"request_username"` + // Pass true to request photo of the users; bots only + RequestPhoto bool `json:"request_photo"` } func (entity *KeyboardButtonTypeRequestUsers) MarshalJSON() ([]byte, error) { @@ -12825,6 +13258,12 @@ type KeyboardButtonTypeRequestChat struct { BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights"` // True, if the bot must be a member of the chat; for basic group and supergroup chats only BotIsMember bool `json:"bot_is_member"` + // Pass true to request title of the chat; bots only + RequestTitle bool `json:"request_title"` + // Pass true to request username of the chat; bots only + RequestUsername bool `json:"request_username"` + // Pass true to request photo of the chat; bots only + RequestPhoto bool `json:"request_photo"` } func (entity *KeyboardButtonTypeRequestChat) MarshalJSON() ([]byte, error) { @@ -13830,6 +14269,66 @@ func (*LinkPreviewOptions) GetType() string { return TypeLinkPreviewOptions } +// Contains information about a user shared with a bot +type SharedUser struct { + meta + // User identifier + UserId int64 `json:"user_id"` + // First name of the user; for bots only + FirstName string `json:"first_name"` + // Last name of the user; for bots only + LastName string `json:"last_name"` + // Username of the user; for bots only + Username string `json:"username"` + // Profile photo of the user; for bots only; may be null + Photo *Photo `json:"photo"` +} + +func (entity *SharedUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SharedUser + + return json.Marshal((*stub)(entity)) +} + +func (*SharedUser) GetClass() string { + return ClassSharedUser +} + +func (*SharedUser) GetType() string { + return TypeSharedUser +} + +// Contains information about a chat shared with a bot +type SharedChat struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // Title of the chat; for bots only + Title string `json:"title"` + // Username of the chat; for bots only + Username string `json:"username"` + // Photo of the chat; for bots only; may be null + Photo *Photo `json:"photo"` +} + +func (entity *SharedChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SharedChat + + return json.Marshal((*stub)(entity)) +} + +func (*SharedChat) GetClass() string { + return ClassSharedChat +} + +func (*SharedChat) GetType() string { + return TypeSharedChat +} + // A plain text type RichTextPlain struct { meta @@ -16287,7 +16786,7 @@ type PhoneNumberInfo struct { CountryCallingCode string `json:"country_calling_code"` // The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user FormattedPhoneNumber string `json:"formatted_phone_number"` - // True, if the phone number was bought on Fragment and isn't tied to a SIM card + // True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo IsAnonymous bool `json:"is_anonymous"` } @@ -16307,6 +16806,93 @@ func (*PhoneNumberInfo) GetType() string { return TypePhoneNumberInfo } +// A username +type CollectibleItemTypeUsername struct { + meta + // The username + Username string `json:"username"` +} + +func (entity *CollectibleItemTypeUsername) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemTypeUsername + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemTypeUsername) GetClass() string { + return ClassCollectibleItemType +} + +func (*CollectibleItemTypeUsername) GetType() string { + return TypeCollectibleItemTypeUsername +} + +func (*CollectibleItemTypeUsername) CollectibleItemTypeType() string { + return TypeCollectibleItemTypeUsername +} + +// A phone number +type CollectibleItemTypePhoneNumber struct { + meta + // The phone number + PhoneNumber string `json:"phone_number"` +} + +func (entity *CollectibleItemTypePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemTypePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemTypePhoneNumber) GetClass() string { + return ClassCollectibleItemType +} + +func (*CollectibleItemTypePhoneNumber) GetType() string { + return TypeCollectibleItemTypePhoneNumber +} + +func (*CollectibleItemTypePhoneNumber) CollectibleItemTypeType() string { + return TypeCollectibleItemTypePhoneNumber +} + +// Contains information about a collectible item and its last purchase +type CollectibleItemInfo struct { + meta + // Point in time (Unix timestamp) when the item was purchased + PurchaseDate int32 `json:"purchase_date"` + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the item + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Individual URL for the item on https://fragment.com + Url string `json:"url"` +} + +func (entity *CollectibleItemInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CollectibleItemInfo + + return json.Marshal((*stub)(entity)) +} + +func (*CollectibleItemInfo) GetClass() string { + return ClassCollectibleItemInfo +} + +func (*CollectibleItemInfo) GetType() string { + return TypeCollectibleItemInfo +} + // Describes an action associated with a bank card number type BankCardActionOpenUrl struct { meta @@ -17103,7 +17689,7 @@ type MessageExtendedMediaPreview struct { Width int32 `json:"width"` // Media height; 0 if unknown Height int32 `json:"height"` - // Media duration; 0 if unknown + // Media duration, in seconds; 0 if unknown Duration int32 `json:"duration"` // Media minithumbnail; may be null Minithumbnail *Minithumbnail `json:"minithumbnail"` @@ -17229,7 +17815,7 @@ type PremiumGiveawayParameters struct { OnlyNewMembers bool `json:"only_new_members"` // True, if the list of winners of the giveaway will be available to everyone HasPublicWinners bool `json:"has_public_winners"` - // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list + // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list CountryCodes []string `json:"country_codes"` // Additional description of the giveaway prize; 0-128 characters PrizeDescription string `json:"prize_description"` @@ -21313,8 +21899,8 @@ func (*MessageContactRegistered) MessageContentType() string { // The current user shared users, which were requested by the bot type MessageUsersShared struct { meta - // Identifier of the shared users - UserIds []int64 `json:"user_ids"` + // The shared users + Users []*SharedUser `json:"users"` // Identifier of the keyboard button with the request ButtonId int32 `json:"button_id"` } @@ -21342,8 +21928,8 @@ func (*MessageUsersShared) MessageContentType() string { // The current user shared a chat, which was requested by the bot type MessageChatShared struct { meta - // Identifier of the shared chat - ChatId int64 `json:"chat_id"` + // The shared chat + Chat *SharedChat `json:"chat"` // Identifier of the keyboard button with the request ButtonId int32 `json:"button_id"` } @@ -22842,7 +23428,7 @@ type InputMessageVideoNote struct { VideoNote InputFile `json:"video_note"` // Video thumbnail; may be null if empty; pass null to skip thumbnail uploading Thumbnail *InputThumbnail `json:"thumbnail"` - // Duration of the video, in seconds + // Duration of the video, in seconds; 0-60 Duration int32 `json:"duration"` // Video width and height; must be positive and not greater than 640 Length int32 `json:"length"` @@ -24401,14 +24987,14 @@ type StickerSet struct { Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + // True, if the sticker set is owned by the current user + IsOwned bool `json:"is_owned"` // True, if the sticker set has been installed by the current user IsInstalled bool `json:"is_installed"` // True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // Format of the stickers in the set - StickerFormat StickerFormat `json:"sticker_format"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only @@ -24446,10 +25032,10 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { Name string `json:"name"` Thumbnail *Thumbnail `json:"thumbnail"` ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsOwned bool `json:"is_owned"` IsInstalled bool `json:"is_installed"` IsArchived bool `json:"is_archived"` IsOfficial bool `json:"is_official"` - StickerFormat json.RawMessage `json:"sticker_format"` StickerType json.RawMessage `json:"sticker_type"` NeedsRepainting bool `json:"needs_repainting"` IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` @@ -24468,6 +25054,7 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { stickerSet.Name = tmp.Name stickerSet.Thumbnail = tmp.Thumbnail stickerSet.ThumbnailOutline = tmp.ThumbnailOutline + stickerSet.IsOwned = tmp.IsOwned stickerSet.IsInstalled = tmp.IsInstalled stickerSet.IsArchived = tmp.IsArchived stickerSet.IsOfficial = tmp.IsOfficial @@ -24477,9 +25064,6 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { stickerSet.Stickers = tmp.Stickers stickerSet.Emojis = tmp.Emojis - fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) - stickerSet.StickerFormat = fieldStickerFormat - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) stickerSet.StickerType = fieldStickerType @@ -24499,14 +25083,14 @@ type StickerSetInfo struct { Thumbnail *Thumbnail `json:"thumbnail"` // Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + // True, if the sticker set is owned by the current user + IsOwned bool `json:"is_owned"` // True, if the sticker set has been installed by the current user IsInstalled bool `json:"is_installed"` // True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously IsArchived bool `json:"is_archived"` // True, if the sticker set is official IsOfficial bool `json:"is_official"` - // Format of the stickers in the set - StickerFormat StickerFormat `json:"sticker_format"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only @@ -24544,10 +25128,10 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { Name string `json:"name"` Thumbnail *Thumbnail `json:"thumbnail"` ThumbnailOutline []*ClosedVectorPath `json:"thumbnail_outline"` + IsOwned bool `json:"is_owned"` IsInstalled bool `json:"is_installed"` IsArchived bool `json:"is_archived"` IsOfficial bool `json:"is_official"` - StickerFormat json.RawMessage `json:"sticker_format"` StickerType json.RawMessage `json:"sticker_type"` NeedsRepainting bool `json:"needs_repainting"` IsAllowedAsChatEmojiStatus bool `json:"is_allowed_as_chat_emoji_status"` @@ -24566,6 +25150,7 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { stickerSetInfo.Name = tmp.Name stickerSetInfo.Thumbnail = tmp.Thumbnail stickerSetInfo.ThumbnailOutline = tmp.ThumbnailOutline + stickerSetInfo.IsOwned = tmp.IsOwned stickerSetInfo.IsInstalled = tmp.IsInstalled stickerSetInfo.IsArchived = tmp.IsArchived stickerSetInfo.IsOfficial = tmp.IsOfficial @@ -24575,9 +25160,6 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { stickerSetInfo.Size = tmp.Size stickerSetInfo.Covers = tmp.Covers - fieldStickerFormat, _ := UnmarshalStickerFormat(tmp.StickerFormat) - stickerSetInfo.StickerFormat = fieldStickerFormat - fieldStickerType, _ := UnmarshalStickerType(tmp.StickerType) stickerSetInfo.StickerType = fieldStickerType @@ -28447,6 +29029,39 @@ func (*SpeechRecognitionResultError) SpeechRecognitionResultType() string { return TypeSpeechRecognitionResultError } +// Describes a connection of the bot with a business account +type BusinessConnection struct { + meta + // Unique identifier of the connection + Id string `json:"id"` + // Identifier of the business user that created the connection + UserId int64 `json:"user_id"` + // Chat identifier of the private chat with the user + UserChatId int64 `json:"user_chat_id"` + // Point in time (Unix timestamp) when the connection was established + Date int32 `json:"date"` + // True, if the bot can send messages to the connected user; false otherwise + CanReply bool `json:"can_reply"` + // True, if the connection is enabled; false otherwise + IsEnabled bool `json:"is_enabled"` +} + +func (entity *BusinessConnection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessConnection + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessConnection) GetClass() string { + return ClassBusinessConnection +} + +func (*BusinessConnection) GetType() string { + return TypeBusinessConnection +} + // Describes a color to highlight a bot added to attachment menu type AttachmentMenuBotColor struct { meta @@ -32905,7 +33520,7 @@ func (*PremiumFeatureProfileBadge) PremiumFeatureType() string { return TypePremiumFeatureProfileBadge } -// An emoji status shown along with the user's name +// The ability to show an emoji status along with the user's name type PremiumFeatureEmojiStatus struct{ meta } @@ -33205,6 +33820,306 @@ func (*PremiumFeatureLastSeenTimes) PremiumFeatureType() string { return TypePremiumFeatureLastSeenTimes } +// The ability to use Business features +type PremiumFeatureBusiness struct{ + meta +} + +func (entity *PremiumFeatureBusiness) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureBusiness + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureBusiness) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureBusiness) GetType() string { + return TypePremiumFeatureBusiness +} + +func (*PremiumFeatureBusiness) PremiumFeatureType() string { + return TypePremiumFeatureBusiness +} + +// The ability to set location +type BusinessFeatureLocation struct{ + meta +} + +func (entity *BusinessFeatureLocation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureLocation + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureLocation) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureLocation) GetType() string { + return TypeBusinessFeatureLocation +} + +func (*BusinessFeatureLocation) BusinessFeatureType() string { + return TypeBusinessFeatureLocation +} + +// The ability to set opening hours +type BusinessFeatureOpeningHours struct{ + meta +} + +func (entity *BusinessFeatureOpeningHours) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureOpeningHours + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureOpeningHours) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureOpeningHours) GetType() string { + return TypeBusinessFeatureOpeningHours +} + +func (*BusinessFeatureOpeningHours) BusinessFeatureType() string { + return TypeBusinessFeatureOpeningHours +} + +// The ability to use quick replies +type BusinessFeatureQuickReplies struct{ + meta +} + +func (entity *BusinessFeatureQuickReplies) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureQuickReplies + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureQuickReplies) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureQuickReplies) GetType() string { + return TypeBusinessFeatureQuickReplies +} + +func (*BusinessFeatureQuickReplies) BusinessFeatureType() string { + return TypeBusinessFeatureQuickReplies +} + +// The ability to set up a greeting message +type BusinessFeatureGreetingMessage struct{ + meta +} + +func (entity *BusinessFeatureGreetingMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureGreetingMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureGreetingMessage) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureGreetingMessage) GetType() string { + return TypeBusinessFeatureGreetingMessage +} + +func (*BusinessFeatureGreetingMessage) BusinessFeatureType() string { + return TypeBusinessFeatureGreetingMessage +} + +// The ability to set up an away message +type BusinessFeatureAwayMessage struct{ + meta +} + +func (entity *BusinessFeatureAwayMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureAwayMessage + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureAwayMessage) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureAwayMessage) GetType() string { + return TypeBusinessFeatureAwayMessage +} + +func (*BusinessFeatureAwayMessage) BusinessFeatureType() string { + return TypeBusinessFeatureAwayMessage +} + +// The ability to create links to the business account with predefined message text +type BusinessFeatureAccountLinks struct{ + meta +} + +func (entity *BusinessFeatureAccountLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureAccountLinks + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureAccountLinks) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureAccountLinks) GetType() string { + return TypeBusinessFeatureAccountLinks +} + +func (*BusinessFeatureAccountLinks) BusinessFeatureType() string { + return TypeBusinessFeatureAccountLinks +} + +// The ability to customize intro +type BusinessFeatureIntro struct{ + meta +} + +func (entity *BusinessFeatureIntro) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureIntro + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureIntro) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureIntro) GetType() string { + return TypeBusinessFeatureIntro +} + +func (*BusinessFeatureIntro) BusinessFeatureType() string { + return TypeBusinessFeatureIntro +} + +// The ability to connect a bot to the account +type BusinessFeatureBots struct{ + meta +} + +func (entity *BusinessFeatureBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureBots + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureBots) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureBots) GetType() string { + return TypeBusinessFeatureBots +} + +func (*BusinessFeatureBots) BusinessFeatureType() string { + return TypeBusinessFeatureBots +} + +// The ability to show an emoji status along with the business name +type BusinessFeatureEmojiStatus struct{ + meta +} + +func (entity *BusinessFeatureEmojiStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureEmojiStatus + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureEmojiStatus) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureEmojiStatus) GetType() string { + return TypeBusinessFeatureEmojiStatus +} + +func (*BusinessFeatureEmojiStatus) BusinessFeatureType() string { + return TypeBusinessFeatureEmojiStatus +} + +// The ability to display folder names for each chat in the chat list +type BusinessFeatureChatFolderTags struct{ + meta +} + +func (entity *BusinessFeatureChatFolderTags) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureChatFolderTags + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureChatFolderTags) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureChatFolderTags) GetType() string { + return TypeBusinessFeatureChatFolderTags +} + +func (*BusinessFeatureChatFolderTags) BusinessFeatureType() string { + return TypeBusinessFeatureChatFolderTags +} + +// Allowed to use many additional features for stories +type BusinessFeatureUpgradedStories struct{ + meta +} + +func (entity *BusinessFeatureUpgradedStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatureUpgradedStories + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatureUpgradedStories) GetClass() string { + return ClassBusinessFeature +} + +func (*BusinessFeatureUpgradedStories) GetType() string { + return TypeBusinessFeatureUpgradedStories +} + +func (*BusinessFeatureUpgradedStories) BusinessFeatureType() string { + return TypeBusinessFeatureUpgradedStories +} + // Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels type PremiumStoryFeaturePriorityOrder struct{ meta @@ -33478,6 +34393,45 @@ func (premiumFeatures *PremiumFeatures) UnmarshalJSON(data []byte) error { return nil } +// Contains information about features, available to Business user accounts +type BusinessFeatures struct { + meta + // The list of available business features + Features []BusinessFeature `json:"features"` +} + +func (entity *BusinessFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeatures) GetClass() string { + return ClassBusinessFeatures +} + +func (*BusinessFeatures) GetType() string { + return TypeBusinessFeatures +} + +func (businessFeatures *BusinessFeatures) UnmarshalJSON(data []byte) error { + var tmp struct { + Features []json.RawMessage `json:"features"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeatures, _ := UnmarshalListOfBusinessFeature(tmp.Features) + businessFeatures.Features = fieldFeatures + + return nil +} + // A limit was exceeded type PremiumSourceLimitExceeded struct { meta @@ -33564,6 +34518,49 @@ func (premiumSourceFeature *PremiumSourceFeature) UnmarshalJSON(data []byte) err return nil } +// A user tried to use a Business feature +type PremiumSourceBusinessFeature struct { + meta + // The used feature; pass null if none specific feature was used + Feature BusinessFeature `json:"feature"` +} + +func (entity *PremiumSourceBusinessFeature) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumSourceBusinessFeature + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumSourceBusinessFeature) GetClass() string { + return ClassPremiumSource +} + +func (*PremiumSourceBusinessFeature) GetType() string { + return TypePremiumSourceBusinessFeature +} + +func (*PremiumSourceBusinessFeature) PremiumSourceType() string { + return TypePremiumSourceBusinessFeature +} + +func (premiumSourceBusinessFeature *PremiumSourceBusinessFeature) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldFeature, _ := UnmarshalBusinessFeature(tmp.Feature) + premiumSourceBusinessFeature.Feature = fieldFeature + + return nil +} + // A user tried to use a Premium story feature type PremiumSourceStoryFeature struct { meta @@ -33703,6 +34700,50 @@ func (premiumFeaturePromotionAnimation *PremiumFeaturePromotionAnimation) Unmars return nil } +// Describes a promotion animation for a Business feature +type BusinessFeaturePromotionAnimation struct { + meta + // Business feature + Feature BusinessFeature `json:"feature"` + // Promotion animation for the feature + Animation *Animation `json:"animation"` +} + +func (entity *BusinessFeaturePromotionAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BusinessFeaturePromotionAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*BusinessFeaturePromotionAnimation) GetClass() string { + return ClassBusinessFeaturePromotionAnimation +} + +func (*BusinessFeaturePromotionAnimation) GetType() string { + return TypeBusinessFeaturePromotionAnimation +} + +func (businessFeaturePromotionAnimation *BusinessFeaturePromotionAnimation) UnmarshalJSON(data []byte) error { + var tmp struct { + Feature json.RawMessage `json:"feature"` + Animation *Animation `json:"animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + businessFeaturePromotionAnimation.Animation = tmp.Animation + + fieldFeature, _ := UnmarshalBusinessFeature(tmp.Feature) + businessFeaturePromotionAnimation.Feature = fieldFeature + + return nil +} + // Contains state of Telegram Premium subscription and promotion videos for Premium features type PremiumState struct { meta @@ -33712,6 +34753,8 @@ type PremiumState struct { PaymentOptions []*PremiumStatePaymentOption `json:"payment_options"` // The list of available promotion animations for Premium features Animations []*PremiumFeaturePromotionAnimation `json:"animations"` + // The list of available promotion animations for Business features + BusinessAnimations []*BusinessFeaturePromotionAnimation `json:"business_animations"` } func (entity *PremiumState) MarshalJSON() ([]byte, error) { @@ -35111,7 +36154,7 @@ func (*CheckChatUsernameResultUsernameOccupied) CheckChatUsernameResultType() st return TypeCheckChatUsernameResultUsernameOccupied } -// The username can be purchased at fragment.com +// The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo type CheckChatUsernameResultUsernamePurchasable struct{ meta } @@ -37278,6 +38321,31 @@ func (*UserPrivacySettingRuleAllowContacts) UserPrivacySettingRuleType() string return TypeUserPrivacySettingRuleAllowContacts } +// A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites +type UserPrivacySettingRuleAllowPremiumUsers struct{ + meta +} + +func (entity *UserPrivacySettingRuleAllowPremiumUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingRuleAllowPremiumUsers + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) GetClass() string { + return ClassUserPrivacySettingRule +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) GetType() string { + return TypeUserPrivacySettingRuleAllowPremiumUsers +} + +func (*UserPrivacySettingRuleAllowPremiumUsers) UserPrivacySettingRuleType() string { + return TypeUserPrivacySettingRuleAllowPremiumUsers +} + // A rule to allow certain specified users to do something type UserPrivacySettingRuleAllowUsers struct { meta @@ -37600,6 +38668,31 @@ func (*UserPrivacySettingShowBio) UserPrivacySettingType() string { return TypeUserPrivacySettingShowBio } +// A privacy setting for managing whether the user's birthdate is visible +type UserPrivacySettingShowBirthdate struct{ + meta +} + +func (entity *UserPrivacySettingShowBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowBirthdate) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowBirthdate) GetType() string { + return TypeUserPrivacySettingShowBirthdate +} + +func (*UserPrivacySettingShowBirthdate) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowBirthdate +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct{ meta @@ -39491,7 +40584,7 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { // The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it type InternalLinkTypePassportDataRequest struct { meta - // User identifier of the service's bot + // User identifier of the service's bot; the corresponding user may be unknown yet BotUserId int64 `json:"bot_user_id"` // Telegram Passport element types requested by the service Scope string `json:"scope"` @@ -42242,6 +43335,31 @@ func (*SuggestedActionGiftPremiumForChristmas) SuggestedActionType() string { return TypeSuggestedActionGiftPremiumForChristmas } +// Suggests the user to set birthdate +type SuggestedActionSetBirthdate struct{ + meta +} + +func (entity *SuggestedActionSetBirthdate) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSetBirthdate + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSetBirthdate) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSetBirthdate) GetType() string { + return TypeSuggestedActionSetBirthdate +} + +func (*SuggestedActionSetBirthdate) SuggestedActionType() string { + return TypeSuggestedActionSetBirthdate +} + // Contains a counter type Count struct { meta @@ -42586,6 +43704,8 @@ type InputSticker struct { meta // File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements Sticker InputFile `json:"sticker"` + // Format of the sticker + Format StickerFormat `json:"format"` // String with 1-20 emoji corresponding to the sticker Emojis string `json:"emojis"` // Position where the mask is placed; pass null if not specified @@ -42613,6 +43733,7 @@ func (*InputSticker) GetType() string { func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { var tmp struct { Sticker json.RawMessage `json:"sticker"` + Format json.RawMessage `json:"format"` Emojis string `json:"emojis"` MaskPosition *MaskPosition `json:"mask_position"` Keywords []string `json:"keywords"` @@ -42630,6 +43751,9 @@ func (inputSticker *InputSticker) UnmarshalJSON(data []byte) error { fieldSticker, _ := UnmarshalInputFile(tmp.Sticker) inputSticker.Sticker = fieldSticker + fieldFormat, _ := UnmarshalStickerFormat(tmp.Format) + inputSticker.Format = fieldFormat + return nil } @@ -47356,7 +48480,7 @@ func (*UpdateSavedMessagesTags) UpdateType() string { // The parameters of speech recognition without Telegram Premium subscription has changed type UpdateSpeechRecognitionTrial struct { meta - // The maximum allowed duration of media for speech recognition without Telegram Premium subscription + // The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds MaxMediaDuration int32 `json:"max_media_duration"` // The total number of allowed speech recognitions per week; 0 if none WeeklyCount int32 `json:"weekly_count"` @@ -47522,6 +48646,33 @@ func (updateSuggestedActions *UpdateSuggestedActions) UnmarshalJSON(data []byte) return nil } +// The list of contacts that had birthdays recently or will have birthday soon has changed +type UpdateContactCloseBirthdays struct { + meta + // List of contact users with close birthday + CloseBirthdayUsers []*CloseBirthdayUser `json:"close_birthday_users"` +} + +func (entity *UpdateContactCloseBirthdays) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateContactCloseBirthdays + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateContactCloseBirthdays) GetClass() string { + return ClassUpdate +} + +func (*UpdateContactCloseBirthdays) GetType() string { + return TypeUpdateContactCloseBirthdays +} + +func (*UpdateContactCloseBirthdays) UpdateType() string { + return TypeUpdateContactCloseBirthdays +} + // Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate type UpdateAddChatMembersPrivacyForbidden struct { meta @@ -47599,6 +48750,122 @@ func (updateAutosaveSettings *UpdateAutosaveSettings) UnmarshalJSON(data []byte) return nil } +// A business connection has changed; for bots only +type UpdateBusinessConnection struct { + meta + // New data about the connection + Connection *BusinessConnection `json:"connection"` +} + +func (entity *UpdateBusinessConnection) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessConnection + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessConnection) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessConnection) GetType() string { + return TypeUpdateBusinessConnection +} + +func (*UpdateBusinessConnection) UpdateType() string { + return TypeUpdateBusinessConnection +} + +// A new message was added to a business account; for bots only +type UpdateNewBusinessMessage struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // The new message + Message *BusinessMessage `json:"message"` +} + +func (entity *UpdateNewBusinessMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewBusinessMessage + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewBusinessMessage) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewBusinessMessage) GetType() string { + return TypeUpdateNewBusinessMessage +} + +func (*UpdateNewBusinessMessage) UpdateType() string { + return TypeUpdateNewBusinessMessage +} + +// A message in a business account was edited; for bots only +type UpdateBusinessMessageEdited struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // The edited message + Message *BusinessMessage `json:"message"` +} + +func (entity *UpdateBusinessMessageEdited) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessMessageEdited + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessMessageEdited) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessMessageEdited) GetType() string { + return TypeUpdateBusinessMessageEdited +} + +func (*UpdateBusinessMessageEdited) UpdateType() string { + return TypeUpdateBusinessMessageEdited +} + +// Messages in a business account were deleted; for bots only +type UpdateBusinessMessagesDeleted struct { + meta + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // Identifier of a chat in the business account in which messages were deleted + ChatId int64 `json:"chat_id"` + // Unique message identifiers of the deleted messages + MessageIds []int64 `json:"message_ids"` +} + +func (entity *UpdateBusinessMessagesDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateBusinessMessagesDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateBusinessMessagesDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateBusinessMessagesDeleted) GetType() string { + return TypeUpdateBusinessMessagesDeleted +} + +func (*UpdateBusinessMessagesDeleted) UpdateType() string { + return TypeUpdateBusinessMessagesDeleted +} + // A new incoming inline query; for bots only type UpdateNewInlineQuery struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 1e3daca..25f7d9f 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -1271,6 +1271,49 @@ func UnmarshalListOfMessageSponsorType(dataList []json.RawMessage) ([]MessageSpo return list, nil } +func UnmarshalReportChatSponsoredMessageResult(data json.RawMessage) (ReportChatSponsoredMessageResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(data) + + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(data) + + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) + + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) + + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfReportChatSponsoredMessageResult(dataList []json.RawMessage) ([]ReportChatSponsoredMessageResult, error) { + list := []ReportChatSponsoredMessageResult{} + + for _, data := range dataList { + entity, err := UnmarshalReportChatSponsoredMessageResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { var meta meta @@ -2019,6 +2062,40 @@ func UnmarshalListOfPageBlock(dataList []json.RawMessage) ([]PageBlock, error) { return list, nil } +func UnmarshalCollectibleItemType(data json.RawMessage) (CollectibleItemType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCollectibleItemTypeUsername: + return UnmarshalCollectibleItemTypeUsername(data) + + case TypeCollectibleItemTypePhoneNumber: + return UnmarshalCollectibleItemTypePhoneNumber(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCollectibleItemType(dataList []json.RawMessage) ([]CollectibleItemType, error) { + list := []CollectibleItemType{} + + for _, data := range dataList { + entity, err := UnmarshalCollectibleItemType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputCredentials(data json.RawMessage) (InputCredentials, error) { var meta meta @@ -4490,6 +4567,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureLastSeenTimes: return UnmarshalPremiumFeatureLastSeenTimes(data) + case TypePremiumFeatureBusiness: + return UnmarshalPremiumFeatureBusiness(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4509,6 +4589,67 @@ func UnmarshalListOfPremiumFeature(dataList []json.RawMessage) ([]PremiumFeature return list, nil } +func UnmarshalBusinessFeature(data json.RawMessage) (BusinessFeature, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBusinessFeatureLocation: + return UnmarshalBusinessFeatureLocation(data) + + case TypeBusinessFeatureOpeningHours: + return UnmarshalBusinessFeatureOpeningHours(data) + + case TypeBusinessFeatureQuickReplies: + return UnmarshalBusinessFeatureQuickReplies(data) + + case TypeBusinessFeatureGreetingMessage: + return UnmarshalBusinessFeatureGreetingMessage(data) + + case TypeBusinessFeatureAwayMessage: + return UnmarshalBusinessFeatureAwayMessage(data) + + case TypeBusinessFeatureAccountLinks: + return UnmarshalBusinessFeatureAccountLinks(data) + + case TypeBusinessFeatureIntro: + return UnmarshalBusinessFeatureIntro(data) + + case TypeBusinessFeatureBots: + return UnmarshalBusinessFeatureBots(data) + + case TypeBusinessFeatureEmojiStatus: + return UnmarshalBusinessFeatureEmojiStatus(data) + + case TypeBusinessFeatureChatFolderTags: + return UnmarshalBusinessFeatureChatFolderTags(data) + + case TypeBusinessFeatureUpgradedStories: + return UnmarshalBusinessFeatureUpgradedStories(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBusinessFeature(dataList []json.RawMessage) ([]BusinessFeature, error) { + list := []BusinessFeature{} + + for _, data := range dataList { + entity, err := UnmarshalBusinessFeature(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalPremiumStoryFeature(data json.RawMessage) (PremiumStoryFeature, error) { var meta meta @@ -4573,6 +4714,9 @@ func UnmarshalPremiumSource(data json.RawMessage) (PremiumSource, error) { case TypePremiumSourceFeature: return UnmarshalPremiumSourceFeature(data) + case TypePremiumSourceBusinessFeature: + return UnmarshalPremiumSourceBusinessFeature(data) + case TypePremiumSourceStoryFeature: return UnmarshalPremiumSourceStoryFeature(data) @@ -5447,6 +5591,9 @@ func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRu case TypeUserPrivacySettingRuleAllowContacts: return UnmarshalUserPrivacySettingRuleAllowContacts(data) + case TypeUserPrivacySettingRuleAllowPremiumUsers: + return UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data) + case TypeUserPrivacySettingRuleAllowUsers: return UnmarshalUserPrivacySettingRuleAllowUsers(data) @@ -5508,6 +5655,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowBio: return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingShowBirthdate: + return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -6317,6 +6467,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionGiftPremiumForChristmas: return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + case TypeSuggestedActionSetBirthdate: + return UnmarshalSuggestedActionSetBirthdate(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6958,12 +7111,27 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(data) + case TypeUpdateAddChatMembersPrivacyForbidden: return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(data) + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) @@ -7857,6 +8025,22 @@ func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { return &resp, err } +func UnmarshalBirthdate(data json.RawMessage) (*Birthdate, error) { + var resp Birthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCloseBirthdayUser(data json.RawMessage) (*CloseBirthdayUser, error) { + var resp CloseBirthdayUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessAwayMessageScheduleAlways(data json.RawMessage) (*BusinessAwayMessageScheduleAlways, error) { var resp BusinessAwayMessageScheduleAlways @@ -7921,6 +8105,22 @@ func UnmarshalBusinessConnectedBot(data json.RawMessage) (*BusinessConnectedBot, return &resp, err } +func UnmarshalBusinessIntro(data json.RawMessage) (*BusinessIntro, error) { + var resp BusinessIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputBusinessIntro(data json.RawMessage) (*InputBusinessIntro, error) { + var resp InputBusinessIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessOpeningHoursInterval(data json.RawMessage) (*BusinessOpeningHoursInterval, error) { var resp BusinessOpeningHoursInterval @@ -8921,6 +9121,22 @@ func UnmarshalMessageCalendar(data json.RawMessage) (*MessageCalendar, error) { return &resp, err } +func UnmarshalBusinessMessage(data json.RawMessage) (*BusinessMessage, error) { + var resp BusinessMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessMessages(data json.RawMessage) (*BusinessMessages, error) { + var resp BusinessMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSourceChatHistory(data json.RawMessage) (*MessageSourceChatHistory, error) { var resp MessageSourceChatHistory @@ -9065,6 +9281,54 @@ func UnmarshalSponsoredMessages(data json.RawMessage) (*SponsoredMessages, error return &resp, err } +func UnmarshalReportChatSponsoredMessageOption(data json.RawMessage) (*ReportChatSponsoredMessageOption, error) { + var resp ReportChatSponsoredMessageOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultOk(data json.RawMessage) (*ReportChatSponsoredMessageResultOk, error) { + var resp ReportChatSponsoredMessageResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultFailed(data json.RawMessage) (*ReportChatSponsoredMessageResultFailed, error) { + var resp ReportChatSponsoredMessageResultFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultOptionRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultOptionRequired, error) { + var resp ReportChatSponsoredMessageResultOptionRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultAdsHidden(data json.RawMessage) (*ReportChatSponsoredMessageResultAdsHidden, error) { + var resp ReportChatSponsoredMessageResultAdsHidden + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalReportChatSponsoredMessageResultPremiumRequired(data json.RawMessage) (*ReportChatSponsoredMessageResultPremiumRequired, error) { + var resp ReportChatSponsoredMessageResultPremiumRequired + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileDownload(data json.RawMessage) (*FileDownload, error) { var resp FileDownload @@ -9729,6 +9993,22 @@ func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, err return &resp, err } +func UnmarshalSharedUser(data json.RawMessage) (*SharedUser, error) { + var resp SharedUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSharedChat(data json.RawMessage) (*SharedChat, error) { + var resp SharedChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -10217,6 +10497,30 @@ func UnmarshalPhoneNumberInfo(data json.RawMessage) (*PhoneNumberInfo, error) { return &resp, err } +func UnmarshalCollectibleItemTypeUsername(data json.RawMessage) (*CollectibleItemTypeUsername, error) { + var resp CollectibleItemTypeUsername + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCollectibleItemTypePhoneNumber(data json.RawMessage) (*CollectibleItemTypePhoneNumber, error) { + var resp CollectibleItemTypePhoneNumber + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCollectibleItemInfo(data json.RawMessage) (*CollectibleItemInfo, error) { + var resp CollectibleItemInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBankCardActionOpenUrl(data json.RawMessage) (*BankCardActionOpenUrl, error) { var resp BankCardActionOpenUrl @@ -13209,6 +13513,14 @@ func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecogni return &resp, err } +func UnmarshalBusinessConnection(data json.RawMessage) (*BusinessConnection, error) { + var resp BusinessConnection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { var resp AttachmentMenuBotColor @@ -14361,6 +14673,102 @@ func UnmarshalPremiumFeatureLastSeenTimes(data json.RawMessage) (*PremiumFeature return &resp, err } +func UnmarshalPremiumFeatureBusiness(data json.RawMessage) (*PremiumFeatureBusiness, error) { + var resp PremiumFeatureBusiness + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { + var resp BusinessFeatureLocation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureOpeningHours(data json.RawMessage) (*BusinessFeatureOpeningHours, error) { + var resp BusinessFeatureOpeningHours + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureQuickReplies(data json.RawMessage) (*BusinessFeatureQuickReplies, error) { + var resp BusinessFeatureQuickReplies + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureGreetingMessage(data json.RawMessage) (*BusinessFeatureGreetingMessage, error) { + var resp BusinessFeatureGreetingMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureAwayMessage(data json.RawMessage) (*BusinessFeatureAwayMessage, error) { + var resp BusinessFeatureAwayMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureAccountLinks(data json.RawMessage) (*BusinessFeatureAccountLinks, error) { + var resp BusinessFeatureAccountLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureIntro(data json.RawMessage) (*BusinessFeatureIntro, error) { + var resp BusinessFeatureIntro + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureBots(data json.RawMessage) (*BusinessFeatureBots, error) { + var resp BusinessFeatureBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureEmojiStatus(data json.RawMessage) (*BusinessFeatureEmojiStatus, error) { + var resp BusinessFeatureEmojiStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureChatFolderTags(data json.RawMessage) (*BusinessFeatureChatFolderTags, error) { + var resp BusinessFeatureChatFolderTags + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBusinessFeatureUpgradedStories(data json.RawMessage) (*BusinessFeatureUpgradedStories, error) { + var resp BusinessFeatureUpgradedStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { var resp PremiumStoryFeaturePriorityOrder @@ -14433,6 +14841,14 @@ func UnmarshalPremiumFeatures(data json.RawMessage) (*PremiumFeatures, error) { return &resp, err } +func UnmarshalBusinessFeatures(data json.RawMessage) (*BusinessFeatures, error) { + var resp BusinessFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumSourceLimitExceeded(data json.RawMessage) (*PremiumSourceLimitExceeded, error) { var resp PremiumSourceLimitExceeded @@ -14449,6 +14865,14 @@ func UnmarshalPremiumSourceFeature(data json.RawMessage) (*PremiumSourceFeature, return &resp, err } +func UnmarshalPremiumSourceBusinessFeature(data json.RawMessage) (*PremiumSourceBusinessFeature, error) { + var resp PremiumSourceBusinessFeature + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumSourceStoryFeature(data json.RawMessage) (*PremiumSourceStoryFeature, error) { var resp PremiumSourceStoryFeature @@ -14481,6 +14905,14 @@ func UnmarshalPremiumFeaturePromotionAnimation(data json.RawMessage) (*PremiumFe return &resp, err } +func UnmarshalBusinessFeaturePromotionAnimation(data json.RawMessage) (*BusinessFeaturePromotionAnimation, error) { + var resp BusinessFeaturePromotionAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) { var resp PremiumState @@ -15465,6 +15897,14 @@ func UnmarshalUserPrivacySettingRuleAllowContacts(data json.RawMessage) (*UserPr return &resp, err } +func UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data json.RawMessage) (*UserPrivacySettingRuleAllowPremiumUsers, error) { + var resp UserPrivacySettingRuleAllowPremiumUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingRuleAllowUsers(data json.RawMessage) (*UserPrivacySettingRuleAllowUsers, error) { var resp UserPrivacySettingRuleAllowUsers @@ -15561,6 +16001,14 @@ func UnmarshalUserPrivacySettingShowBio(data json.RawMessage) (*UserPrivacySetti return &resp, err } +func UnmarshalUserPrivacySettingShowBirthdate(data json.RawMessage) (*UserPrivacySettingShowBirthdate, error) { + var resp UserPrivacySettingShowBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -16905,6 +17353,14 @@ func UnmarshalSuggestedActionGiftPremiumForChristmas(data json.RawMessage) (*Sug return &resp, err } +func UnmarshalSuggestedActionSetBirthdate(data json.RawMessage) (*SuggestedActionSetBirthdate, error) { + var resp SuggestedActionSetBirthdate + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -18153,6 +18609,14 @@ func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActi return &resp, err } +func UnmarshalUpdateContactCloseBirthdays(data json.RawMessage) (*UpdateContactCloseBirthdays, error) { + var resp UpdateContactCloseBirthdays + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAddChatMembersPrivacyForbidden(data json.RawMessage) (*UpdateAddChatMembersPrivacyForbidden, error) { var resp UpdateAddChatMembersPrivacyForbidden @@ -18169,6 +18633,38 @@ func UnmarshalUpdateAutosaveSettings(data json.RawMessage) (*UpdateAutosaveSetti return &resp, err } +func UnmarshalUpdateBusinessConnection(data json.RawMessage) (*UpdateBusinessConnection, error) { + var resp UpdateBusinessConnection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewBusinessMessage(data json.RawMessage) (*UpdateNewBusinessMessage, error) { + var resp UpdateNewBusinessMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateBusinessMessageEdited(data json.RawMessage) (*UpdateBusinessMessageEdited, error) { + var resp UpdateBusinessMessageEdited + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateBusinessMessagesDeleted(data json.RawMessage) (*UpdateBusinessMessagesDeleted, error) { + var resp UpdateBusinessMessagesDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewInlineQuery(data json.RawMessage) (*UpdateNewInlineQuery, error) { var resp UpdateNewInlineQuery @@ -18707,6 +19203,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatLocation: return UnmarshalChatLocation(data) + case TypeBirthdate: + return UnmarshalBirthdate(data) + + case TypeCloseBirthdayUser: + return UnmarshalCloseBirthdayUser(data) + case TypeBusinessAwayMessageScheduleAlways: return UnmarshalBusinessAwayMessageScheduleAlways(data) @@ -18731,6 +19233,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBusinessConnectedBot: return UnmarshalBusinessConnectedBot(data) + case TypeBusinessIntro: + return UnmarshalBusinessIntro(data) + + case TypeInputBusinessIntro: + return UnmarshalInputBusinessIntro(data) + case TypeBusinessOpeningHoursInterval: return UnmarshalBusinessOpeningHoursInterval(data) @@ -19106,6 +19614,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageCalendar: return UnmarshalMessageCalendar(data) + case TypeBusinessMessage: + return UnmarshalBusinessMessage(data) + + case TypeBusinessMessages: + return UnmarshalBusinessMessages(data) + case TypeMessageSourceChatHistory: return UnmarshalMessageSourceChatHistory(data) @@ -19160,6 +19674,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSponsoredMessages: return UnmarshalSponsoredMessages(data) + case TypeReportChatSponsoredMessageOption: + return UnmarshalReportChatSponsoredMessageOption(data) + + case TypeReportChatSponsoredMessageResultOk: + return UnmarshalReportChatSponsoredMessageResultOk(data) + + case TypeReportChatSponsoredMessageResultFailed: + return UnmarshalReportChatSponsoredMessageResultFailed(data) + + case TypeReportChatSponsoredMessageResultOptionRequired: + return UnmarshalReportChatSponsoredMessageResultOptionRequired(data) + + case TypeReportChatSponsoredMessageResultAdsHidden: + return UnmarshalReportChatSponsoredMessageResultAdsHidden(data) + + case TypeReportChatSponsoredMessageResultPremiumRequired: + return UnmarshalReportChatSponsoredMessageResultPremiumRequired(data) + case TypeFileDownload: return UnmarshalFileDownload(data) @@ -19409,6 +19941,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewOptions: return UnmarshalLinkPreviewOptions(data) + case TypeSharedUser: + return UnmarshalSharedUser(data) + + case TypeSharedChat: + return UnmarshalSharedChat(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -19592,6 +20130,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePhoneNumberInfo: return UnmarshalPhoneNumberInfo(data) + case TypeCollectibleItemTypeUsername: + return UnmarshalCollectibleItemTypeUsername(data) + + case TypeCollectibleItemTypePhoneNumber: + return UnmarshalCollectibleItemTypePhoneNumber(data) + + case TypeCollectibleItemInfo: + return UnmarshalCollectibleItemInfo(data) + case TypeBankCardActionOpenUrl: return UnmarshalBankCardActionOpenUrl(data) @@ -20714,6 +21261,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSpeechRecognitionResultError: return UnmarshalSpeechRecognitionResultError(data) + case TypeBusinessConnection: + return UnmarshalBusinessConnection(data) + case TypeAttachmentMenuBotColor: return UnmarshalAttachmentMenuBotColor(data) @@ -21146,6 +21696,42 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureLastSeenTimes: return UnmarshalPremiumFeatureLastSeenTimes(data) + case TypePremiumFeatureBusiness: + return UnmarshalPremiumFeatureBusiness(data) + + case TypeBusinessFeatureLocation: + return UnmarshalBusinessFeatureLocation(data) + + case TypeBusinessFeatureOpeningHours: + return UnmarshalBusinessFeatureOpeningHours(data) + + case TypeBusinessFeatureQuickReplies: + return UnmarshalBusinessFeatureQuickReplies(data) + + case TypeBusinessFeatureGreetingMessage: + return UnmarshalBusinessFeatureGreetingMessage(data) + + case TypeBusinessFeatureAwayMessage: + return UnmarshalBusinessFeatureAwayMessage(data) + + case TypeBusinessFeatureAccountLinks: + return UnmarshalBusinessFeatureAccountLinks(data) + + case TypeBusinessFeatureIntro: + return UnmarshalBusinessFeatureIntro(data) + + case TypeBusinessFeatureBots: + return UnmarshalBusinessFeatureBots(data) + + case TypeBusinessFeatureEmojiStatus: + return UnmarshalBusinessFeatureEmojiStatus(data) + + case TypeBusinessFeatureChatFolderTags: + return UnmarshalBusinessFeatureChatFolderTags(data) + + case TypeBusinessFeatureUpgradedStories: + return UnmarshalBusinessFeatureUpgradedStories(data) + case TypePremiumStoryFeaturePriorityOrder: return UnmarshalPremiumStoryFeaturePriorityOrder(data) @@ -21173,12 +21759,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatures: return UnmarshalPremiumFeatures(data) + case TypeBusinessFeatures: + return UnmarshalBusinessFeatures(data) + case TypePremiumSourceLimitExceeded: return UnmarshalPremiumSourceLimitExceeded(data) case TypePremiumSourceFeature: return UnmarshalPremiumSourceFeature(data) + case TypePremiumSourceBusinessFeature: + return UnmarshalPremiumSourceBusinessFeature(data) + case TypePremiumSourceStoryFeature: return UnmarshalPremiumSourceStoryFeature(data) @@ -21191,6 +21783,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeaturePromotionAnimation: return UnmarshalPremiumFeaturePromotionAnimation(data) + case TypeBusinessFeaturePromotionAnimation: + return UnmarshalBusinessFeaturePromotionAnimation(data) + case TypePremiumState: return UnmarshalPremiumState(data) @@ -21560,6 +22155,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingRuleAllowContacts: return UnmarshalUserPrivacySettingRuleAllowContacts(data) + case TypeUserPrivacySettingRuleAllowPremiumUsers: + return UnmarshalUserPrivacySettingRuleAllowPremiumUsers(data) + case TypeUserPrivacySettingRuleAllowUsers: return UnmarshalUserPrivacySettingRuleAllowUsers(data) @@ -21596,6 +22194,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowBio: return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingShowBirthdate: + return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -22100,6 +22701,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionGiftPremiumForChristmas: return UnmarshalSuggestedActionGiftPremiumForChristmas(data) + case TypeSuggestedActionSetBirthdate: + return UnmarshalSuggestedActionSetBirthdate(data) + case TypeCount: return UnmarshalCount(data) @@ -22568,12 +23172,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) + case TypeUpdateContactCloseBirthdays: + return UnmarshalUpdateContactCloseBirthdays(data) + case TypeUpdateAddChatMembersPrivacyForbidden: return UnmarshalUpdateAddChatMembersPrivacyForbidden(data) case TypeUpdateAutosaveSettings: return UnmarshalUpdateAutosaveSettings(data) + case TypeUpdateBusinessConnection: + return UnmarshalUpdateBusinessConnection(data) + + case TypeUpdateNewBusinessMessage: + return UnmarshalUpdateNewBusinessMessage(data) + + case TypeUpdateBusinessMessageEdited: + return UnmarshalUpdateBusinessMessageEdited(data) + + case TypeUpdateBusinessMessagesDeleted: + return UnmarshalUpdateBusinessMessagesDeleted(data) + case TypeUpdateNewInlineQuery: return UnmarshalUpdateNewInlineQuery(data) diff --git a/data/td_api.tl b/data/td_api.tl index bdeba25..7cc4ddc 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -260,13 +260,13 @@ thumbnailFormatMpeg4 = ThumbnailFormat; //@description The thumbnail is in PNG format. It will be used only for background patterns thumbnailFormatPng = ThumbnailFormat; -//@description The thumbnail is in TGS format. It will be used only for TGS sticker sets +//@description The thumbnail is in TGS format. It will be used only for sticker sets thumbnailFormatTgs = ThumbnailFormat; -//@description The thumbnail is in WEBM format. It will be used only for WEBM sticker sets +//@description The thumbnail is in WEBM format. It will be used only for sticker sets thumbnailFormatWebm = ThumbnailFormat; -//@description The thumbnail is in WEBP format. It will be used only for some stickers +//@description The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets thumbnailFormatWebp = ThumbnailFormat; @@ -445,7 +445,7 @@ videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote; //@description Describes an animated or custom representation of an emoji -//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs +//@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format //@sticker_width Expected width of the sticker, which can be used if the sticker is null //@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none @@ -556,8 +556,9 @@ userTypeDeleted = UserType; //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot +//@can_connect_to_business True, if the bot supports connection to Telegram Business accounts //@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -577,6 +578,13 @@ botMenuButton text:string url:string = BotMenuButton; chatLocation location:location address:string = ChatLocation; +//@description Represents a birthdate of a user @day Day of the month; 1-31 @month Month of the year; 1-12 @year Birth year; 0 if unknown +birthdate day:int32 month:int32 year:int32 = Birthdate; + +//@description Describes a user that had or will have a birthday soon @user_id User identifier @birthdate Birthdate of the user +closeBirthdayUser user_id:int53 birthdate:birthdate = CloseBirthdayUser; + + //@class BusinessAwayMessageSchedule @description Describes conditions for sending of away messages by a Telegram Business account //@description Send away messages always @@ -596,12 +604,13 @@ businessLocation location:location address:string = BusinessLocation; //@description Describes private chats chosen for automatic interaction with a business //@chat_ids Identifiers of selected private chats +//@excluded_chat_ids Identifiers of private chats that are always excluded; for businessConnectedBot only //@select_existing_chats True, if all existing private chats are selected //@select_new_chats True, if all new private chats are selected //@select_contacts True, if all private chats with contacts are selected //@select_non_contacts True, if all private chats with non-contacts are selected //@exclude_selected If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen -businessRecipients chat_ids:vector select_existing_chats:Bool select_new_chats:Bool select_contacts:Bool select_non_contacts:Bool exclude_selected:Bool = BusinessRecipients; +businessRecipients chat_ids:vector excluded_chat_ids:vector select_existing_chats:Bool select_new_chats:Bool select_contacts:Bool select_non_contacts:Bool exclude_selected:Bool = BusinessRecipients; //@description Describes settings for messages that are automatically sent by a Telegram Business account when it is away //@shortcut_id Unique quick reply shortcut identifier for the away messages @@ -622,6 +631,18 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@can_reply True, if the bot can send messages to the private chats; false otherwise businessConnectedBot bot_user_id:int53 recipients:businessRecipients can_reply:Bool = BusinessConnectedBot; +//@description Describes settings for a business account intro +//@title Title text of the intro +//@message Message text of the intro +//@sticker Greeting sticker of the intro; may be null if none +businessIntro title:string message:string sticker:sticker = BusinessIntro; + +//@description Describes settings for a business account intro to set +//@title Title text of the intro; 0-getOption("business_intro_title_length_max") characters +//@message Message text of the intro; 0-getOption("business_intro_message_length_max") characters +//@sticker Greeting sticker of the intro; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji +inputBusinessIntro title:string message:string sticker:InputFile = InputBusinessIntro; + //@description Describes an interval of time when the business is open //@start_minute The first minute of the interval since start of the week; 0-7*24*60 //@end_minute The first minute after the end of the interval since start of the week; 1-8*24*60 @@ -635,7 +656,8 @@ businessOpeningHours time_zone_id:string opening_hours:vector = EmojiStatuses; //@description Describes usernames assigned to a user, a supergroup, or a channel //@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames //@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive -//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername +//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; @@ -911,11 +933,13 @@ botInfo short_description:string description:string photo:photo animation:animat //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@set_chat_background True, if the user set chat background for both chat users and it wasn't reverted yet //@bio A short user bio; may be null for bots +//@birthdate Birthdate of the user; may be null if unknown +//@personal_chat_id Identifier of the personal chat of the user; 0 if none //@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user //@business_info Information about business settings for Telegram Business accounts; may be null if none //@bot_info For bots, information about the bot; may be null if the user isn't a bot -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 premium_gift_options:vector group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -1405,6 +1429,7 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag //@scheduling_state The scheduling state of the message; may be null if the message isn't scheduled //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned +//@is_from_offline True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message //@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application //@can_be_forwarded True, if the message can be forwarded //@can_be_replied_in_another_chat True, if the message can be replied in another chat or topic @@ -1434,14 +1459,15 @@ inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessag //@self_destruct_type The message's self-destruct type; may be null if none //@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet //@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never -//@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent +//@via_bot_user_id If non-zero, the user identifier of the inline bot through which this message was sent +//@sender_business_bot_user_id If non-zero, the user identifier of the business bot that sent this message //@sender_boost_count Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead //@author_signature For channel posts and anonymous group messages, optional author signature //@media_album_id Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null if none -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_boost_count:int32 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -1465,6 +1491,13 @@ messageCalendarDay total_count:int32 message:message = MessageCalendarDay; messageCalendar total_count:int32 days:vector = MessageCalendar; +//@description Describes a message from a business account as received by a bot @message The message @reply_to_message Message that is replied by the message in the same chat; may be null if none +businessMessage message:message reply_to_message:message = BusinessMessage; + +//@description Contains a list of messages from a business account as received by a bot @messages List of business messages +businessMessages messages:vector = BusinessMessages; + + //@class MessageSource @description Describes source of a message //@description The message is from a chat history @@ -1525,15 +1558,37 @@ messageSponsor type:MessageSponsorType photo:chatPhotoInfo info:string = Message //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" +//@can_be_reported True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage //@content Content of the message. Currently, can be only of the type messageText //@sponsor Information about the sponsor of the message //@button_text If non-empty, text for the message action button //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message -sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor button_text:string additional_info:string = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool can_be_reported:Bool content:MessageContent sponsor:messageSponsor button_text:string additional_info:string = SponsoredMessage; //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; +//@description Describes an option to report a sponsored message @id Unique identifier of the option @text Text of the option +reportChatSponsoredMessageOption id:bytes text:string = ReportChatSponsoredMessageOption; + + +//@class ReportChatSponsoredMessageResult @description Describes result of sponsored message report + +//@description The message was reported successfully +reportChatSponsoredMessageResultOk = ReportChatSponsoredMessageResult; + +//@description The sponsored message is too old or not found +reportChatSponsoredMessageResultFailed = ReportChatSponsoredMessageResult; + +//@description The user must choose an option to report the message and repeat request with the chosen option @title Title for the option choice @options List of available options +reportChatSponsoredMessageResultOptionRequired title:string options:vector = ReportChatSponsoredMessageResult; + +//@description Sponsored messages were hidden for the user in all chats +reportChatSponsoredMessageResultAdsHidden = ReportChatSponsoredMessageResult; + +//@description The user asked to hide sponsored messages, but Telegram Premium is required for this +reportChatSponsoredMessageResultPremiumRequired = ReportChatSponsoredMessageResult; + //@description Describes a file added to file download list //@file_id File identifier @@ -1629,7 +1684,7 @@ chatFolderIcon name:string = ChatFolderIcon; //@description Represents a folder for user chats //@title The title of the folder; 1-12 characters without line feeds //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder -//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled +//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is didabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@is_shareable True, if at least one link has been created for the folder //@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium @@ -1854,7 +1909,10 @@ keyboardButtonTypeRequestPoll force_regular:Bool force_quiz:Bool = KeyboardButto //@restrict_user_is_premium True, if the shared users must or must not be Telegram Premium users //@user_is_premium True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false //@max_quantity The maximum number of users to share -keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool max_quantity:int32 = KeyboardButtonType; +//@request_name Pass true to request name of the users; bots only +//@request_username Pass true to request username of the users; bots only +//@request_photo Pass true to request photo of the users; bots only +keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bool restrict_user_is_premium:Bool user_is_premium:Bool max_quantity:int32 request_name:Bool request_username:Bool request_photo:Bool = KeyboardButtonType; //@description A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request //@id Unique button identifier @@ -1867,7 +1925,10 @@ keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bo //@user_administrator_rights Expected user administrator rights in the chat; may be null if they aren't restricted //@bot_administrator_rights Expected bot administrator rights in the chat; may be null if they aren't restricted //@bot_is_member True, if the bot must be a member of the chat; for basic group and supergroup chats only -keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool = KeyboardButtonType; +//@request_title Pass true to request title of the chat; bots only +//@request_username Pass true to request username of the chat; bots only +//@request_photo Pass true to request photo of the chat; bots only +keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool request_title:Bool request_username:Bool request_photo:Bool = KeyboardButtonType; //@description A button that opens a Web App by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl keyboardButtonTypeWebApp url:string = KeyboardButtonType; @@ -2037,6 +2098,22 @@ forumTopics total_count:int32 topics:vector next_offset_date:int32 n linkPreviewOptions is_disabled:Bool url:string force_small_media:Bool force_large_media:Bool show_above_text:Bool = LinkPreviewOptions; +//@description Contains information about a user shared with a bot +//@user_id User identifier +//@first_name First name of the user; for bots only +//@last_name Last name of the user; for bots only +//@username Username of the user; for bots only +//@photo Profile photo of the user; for bots only; may be null +sharedUser user_id:int53 first_name:string last_name:string username:string photo:photo = SharedUser; + +//@description Contains information about a chat shared with a bot +//@chat_id Chat identifier +//@title Title of the chat; for bots only +//@username Username of the chat; for bots only +//@photo Photo of the chat; for bots only; may be null +sharedChat chat_id:int53 title:string username:string photo:photo = SharedChat; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -2342,10 +2419,29 @@ countries countries:vector = Countries; //@country Information about the country to which the phone number belongs; may be null //@country_calling_code The part of the phone number denoting country calling code or its part //@formatted_phone_number The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user -//@is_anonymous True, if the phone number was bought on Fragment and isn't tied to a SIM card +//@is_anonymous True, if the phone number was bought at https://fragment.com and isn't tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo phoneNumberInfo country:countryInfo country_calling_code:string formatted_phone_number:string is_anonymous:Bool = PhoneNumberInfo; +//@class CollectibleItemType @description Describes a collectible item that can be purchased at https://fragment.com + +//@description A username @username The username +collectibleItemTypeUsername username:string = CollectibleItemType; + +//@description A phone number @phone_number The phone number +collectibleItemTypePhoneNumber phone_number:string = CollectibleItemType; + + +//@description Contains information about a collectible item and its last purchase +//@purchase_date Point in time (Unix timestamp) when the item was purchased +//@currency Currency for the paid amount +//@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the item +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency +//@url Individual URL for the item on https://fragment.com +collectibleItemInfo purchase_date:int32 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 url:string = CollectibleItemInfo; + + //@description Describes an action associated with a bank card number @text Action text @url The URL to be opened bankCardActionOpenUrl text:string url:string = BankCardActionOpenUrl; @@ -2506,7 +2602,7 @@ inputInvoiceTelegram purpose:TelegramPaymentPurpose = InputInvoice; //@description The media is hidden until the invoice is paid //@width Media width; 0 if unknown //@height Media height; 0 if unknown -//@duration Media duration; 0 if unknown +//@duration Media duration, in seconds; 0 if unknown //@minithumbnail Media minithumbnail; may be null //@caption Media caption messageExtendedMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia; @@ -2529,7 +2625,7 @@ messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; //@only_new_members True, if only new members of the chats will be eligible for the giveaway //@has_public_winners True, if the list of winners of the giveaway will be available to everyone //@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. -//-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list +//-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list //@prize_description Additional description of the giveaway prize; 0-128 characters premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool has_public_winners:Bool country_codes:vector prize_description:string = PremiumGiveawayParameters; @@ -3091,11 +3187,11 @@ messagePremiumGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 ad //@description A contact has registered with Telegram messageContactRegistered = MessageContent; -//@description The current user shared users, which were requested by the bot @user_ids Identifier of the shared users @button_id Identifier of the keyboard button with the request -messageUsersShared user_ids:vector button_id:int32 = MessageContent; +//@description The current user shared users, which were requested by the bot @users The shared users @button_id Identifier of the keyboard button with the request +messageUsersShared users:vector button_id:int32 = MessageContent; -//@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request -messageChatShared chat_id:int53 button_id:int32 = MessageContent; +//@description The current user shared a chat, which was requested by the bot @chat The shared chat @button_id Identifier of the keyboard button with the request +messageChatShared chat:sharedChat button_id:int32 = MessageContent; //@description The user allowed the bot to send messages @reason The reason why the bot was allowed to write messages messageBotWriteAccessAllowed reason:BotWriteAccessAllowReason = MessageContent; @@ -3297,7 +3393,7 @@ inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_id //@description A video note message //@video_note Video note to be sent //@thumbnail Video thumbnail; may be null if empty; pass null to skip thumbnail uploading -//@duration Duration of the video, in seconds +//@duration Duration of the video, in seconds; 0-60 //@length Video width and height; must be positive and not greater than 640 //@self_destruct_type Video note self-destruct type; may be null if none; pass null if none; private chats only inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 self_destruct_type:MessageSelfDestructType = InputMessageContent; @@ -3508,17 +3604,17 @@ emojis emojis:vector = Emojis; //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official -//@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set @@ -3526,17 +3622,17 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_official True, if the sticker set is official -//@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set //@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -4220,6 +4316,16 @@ speechRecognitionResultText text:string = SpeechRecognitionResult; speechRecognitionResultError error:error = SpeechRecognitionResult; +//@description Describes a connection of the bot with a business account +//@id Unique identifier of the connection +//@user_id Identifier of the business user that created the connection +//@user_chat_id Chat identifier of the private chat with the user +//@date Point in time (Unix timestamp) when the connection was established +//@can_reply True, if the bot can send messages to the connected user; false otherwise +//@is_enabled True, if the connection is enabled; false otherwise +businessConnection id:string user_id:int53 user_chat_id:int53 date:int32 can_reply:Bool is_enabled:Bool = BusinessConnection; + + //@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; @@ -4859,7 +4965,7 @@ premiumFeatureAdvancedChatManagement = PremiumFeature; //@description A badge in the user's profile premiumFeatureProfileBadge = PremiumFeature; -//@description An emoji status shown along with the user's name +//@description The ability to show an emoji status along with the user's name premiumFeatureEmojiStatus = PremiumFeature; //@description Profile photo animation on message and chat screens @@ -4896,6 +5002,45 @@ premiumFeatureMessagePrivacy = PremiumFeature; //@description The ability to view last seen and read times of other users even they can't view last seen or read time for the current user premiumFeatureLastSeenTimes = PremiumFeature; +//@description The ability to use Business features +premiumFeatureBusiness = PremiumFeature; + + +//@class BusinessFeature @description Describes a feature available to Business user accounts + +//@description The ability to set location +businessFeatureLocation = BusinessFeature; + +//@description The ability to set opening hours +businessFeatureOpeningHours = BusinessFeature; + +//@description The ability to use quick replies +businessFeatureQuickReplies = BusinessFeature; + +//@description The ability to set up a greeting message +businessFeatureGreetingMessage = BusinessFeature; + +//@description The ability to set up an away message +businessFeatureAwayMessage = BusinessFeature; + +//@description The ability to create links to the business account with predefined message text +businessFeatureAccountLinks = BusinessFeature; + +//@description The ability to customize intro +businessFeatureIntro = BusinessFeature; + +//@description The ability to connect a bot to the account +businessFeatureBots = BusinessFeature; + +//@description The ability to show an emoji status along with the business name +businessFeatureEmojiStatus = BusinessFeature; + +//@description The ability to display folder names for each chat in the chat list +businessFeatureChatFolderTags = BusinessFeature; + +//@description Allowed to use many additional features for stories +businessFeatureUpgradedStories = BusinessFeature; + //@class PremiumStoryFeature @description Describes a story feature available to Premium users @@ -4930,6 +5075,9 @@ premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = Pre //@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available premiumFeatures features:vector limits:vector payment_link:InternalLinkType = PremiumFeatures; +//@description Contains information about features, available to Business user accounts @features The list of available business features +businessFeatures features:vector = BusinessFeatures; + //@class PremiumSource @description Describes a source from which the Premium features screen is opened @@ -4939,6 +5087,9 @@ premiumSourceLimitExceeded limit_type:PremiumLimitType = PremiumSource; //@description A user tried to use a Premium feature @feature The used feature premiumSourceFeature feature:PremiumFeature = PremiumSource; +//@description A user tried to use a Business feature @feature The used feature; pass null if none specific feature was used +premiumSourceBusinessFeature feature:BusinessFeature = PremiumSource; + //@description A user tried to use a Premium story feature @feature The used feature premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; @@ -4952,11 +5103,15 @@ premiumSourceSettings = PremiumSource; //@description Describes a promotion animation for a Premium feature @feature Premium feature @animation Promotion animation for the feature premiumFeaturePromotionAnimation feature:PremiumFeature animation:animation = PremiumFeaturePromotionAnimation; +//@description Describes a promotion animation for a Business feature @feature Business feature @animation Promotion animation for the feature +businessFeaturePromotionAnimation feature:BusinessFeature animation:animation = BusinessFeaturePromotionAnimation; + //@description Contains state of Telegram Premium subscription and promotion videos for Premium features //@state Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription //@payment_options The list of available options for buying Telegram Premium //@animations The list of available promotion animations for Premium features -premiumState state:formattedText payment_options:vector animations:vector = PremiumState; +//@business_animations The list of available promotion animations for Business features +premiumState state:formattedText payment_options:vector animations:vector business_animations:vector = PremiumState; //@class StorePaymentPurpose @description Describes a purpose of an in-store payment @@ -5172,7 +5327,7 @@ checkChatUsernameResultUsernameInvalid = CheckChatUsernameResult; //@description The username is occupied checkChatUsernameResultUsernameOccupied = CheckChatUsernameResult; -//@description The username can be purchased at fragment.com +//@description The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo checkChatUsernameResultUsernamePurchasable = CheckChatUsernameResult; //@description The user has too many chats with username, one of them must be made private first @@ -5477,6 +5632,9 @@ userPrivacySettingRuleAllowAll = UserPrivacySettingRule; //@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; +//@description A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites +userPrivacySettingRuleAllowPremiumUsers = UserPrivacySettingRule; + //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 userPrivacySettingRuleAllowUsers user_ids:vector = UserPrivacySettingRule; @@ -5516,6 +5674,9 @@ userPrivacySettingShowPhoneNumber = UserPrivacySetting; //@description A privacy setting for managing whether the user's bio is visible userPrivacySettingShowBio = UserPrivacySetting; +//@description A privacy setting for managing whether the user's birthdate is visible +userPrivacySettingShowBirthdate = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -5822,7 +5983,7 @@ internalLinkTypeMessage url:string = InternalLinkType; internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType; //@description The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it -//@bot_user_id User identifier of the service's bot +//@bot_user_id User identifier of the service's bot; the corresponding user may be unknown yet //@scope Telegram Passport element types requested by the service //@public_key Service's public key //@nonce Unique request identifier provided by the service @@ -6250,6 +6411,9 @@ suggestedActionSubscribeToAnnualPremium = SuggestedAction; //@description Suggests the user to gift Telegram Premium to friends for Christmas suggestedActionGiftPremiumForChristmas = SuggestedAction; +//@description Suggests the user to set birthdate +suggestedActionSetBirthdate = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -6306,10 +6470,11 @@ proxies proxies:vector = Proxies; //@description A sticker to be added to a sticker set //@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. //-See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements +//@format Format of the sticker //@emojis String with 1-20 emoji corresponding to the sticker //@mask_position Position where the mask is placed; pass null if not specified //@keywords List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker -inputSticker sticker:InputFile emojis:string mask_position:maskPosition keywords:vector = InputSticker; +inputSticker sticker:InputFile format:StickerFormat emojis:string mask_position:maskPosition keywords:vector = InputSticker; //@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends @@ -6902,7 +7067,7 @@ updateDefaultReactionType reaction_type:ReactionType = Update; updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = Update; //@description The parameters of speech recognition without Telegram Premium subscription has changed -//@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription +//@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds //@weekly_count The total number of allowed speech recognitions per week; 0 if none //@left_count Number of left speech recognition attempts this week //@next_reset_date Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown @@ -6923,12 +7088,30 @@ updateAnimationSearchParameters provider:string emojis:vector = Update; //@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions updateSuggestedActions added_actions:vector removed_actions:vector = Update; +//@description The list of contacts that had birthdays recently or will have birthday soon has changed @close_birthday_users List of contact users with close birthday +updateContactCloseBirthdays close_birthday_users:vector = Update; + //@description Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate @chat_id Chat identifier @user_ids Identifiers of users, which weren't added because of their privacy settings updateAddChatMembersPrivacyForbidden chat_id:int53 user_ids:vector = Update; //@description Autosave settings for some type of chats were updated @scope Type of chats for which autosave settings were updated @settings The new autosave settings; may be null if the settings are reset to default updateAutosaveSettings scope:AutosaveSettingsScope settings:scopeAutosaveSettings = Update; +//@description A business connection has changed; for bots only @connection New data about the connection +updateBusinessConnection connection:businessConnection = Update; + +//@description A new message was added to a business account; for bots only @connection_id Unique identifier of the business connection @message The new message +updateNewBusinessMessage connection_id:string message:businessMessage = Update; + +//@description A message in a business account was edited; for bots only @connection_id Unique identifier of the business connection @message The edited message +updateBusinessMessageEdited connection_id:string message:businessMessage = Update; + +//@description Messages in a business account were deleted; for bots only +//@connection_id Unique identifier of the business connection +//@chat_id Identifier of a chat in the business account in which messages were deleted +//@message_ids Unique message identifiers of the deleted messages +updateBusinessMessagesDeleted connection_id:string chat_id:int53 message_ids:vector = Update; + //@description A new incoming inline query; for bots only //@id Unique query identifier //@sender_user_id Identifier of the user who sent the query @@ -7400,6 +7583,9 @@ getSuitableDiscussionChats = Chats; //@description Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium getInactiveSupergroupChats = Chats; +//@description Returns a list of channel chats, which can be used as a personal chat +getSuitablePersonalChats = Chats; + //@description Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded //@limit The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached @@ -7585,6 +7771,12 @@ getChatSponsoredMessages chat_id:int53 = SponsoredMessages; //@message_id Identifier of the sponsored message clickChatSponsoredMessage chat_id:int53 message_id:int53 = Ok; +//@description Reports a sponsored message to Telegram moderators +//@chat_id Chat identifier of the sponsored message +//@message_id Identifier of the sponsored message +//@option_id Option identifier chosen by the user; leave empty for the initial request +reportChatSponsoredMessage chat_id:int53 message_id:int53 option_id:bytes = ReportChatSponsoredMessageResult; + //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -7654,7 +7846,8 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@input_message_content The content of the message to be sent sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. +//-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, the message thread identifier in which the messages will be sent //@reply_to Information about the message or story to be replied; pass null if none @@ -7802,6 +7995,27 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; +//@description Sends a message on behalf of a business account; for bots only. Returns the message after it was sent +//@business_connection_id Unique identifier of business connection on behalf of which to send the request +//@chat_id Target chat +//@reply_to Information about the message to be replied; pass null if none +//@disable_notification Pass true to disable notification for the message +//@protect_content Pass true if the content of the message must be protected from forwarding and saving +//@reply_markup Markup for replying to the message; pass null if none +//@input_message_content The content of the message to be sent +sendBusinessMessage business_connection_id:string chat_id:int53 reply_to:InputMessageReplyTo disable_notification:Bool protect_content:Bool reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; + +//@description Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only audio, document, photo and video messages can be grouped into an album. +//-Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages +//@business_connection_id Unique identifier of business connection on behalf of which to send the request +//@chat_id Target chat +//@reply_to Information about the message to be replied; pass null if none +//@disable_notification Pass true to disable notification for the message +//@protect_content Pass true if the content of the message must be protected from forwarding and saving +//@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album +sendBusinessMessageAlbum business_connection_id:string chat_id:int53 reply_to:InputMessageReplyTo disable_notification:Bool protect_content:Bool input_message_contents:vector = BusinessMessages; + + //@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters checkQuickReplyShortcutName name:string = Ok; @@ -8019,6 +8233,10 @@ stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; hideSuggestedAction action:SuggestedAction = Ok; +//@description Returns information about a business connection by its identifier; for bots only @connection_id Identifier of the business connection to return +getBusinessConnection connection_id:string = BusinessConnection; + + //@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button //@chat_id Chat identifier of the message with the button //@message_id Message identifier of the message with the button @@ -8171,8 +8389,12 @@ getInlineGameHighScores inline_message_id:string user_id:int53 = GameHighScores; deleteChatReplyMarkup chat_id:int53 message_id:int53 = Ok; -//@description Sends a notification about user activity in a chat @chat_id Chat identifier @message_thread_id If not 0, the message thread identifier in which the action was performed @action The action description; pass null to cancel the currently active action -sendChatAction chat_id:int53 message_thread_id:int53 action:ChatAction = Ok; +//@description Sends a notification about user activity in a chat +//@chat_id Chat identifier +//@message_thread_id If not 0, the message thread identifier in which the action was performed +//@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only +//@action The action description; pass null to cancel the currently active action +sendChatAction chat_id:int53 message_thread_id:int53 business_connection_id:string action:ChatAction = Ok; //@description Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats) @chat_id Chat identifier @@ -8585,7 +8807,7 @@ canSendStory chat_id:int53 = CanSendStoryResult; //@chat_id Identifier of the chat that will post the story //@content Content of the story //@areas Clickable rectangle areas to be shown on the story media; pass null if none -//@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters +//@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") //@privacy_settings The privacy settings for the story; ignored for stories sent to supergroup and channel chats //@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise //@from_story_full_id Full identifier of the original story, which content was used to create the story @@ -9228,7 +9450,10 @@ getPremiumStickers limit:int32 = Stickers; //@description Returns a list of installed sticker sets @sticker_type Type of the sticker sets to return getInstalledStickerSets sticker_type:StickerType = StickerSets; -//@description Returns a list of archived sticker sets @sticker_type Type of the sticker sets to return @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100 +//@description Returns a list of archived sticker sets +//@sticker_type Type of the sticker sets to return +//@offset_sticker_set_id Identifier of the sticker set from which to return the result; use 0 to get results from the beginning +//@limit The maximum number of sticker sets to return; up to 100 getArchivedStickerSets sticker_type:StickerType offset_sticker_set_id:int64 limit:int32 = StickerSets; //@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib @@ -9267,7 +9492,7 @@ reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector = Ok; +//@description Changes the birthdate of the current user @birthdate The new value of the current user's birthdate; pass null to remove the birthdate +setBirthdate birthdate:birthdate = Ok; + +//@description Changes the personal chat of the current user @chat_id Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats +setPersonalChat chat_id:int53 = Ok; + //@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge setEmojiStatus emoji_status:emojiStatus = Ok; @@ -9400,7 +9631,8 @@ setLocation location:location = Ok; //@description Changes the business location of the current user. Requires Telegram Business subscription @location The new location of the business; pass null to remove the location setBusinessLocation location:businessLocation = Ok; -//@description Changes the business opening hours of the current user. Requires Telegram Business subscription @opening_hours The new opening hours of the business; pass null to remove the opening hours +//@description Changes the business opening hours of the current user. Requires Telegram Business subscription +//@opening_hours The new opening hours of the business; pass null to remove the opening hours; up to 28 time intervals can be specified setBusinessOpeningHours opening_hours:businessOpeningHours = Ok; //@description Changes the business greeting message settings of the current user. Requires Telegram Business subscription @greeting_message_settings The new settings for the greeting message of the business; pass null to disable the greeting message @@ -9409,6 +9641,9 @@ setBusinessGreetingMessageSettings greeting_message_settings:businessGreetingMes //@description Changes the business away message settings of the current user. Requires Telegram Business subscription @away_message_settings The new settings for the away message of the business; pass null to disable the away message setBusinessAwayMessageSettings away_message_settings:businessAwayMessageSettings = Ok; +//@description Changes the business intro of the current user. Requires Telegram Business subscription @intro The new intro of the business; pass null to remove the intro +setBusinessIntro intro:inputBusinessIntro = Ok; + //@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code //@phone_number The new phone number of the user in international format //@settings Settings for the authentication of the user's phone number; pass null to use default settings @@ -9784,7 +10019,7 @@ setReadDatePrivacySettings settings:readDatePrivacySettings = Ok; //@description Returns privacy settings for message read date getReadDatePrivacySettings = ReadDatePrivacySettings; -//@description Changes privacy settings for new chat creation; for Telegram Premium users only @settings New settings +//@description Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings") @settings New settings setNewChatPrivacySettings settings:newChatPrivacySettings = Ok; //@description Returns privacy settings for new chat creation @@ -10023,61 +10258,73 @@ checkStickerSetName name:string = CheckStickerSetNameResult; //@description Creates a new sticker set. Returns the newly created sticker set //@user_id Sticker set owner; ignored for regular users //@title Sticker set title; 1-64 characters -//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 1-64 characters -//@sticker_format Format of the stickers in the set +//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_"* (** is case insensitive) for bots; 0-64 characters. +//-If empty, then the name returned by getSuggestedStickerSetName will be used automatically //@sticker_type Type of the stickers in the set //@needs_repainting Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only -//@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown +//@stickers List of stickers to be added to the set; 1-200 stickers for custom emoji sticker sets, and 1-120 stickers otherwise. For TGS stickers, uploadStickerFile must be used before the sticker is shown //@source Source of the sticker set; may be empty if unknown -createNewStickerSet user_id:int53 title:string name:string sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool stickers:vector source:string = StickerSet; +createNewStickerSet user_id:int53 title:string name:string sticker_type:StickerType needs_repainting:Bool stickers:vector source:string = StickerSet; - -//@description Adds a new sticker to a set; for bots only -//@user_id Sticker set owner -//@name Sticker set name +//@description Adds a new sticker to a set +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker sets and less than 120 otherwise //@sticker Sticker to add to the set addStickerToSet user_id:int53 name:string sticker:inputSticker = Ok; -//@description Sets a sticker set thumbnail; for bots only -//@user_id Sticker set owner -//@name Sticker set name -//@thumbnail Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set -setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = Ok; +//@description Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user +//@old_sticker Sticker to remove from the set +//@new_sticker Sticker to add to the set +replaceStickerInSet user_id:int53 name:string old_sticker:InputFile new_sticker:inputSticker = Ok; -//@description Sets a custom emoji sticker set thumbnail; for bots only -//@name Sticker set name +//@description Sets a sticker set thumbnail +//@user_id Sticker set owner; ignored for regular users +//@name Sticker set name. The sticker set must be owned by the current user +//@thumbnail Thumbnail to set; pass null to remove the sticker set thumbnail +//@format Format of the thumbnail; pass null if thumbnail is removed +setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile format:StickerFormat = Ok; + +//@description Sets a custom emoji sticker set thumbnail +//@name Sticker set name. The sticker set must be owned by the current user //@custom_emoji_id Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail setCustomEmojiStickerSetThumbnail name:string custom_emoji_id:int64 = Ok; -//@description Sets a sticker set title; for bots only @name Sticker set name @title New sticker set title +//@description Sets a sticker set title @name Sticker set name. The sticker set must be owned by the current user @title New sticker set title setStickerSetTitle name:string title:string = Ok; -//@description Deleted a sticker set; for bots only @name Sticker set name +//@description Completely deletes a sticker set @name Sticker set name. The sticker set must be owned by the current user deleteStickerSet name:string = Ok; -//@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot +//@description Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user //@sticker Sticker //@position New position of the sticker in the set, 0-based setStickerPositionInSet sticker:InputFile position:int32 = Ok; -//@description Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot @sticker Sticker +//@description Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user @sticker Sticker to remove from the set removeStickerFromSet sticker:InputFile = Ok; -//@description Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +//@description Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user //@sticker Sticker //@emojis New string with 1-20 emoji corresponding to the sticker setStickerEmojis sticker:InputFile emojis:string = Ok; -//@description Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot +//@description Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user //@sticker Sticker //@keywords List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker setStickerKeywords sticker:InputFile keywords:vector = Ok; -//@description Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot +//@description Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current user //@sticker Sticker //@mask_position Position where the mask is placed; pass null to remove mask position setStickerMaskPosition sticker:InputFile mask_position:maskPosition = Ok; +//@description Returns sticker sets owned by the current user +//@offset_sticker_set_id Identifier of the sticker set from which to return owned sticker sets; use 0 to get results from the beginning +//@limit The maximum number of sticker sets to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit +getOwnedStickerSets offset_sticker_set_id:int64 limit:int32 = StickerSets; + //@description Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded //@location Location of the map center @@ -10141,6 +10388,10 @@ assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok; assignGooglePlayTransaction package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok; +//@description Returns information about features, available to Business users @source Source of the request; pass null if the method is called from settings or some non-standard source +getBusinessFeatures source:BusinessFeature = BusinessFeatures; + + //@description Accepts Telegram terms of services @terms_of_service_id Terms of service identifier acceptTermsOfService terms_of_service_id:string = Ok; @@ -10179,6 +10430,11 @@ getPhoneNumberInfo phone_number_prefix:string = PhoneNumberInfo; getPhoneNumberInfoSync language_code:string phone_number_prefix:string = PhoneNumberInfo; +//@description Returns information about a given collectible item that was purchased at https://fragment.com +//@type Type of the collectible item. The item must be used by a user and must be visible to the current user +getCollectibleItemInfo type:CollectibleItemType = CollectibleItemInfo; + + //@description Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization @link The link getDeepLinkInfo link:string = DeepLinkInfo;