diff --git a/client/function.go b/client/function.go index 9599474..cbd2cde 100755 --- a/client/function.go +++ b/client/function.go @@ -3512,7 +3512,7 @@ type SearchPublicPostsRequest struct { Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // The amount of Telegram Stars the user agreed to pay for the search; pass 0 for free searches + // The Telegram Star amount the user agreed to pay for the search; pass 0 for free searches StarCount int64 `json:"star_count"` } @@ -6298,7 +6298,7 @@ type GetBusinessAccountStarAmountRequest struct { BusinessConnectionId string `json:"business_connection_id"` } -// Returns the amount of Telegram Stars owned by a business account; for bots only +// Returns the Telegram Star amount owned by a business account; for bots only func (client *Client) GetBusinessAccountStarAmount(req *GetBusinessAccountStarAmountRequest) (*StarAmount, error) { result, err := client.Send(Request{ meta: meta{ @@ -8528,7 +8528,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // Pass true to allow the bot to send messages to the current user + // Pass true to allow the bot to send messages to the current user. Phone number access can't be requested using the button AllowWriteAccess bool `json:"allow_write_access"` } @@ -8673,7 +8673,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query + // Pass true if results may be cached and returned only for the user who sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` // Button to be shown above inline query results; pass null if none Button *InlineQueryResultsButton `json:"button"` @@ -9427,7 +9427,7 @@ func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) ( type SendChatActionRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the topic in which the action is performed + // Identifier of the topic in which the action is performed; pass null if none TopicId MessageTopic `json:"topic_id"` // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -9692,9 +9692,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte } switch result.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(result.Data) - case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) @@ -9716,11 +9713,8 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(result.Data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(result.Data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(result.Data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(result.Data) @@ -9731,21 +9725,18 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(result.Data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(result.Data) + + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(result.Data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(result.Data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) @@ -9767,15 +9758,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(result.Data) - case TypeInternalLinkTypeLiveStory: return UnmarshalInternalLinkTypeLiveStory(result.Data) - case TypeInternalLinkTypeLoginEmailSettings: - return UnmarshalInternalLinkTypeLoginEmailSettings(result.Data) - case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(result.Data) @@ -9785,35 +9770,35 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(result.Data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(result.Data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(result.Data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(result.Data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(result.Data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(result.Data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(result.Data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(result.Data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(result.Data) - case TypeInternalLinkTypePasswordSettings: - return UnmarshalInternalLinkTypePasswordSettings(result.Data) - case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) - case TypeInternalLinkTypePhoneNumberPrivacySettings: - return UnmarshalInternalLinkTypePhoneNumberPrivacySettings(result.Data) - - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(result.Data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(result.Data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(result.Data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(result.Data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -9827,9 +9812,18 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(result.Data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(result.Data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(result.Data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(result.Data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) @@ -9842,15 +9836,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(result.Data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(result.Data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(result.Data) @@ -9909,11 +9897,13 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` + // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to access their phone number + AllowPhoneNumberAccess bool `json:"allow_phone_number_access"` } -// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed +// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed. May return an empty link if just a toast about successful login has to be shown func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -9922,6 +9912,7 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er Data: map[string]interface{}{ "link": req.Link, "allow_write_access": req.AllowWriteAccess, + "allow_phone_number_access": req.AllowPhoneNumberAccess, }, }) if err != nil { @@ -11841,7 +11832,7 @@ type BanChatMemberRequest struct { MemberId MessageSender `json:"member_id"` // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned BannedUntilDate int32 `json:"banned_until_date"` - // Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels + // Pass true to delete all messages in the chat for the user who is being removed. Always true for supergroups and channels RevokeMessages bool `json:"revoke_messages"` } @@ -11935,6 +11926,32 @@ func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) ( return UnmarshalOk(result.Data) } +type GetChatOwnerAfterLeavingRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the chat during that period; requires owner privileges in the chat. Available only for supergroups and channel chats +func (client *Client) GetChatOwnerAfterLeaving(req *GetChatOwnerAfterLeavingRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatOwnerAfterLeaving", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + type GetChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -15136,7 +15153,7 @@ func (client *Client) GetChatJoinRequests(req *GetChatJoinRequestsRequest) (*Cha type ProcessChatJoinRequestRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the user that sent the request + // Identifier of the user who sent the request UserId int64 `json:"user_id"` // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` @@ -22163,7 +22180,7 @@ type PlaceGiftAuctionBidRequest struct { GiftId JsonInt64 `json:"gift_id"` // The number of Telegram Stars to place in the bid StarCount int64 `json:"star_count"` - // Identifier of the user that will receive the gift + // Identifier of the user who will receive the gift UserId int64 `json:"user_id"` // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages Text *FormattedText `json:"text"` @@ -22342,8 +22359,8 @@ func (client *Client) ToggleChatGiftNotifications(req *ToggleChatGiftNotificatio } type GetGiftUpgradePreviewRequest struct { - // Identifier of the gift - GiftId JsonInt64 `json:"gift_id"` + // Identifier of the regular gift + RegularGiftId JsonInt64 `json:"regular_gift_id"` } // Returns examples of possible upgraded gifts for a regular gift @@ -22353,7 +22370,7 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( Type: "getGiftUpgradePreview", }, Data: map[string]interface{}{ - "gift_id": req.GiftId, + "regular_gift_id": req.RegularGiftId, }, }) if err != nil { @@ -22367,19 +22384,25 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( return UnmarshalGiftUpgradePreview(result.Data) } -type GetGiftUpgradeVariantsRequest struct { - // Identifier of the gift - GiftId JsonInt64 `json:"gift_id"` +type GetUpgradedGiftVariantsRequest struct { + // Identifier of the regular gift + RegularGiftId JsonInt64 `json:"regular_gift_id"` + // Pass true to get models that can be obtained by upgrading a regular gift + ReturnUpgradeModels bool `json:"return_upgrade_models"` + // Pass true to get models that can be obtained by crafting a gift from upgraded gifts + ReturnCraftModels bool `json:"return_craft_models"` } // Returns all possible variants of upgraded gifts for a regular gift -func (client *Client) GetGiftUpgradeVariants(req *GetGiftUpgradeVariantsRequest) (*GiftUpgradeVariants, error) { +func (client *Client) GetUpgradedGiftVariants(req *GetUpgradedGiftVariantsRequest) (*GiftUpgradeVariants, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getGiftUpgradeVariants", + Type: "getUpgradedGiftVariants", }, Data: map[string]interface{}{ - "gift_id": req.GiftId, + "regular_gift_id": req.RegularGiftId, + "return_upgrade_models": req.ReturnUpgradeModels, + "return_craft_models": req.ReturnCraftModels, }, }) if err != nil { @@ -22400,7 +22423,7 @@ type UpgradeGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Pass true to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails bool `json:"keep_original_details"` - // The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count + // The Telegram Star amount required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count StarCount int64 `json:"star_count"` } @@ -22433,7 +22456,7 @@ type BuyGiftUpgradeRequest struct { OwnerId MessageSender `json:"owner_id"` // Prepaid upgrade hash as received along with the gift PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - // The amount of Telegram Stars the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count + // The Telegram Star amount the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count StarCount int64 `json:"star_count"` } @@ -22460,6 +22483,47 @@ func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type CraftGiftRequest struct { + // Identifier of the gifts to use for crafting + ReceivedGiftIds []string `json:"received_gift_ids"` +} + +// Crafts a new gift from other gifts that will be permanently lost +func (client *Client) CraftGift(req *CraftGiftRequest) (CraftGiftResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "craftGift", + }, + Data: map[string]interface{}{ + "received_gift_ids": req.ReceivedGiftIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(result.Data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(result.Data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(result.Data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type TransferGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -22467,7 +22531,7 @@ type TransferGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Identifier of the user or the channel chat that will receive the gift NewOwnerId MessageSender `json:"new_owner_id"` - // The amount of Telegram Stars required to pay for the transfer + // The Telegram Star amount required to pay for the transfer StarCount int64 `json:"star_count"` } @@ -22498,7 +22562,7 @@ func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { type DropGiftOriginalDetailsRequest struct { // Identifier of the gift ReceivedGiftId string `json:"received_gift_id"` - // The amount of Telegram Stars required to pay for the operation + // The Telegram Star amount required to pay for the operation StarCount int64 `json:"star_count"` } @@ -22723,6 +22787,38 @@ func (client *Client) GetReceivedGift(req *GetReceivedGiftRequest) (*ReceivedGif return UnmarshalReceivedGift(result.Data) } +type GetGiftsForCraftingRequest struct { + // Identifier of the regular gift that will be used for crafting + RegularGiftId JsonInt64 `json:"regular_gift_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of gifts 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 upgraded gifts of the current user who can be used to craft another gifts +func (client *Client) GetGiftsForCrafting(req *GetGiftsForCraftingRequest) (*GiftsForCrafting, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftsForCrafting", + }, + Data: map[string]interface{}{ + "regular_gift_id": req.RegularGiftId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftsForCrafting(result.Data) +} + type GetUpgradedGiftRequest struct { // Unique name of the upgraded gift Name string `json:"name"` @@ -22857,6 +22953,8 @@ type SearchGiftsForResaleRequest struct { GiftId JsonInt64 `json:"gift_id"` // Order in which the results will be sorted Order GiftForResaleOrder `json:"order"` + // Pass true to get only gifts suitable for crafting + ForCrafting bool `json:"for_crafting"` // Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. If none attributes of specific type are specified, then all values for this attribute type are allowed Attributes []UpgradedGiftAttributeId `json:"attributes"` // Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results @@ -22874,6 +22972,7 @@ func (client *Client) SearchGiftsForResale(req *SearchGiftsForResaleRequest) (*G Data: map[string]interface{}{ "gift_id": req.GiftId, "order": req.Order, + "for_crafting": req.ForCrafting, "attributes": req.Attributes, "offset": req.Offset, "limit": req.Limit, @@ -23164,7 +23263,7 @@ func (client *Client) CreateInvoiceLink(req *CreateInvoiceLinkRequest) (*HttpUrl } type RefundStarPaymentRequest struct { - // Identifier of the user that did the payment + // Identifier of the user who did the payment UserId int64 `json:"user_id"` // Telegram payment identifier TelegramPaymentChargeId string `json:"telegram_payment_charge_id"` @@ -23192,7 +23291,7 @@ func (client *Client) RefundStarPayment(req *RefundStarPaymentRequest) (*Ok, err return UnmarshalOk(result.Data) } -// Returns a user that can be contacted to get support +// Returns a user who can be contacted to get support func (client *Client) GetSupportUser() (*User, error) { result, err := client.Send(Request{ meta: meta{ @@ -23957,7 +24056,7 @@ type SetChatPaidMessageStarCountRequest struct { PaidMessageStarCount int64 `json:"paid_message_star_count"` } -// Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages +// Changes the Telegram Star amount that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages func (client *Client) SetChatPaidMessageStarCount(req *SetChatPaidMessageStarCountRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -25355,7 +25454,7 @@ type SetPassportElementErrorsRequest struct { Errors []*InputPassportElementError `json:"errors"` } -// Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed +// Informs the user who some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed func (client *Client) SetPassportElementErrors(req *SetPassportElementErrorsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -26520,7 +26619,7 @@ func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { } type GetStarGiftPaymentOptionsRequest struct { - // Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user + // Identifier of the user who will receive Telegram Stars; pass 0 to get options for an unspecified user UserId int64 `json:"user_id"` } @@ -26931,7 +27030,7 @@ type GetConnectedAffiliateProgramRequest struct { BotUserId int64 `json:"bot_user_id"` } -// Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program +// Returns an affiliate program that was connected to the given affiliate by identifier of the bot that created the program func (client *Client) GetConnectedAffiliateProgram(req *GetConnectedAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) { result, err := client.Send(Request{ meta: meta{ @@ -27403,27 +27502,21 @@ func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { } type AddProxyRequest struct { - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` + // The proxy to add + Proxy *Proxy `json:"proxy"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` - // Proxy type - Type ProxyType `json:"type"` } // Adds a proxy server for network requests. Can be called before authorization -func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { +func (client *Client) AddProxy(req *AddProxyRequest) (*AddedProxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "addProxy", }, Data: map[string]interface{}{ - "server": req.Server, - "port": req.Port, + "proxy": req.Proxy, "enable": req.Enable, - "type": req.Type, }, }) if err != nil { @@ -27434,34 +27527,28 @@ func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxy(result.Data) + return UnmarshalAddedProxy(result.Data) } type EditProxyRequest struct { // Proxy identifier ProxyId int32 `json:"proxy_id"` - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` + // The new information about the proxy + Proxy *Proxy `json:"proxy"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` - // Proxy type - Type ProxyType `json:"type"` } // Edits an existing proxy server for network requests. Can be called before authorization -func (client *Client) EditProxy(req *EditProxyRequest) (*Proxy, error) { +func (client *Client) EditProxy(req *EditProxyRequest) (*AddedProxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "editProxy", }, Data: map[string]interface{}{ "proxy_id": req.ProxyId, - "server": req.Server, - "port": req.Port, + "proxy": req.Proxy, "enable": req.Enable, - "type": req.Type, }, }) if err != nil { @@ -27472,7 +27559,7 @@ func (client *Client) EditProxy(req *EditProxyRequest) (*Proxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxy(result.Data) + return UnmarshalAddedProxy(result.Data) } type EnableProxyRequest struct { @@ -27547,7 +27634,7 @@ func (client *Client) RemoveProxy(req *RemoveProxyRequest) (*Ok, error) { } // Returns the list of proxies that are currently set up. Can be called before authorization -func (client *Client) GetProxies() (*Proxies, error) { +func (client *Client) GetProxies() (*AddedProxies, error) { result, err := client.Send(Request{ meta: meta{ Type: "getProxies", @@ -27562,38 +27649,12 @@ func (client *Client) GetProxies() (*Proxies, error) { return nil, buildResponseError(result.Data) } - return UnmarshalProxies(result.Data) -} - -type GetProxyLinkRequest struct { - // Proxy identifier - ProxyId int32 `json:"proxy_id"` -} - -// Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization -func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getProxyLink", - }, - Data: map[string]interface{}{ - "proxy_id": req.ProxyId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalHttpUrl(result.Data) + return UnmarshalAddedProxies(result.Data) } type PingProxyRequest struct { - // Proxy identifier. Use 0 to ping a Telegram server without a proxy - ProxyId int32 `json:"proxy_id"` + // The proxy to test; pass null to ping a Telegram server without a proxy + Proxy *Proxy `json:"proxy"` } // Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @@ -27603,7 +27664,7 @@ func (client *Client) PingProxy(req *PingProxyRequest) (*Seconds, error) { Type: "pingProxy", }, Data: map[string]interface{}{ - "proxy_id": req.ProxyId, + "proxy": req.Proxy, }, }) if err != nil { @@ -28157,12 +28218,8 @@ func (client *Client) TestNetwork() (*Ok, error) { } type TestProxyRequest struct { - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Proxy type - Type ProxyType `json:"type"` + // The proxy to test + Proxy *Proxy `json:"proxy"` // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request @@ -28176,9 +28233,7 @@ func (client *Client) TestProxy(req *TestProxyRequest) (*Ok, error) { Type: "testProxy", }, Data: map[string]interface{}{ - "server": req.Server, - "port": req.Port, - "type": req.Type, + "proxy": req.Proxy, "dc_id": req.DcId, "timeout": req.Timeout, }, diff --git a/client/type.go b/client/type.go index 3f150f6..feb0c58 100755 --- a/client/type.go +++ b/client/type.go @@ -34,6 +34,8 @@ const ( ClassAffiliateProgramSortOrder = "AffiliateProgramSortOrder" ClassCanSendGiftResult = "CanSendGiftResult" ClassUpgradedGiftOrigin = "UpgradedGiftOrigin" + ClassUpgradedGiftAttributeRarity = "UpgradedGiftAttributeRarity" + ClassCraftGiftResult = "CraftGiftResult" ClassUpgradedGiftAttributeId = "UpgradedGiftAttributeId" ClassGiftForResaleOrder = "GiftForResaleOrder" ClassGiftResaleResult = "GiftResaleResult" @@ -72,6 +74,7 @@ const ( ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" + ClassButtonStyle = "ButtonStyle" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" ClassReplyMarkup = "ReplyMarkup" @@ -111,6 +114,7 @@ const ( ClassEmojiCategoryType = "EmojiCategoryType" ClassStoryAreaType = "StoryAreaType" ClassInputStoryAreaType = "InputStoryAreaType" + ClassStoryContentType = "StoryContentType" ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" @@ -173,6 +177,7 @@ const ( ClassReportReason = "ReportReason" ClassReportChatResult = "ReportChatResult" ClassReportStoryResult = "ReportStoryResult" + ClassSettingsSection = "SettingsSection" ClassInternalLinkType = "InternalLinkType" ClassBlockList = "BlockList" ClassFileType = "FileType" @@ -330,6 +335,8 @@ const ( ClassGiftsForResale = "GiftsForResale" ClassReceivedGift = "ReceivedGift" ClassReceivedGifts = "ReceivedGifts" + ClassAttributeCraftPersistenceProbability = "AttributeCraftPersistenceProbability" + ClassGiftsForCrafting = "GiftsForCrafting" ClassGiftUpgradePreview = "GiftUpgradePreview" ClassGiftUpgradeVariants = "GiftUpgradeVariants" ClassAuctionBid = "AuctionBid" @@ -617,6 +624,7 @@ const ( ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" + ClassProxy = "Proxy" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassReadDatePrivacySettings = "ReadDatePrivacySettings" @@ -655,8 +663,8 @@ const ( ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassStarCount = "StarCount" ClassDeepLinkInfo = "DeepLinkInfo" - ClassProxy = "Proxy" - ClassProxies = "Proxies" + ClassAddedProxy = "AddedProxy" + ClassAddedProxies = "AddedProxies" ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" @@ -909,6 +917,12 @@ const ( TypeUpgradedGiftOriginBlockchain = "upgradedGiftOriginBlockchain" TypeUpgradedGiftOriginPrepaidUpgrade = "upgradedGiftOriginPrepaidUpgrade" TypeUpgradedGiftOriginOffer = "upgradedGiftOriginOffer" + TypeUpgradedGiftOriginCraft = "upgradedGiftOriginCraft" + TypeUpgradedGiftAttributeRarityPerMille = "upgradedGiftAttributeRarityPerMille" + TypeUpgradedGiftAttributeRarityUncommon = "upgradedGiftAttributeRarityUncommon" + TypeUpgradedGiftAttributeRarityRare = "upgradedGiftAttributeRarityRare" + TypeUpgradedGiftAttributeRarityEpic = "upgradedGiftAttributeRarityEpic" + TypeUpgradedGiftAttributeRarityLegendary = "upgradedGiftAttributeRarityLegendary" TypeUpgradedGiftModel = "upgradedGiftModel" TypeUpgradedGiftSymbol = "upgradedGiftSymbol" TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors" @@ -919,6 +933,10 @@ const ( TypeUpgradedGift = "upgradedGift" TypeUpgradedGiftValueInfo = "upgradedGiftValueInfo" TypeUpgradeGiftResult = "upgradeGiftResult" + TypeCraftGiftResultSuccess = "craftGiftResultSuccess" + TypeCraftGiftResultTooEarly = "craftGiftResultTooEarly" + TypeCraftGiftResultInvalidGift = "craftGiftResultInvalidGift" + TypeCraftGiftResultFail = "craftGiftResultFail" TypeAvailableGift = "availableGift" TypeAvailableGifts = "availableGifts" TypeGiftUpgradePrice = "giftUpgradePrice" @@ -939,6 +957,8 @@ const ( TypeSentGiftUpgraded = "sentGiftUpgraded" TypeReceivedGift = "receivedGift" TypeReceivedGifts = "receivedGifts" + TypeAttributeCraftPersistenceProbability = "attributeCraftPersistenceProbability" + TypeGiftsForCrafting = "giftsForCrafting" TypeGiftUpgradePreview = "giftUpgradePreview" TypeGiftUpgradeVariants = "giftUpgradeVariants" TypeAuctionBid = "auctionBid" @@ -1004,6 +1024,8 @@ const ( TypeTonTransactionTypeGiftPurchaseOffer = "tonTransactionTypeGiftPurchaseOffer" TypeTonTransactionTypeUpgradedGiftPurchase = "tonTransactionTypeUpgradedGiftPurchase" TypeTonTransactionTypeUpgradedGiftSale = "tonTransactionTypeUpgradedGiftSale" + TypeTonTransactionTypeStakeDiceStake = "tonTransactionTypeStakeDiceStake" + TypeTonTransactionTypeStakeDicePayout = "tonTransactionTypeStakeDicePayout" TypeTonTransactionTypeUnsupported = "tonTransactionTypeUnsupported" TypeTonTransaction = "tonTransaction" TypeTonTransactions = "tonTransactions" @@ -1221,6 +1243,10 @@ const ( TypeChatActionBarAddContact = "chatActionBarAddContact" TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" + TypeButtonStyleDefault = "buttonStyleDefault" + TypeButtonStylePrimary = "buttonStylePrimary" + TypeButtonStyleDanger = "buttonStyleDanger" + TypeButtonStyleSuccess = "buttonStyleSuccess" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -1520,6 +1546,8 @@ const ( TypeMessageChatChangeTitle = "messageChatChangeTitle" TypeMessageChatChangePhoto = "messageChatChangePhoto" TypeMessageChatDeletePhoto = "messageChatDeletePhoto" + TypeMessageChatOwnerLeft = "messageChatOwnerLeft" + TypeMessageChatOwnerChanged = "messageChatOwnerChanged" TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" @@ -1710,6 +1738,10 @@ const ( TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" + TypeStoryContentTypePhoto = "storyContentTypePhoto" + TypeStoryContentTypeVideo = "storyContentTypeVideo" + TypeStoryContentTypeLive = "storyContentTypeLive" + TypeStoryContentTypeUnsupported = "storyContentTypeUnsupported" TypeStoryContentPhoto = "storyContentPhoto" TypeStoryContentVideo = "storyContentVideo" TypeStoryContentLive = "storyContentLive" @@ -2149,6 +2181,7 @@ const ( TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" + TypeProxy = "proxy" TypeOptionValueBoolean = "optionValueBoolean" TypeOptionValueEmpty = "optionValueEmpty" TypeOptionValueInteger = "optionValueInteger" @@ -2237,7 +2270,27 @@ const ( TypeReportStoryResultOk = "reportStoryResultOk" TypeReportStoryResultOptionRequired = "reportStoryResultOptionRequired" TypeReportStoryResultTextRequired = "reportStoryResultTextRequired" - TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" + TypeSettingsSectionAppearance = "settingsSectionAppearance" + TypeSettingsSectionAskQuestion = "settingsSectionAskQuestion" + TypeSettingsSectionBusiness = "settingsSectionBusiness" + TypeSettingsSectionChatFolders = "settingsSectionChatFolders" + TypeSettingsSectionDataAndStorage = "settingsSectionDataAndStorage" + TypeSettingsSectionDevices = "settingsSectionDevices" + TypeSettingsSectionEditProfile = "settingsSectionEditProfile" + TypeSettingsSectionFaq = "settingsSectionFaq" + TypeSettingsSectionFeatures = "settingsSectionFeatures" + TypeSettingsSectionInAppBrowser = "settingsSectionInAppBrowser" + TypeSettingsSectionLanguage = "settingsSectionLanguage" + TypeSettingsSectionMyStars = "settingsSectionMyStars" + TypeSettingsSectionMyToncoins = "settingsSectionMyToncoins" + TypeSettingsSectionNotifications = "settingsSectionNotifications" + TypeSettingsSectionPowerSaving = "settingsSectionPowerSaving" + TypeSettingsSectionPremium = "settingsSectionPremium" + TypeSettingsSectionPrivacyAndSecurity = "settingsSectionPrivacyAndSecurity" + TypeSettingsSectionPrivacyPolicy = "settingsSectionPrivacyPolicy" + TypeSettingsSectionQrCode = "settingsSectionQrCode" + TypeSettingsSectionSearch = "settingsSectionSearch" + TypeSettingsSectionSendGift = "settingsSectionSendGift" TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" TypeInternalLinkTypeBackground = "internalLinkTypeBackground" @@ -2245,16 +2298,14 @@ const ( TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" TypeInternalLinkTypeBusinessChat = "internalLinkTypeBusinessChat" - TypeInternalLinkTypeBuyStars = "internalLinkTypeBuyStars" - TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeCallsPage = "internalLinkTypeCallsPage" TypeInternalLinkTypeChatAffiliateProgram = "internalLinkTypeChatAffiliateProgram" TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" - TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" + TypeInternalLinkTypeChatSelection = "internalLinkTypeChatSelection" + TypeInternalLinkTypeContactsPage = "internalLinkTypeContactsPage" TypeInternalLinkTypeDirectMessagesChat = "internalLinkTypeDirectMessagesChat" - TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" TypeInternalLinkTypeGiftAuction = "internalLinkTypeGiftAuction" TypeInternalLinkTypeGiftCollection = "internalLinkTypeGiftCollection" @@ -2262,34 +2313,33 @@ const ( TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" TypeInternalLinkTypeLiveStory = "internalLinkTypeLiveStory" - TypeInternalLinkTypeLoginEmailSettings = "internalLinkTypeLoginEmailSettings" TypeInternalLinkTypeMainWebApp = "internalLinkTypeMainWebApp" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypeMyStars = "internalLinkTypeMyStars" - TypeInternalLinkTypeMyToncoins = "internalLinkTypeMyToncoins" + TypeInternalLinkTypeMyProfilePage = "internalLinkTypeMyProfilePage" + TypeInternalLinkTypeNewChannelChat = "internalLinkTypeNewChannelChat" + TypeInternalLinkTypeNewGroupChat = "internalLinkTypeNewGroupChat" + TypeInternalLinkTypeNewPrivateChat = "internalLinkTypeNewPrivateChat" + TypeInternalLinkTypeNewStory = "internalLinkTypeNewStory" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" - TypeInternalLinkTypePasswordSettings = "internalLinkTypePasswordSettings" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypePhoneNumberPrivacySettings = "internalLinkTypePhoneNumberPrivacySettings" - TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" - TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" + TypeInternalLinkTypePremiumFeaturesPage = "internalLinkTypePremiumFeaturesPage" TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" - TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" + TypeInternalLinkTypePremiumGiftPurchase = "internalLinkTypePremiumGiftPurchase" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" + TypeInternalLinkTypeSavedMessages = "internalLinkTypeSavedMessages" + TypeInternalLinkTypeSearch = "internalLinkTypeSearch" TypeInternalLinkTypeSettings = "internalLinkTypeSettings" + TypeInternalLinkTypeStarPurchase = "internalLinkTypeStarPurchase" TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" TypeInternalLinkTypeStory = "internalLinkTypeStory" TypeInternalLinkTypeStoryAlbum = "internalLinkTypeStoryAlbum" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" - TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" - TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" TypeInternalLinkTypeUpgradedGift = "internalLinkTypeUpgradedGift" TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" @@ -2397,8 +2447,8 @@ const ( TypeProxyTypeSocks5 = "proxyTypeSocks5" TypeProxyTypeHttp = "proxyTypeHttp" TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeProxy = "proxy" - TypeProxies = "proxies" + TypeAddedProxy = "addedProxy" + TypeAddedProxies = "addedProxies" TypeInputSticker = "inputSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" @@ -2769,6 +2819,16 @@ type UpgradedGiftOrigin interface { UpgradedGiftOriginType() string } +// Describes rarity of an upgraded gift attribute +type UpgradedGiftAttributeRarity interface { + UpgradedGiftAttributeRarityType() string +} + +// Contains result of gift crafting +type CraftGiftResult interface { + CraftGiftResultType() string +} + // Contains identifier of an upgraded gift attribute to search for type UpgradedGiftAttributeId interface { UpgradedGiftAttributeIdType() string @@ -2959,6 +3019,11 @@ type ChatActionBar interface { ChatActionBarType() string } +// Describes style of a button +type ButtonStyle interface { + ButtonStyleType() string +} + // Describes a keyboard button type type KeyboardButtonType interface { KeyboardButtonTypeType() string @@ -3154,6 +3219,11 @@ type InputStoryAreaType interface { InputStoryAreaTypeType() string } +// Contains the type of the content of a story +type StoryContentType interface { + StoryContentTypeType() string +} + // Contains the content of a story type StoryContent interface { StoryContentType() string @@ -3464,6 +3534,11 @@ type ReportStoryResult interface { ReportStoryResultType() string } +// Describes a section of the application settings +type SettingsSection interface { + SettingsSectionType() string +} + // Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { InternalLinkTypeType() string @@ -6558,7 +6633,7 @@ type StakeDiceState struct { meta // Hash of the state to use for sending the next dice; may be empty if the stake dice can't be sent by the current user StateHash string `json:"state_hash"` - // The amount of Toncoins that was staked in the previous roll; in the smallest units of the currency + // The Toncoin amount that was staked in the previous roll; in the smallest units of the currency StakeToncoinAmount int64 `json:"stake_toncoin_amount"` // The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency SuggestedStakeToncoinAmounts []int64 `json:"suggested_stake_toncoin_amounts"` @@ -7192,6 +7267,8 @@ type UserTypeBot struct { HasMainWebApp bool `json:"has_main_web_app"` // True, if the bot has topics HasTopics bool `json:"has_topics"` + // True, if users can create and delete topics in the chat with the bot + AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` // Placeholder for inline queries (displayed on the application input field) @@ -7463,7 +7540,7 @@ func (*Birthdate) GetType() string { return TypeBirthdate } -// Describes a user that had or will have a birthday soon +// Describes a user who had or will have a birthday soon type CloseBirthdayUser struct { meta // User identifier @@ -7725,7 +7802,7 @@ type BusinessBotRights struct { CanEditProfilePhoto bool `json:"can_edit_profile_photo"` // True, if the bot can edit username of the business account CanEditUsername bool `json:"can_edit_username"` - // True, if the bot can view gifts and amount of Telegram Stars owned by the business account + // True, if the bot can view gifts and Telegram Star amount owned by the business account CanViewGiftsAndStars bool `json:"can_view_gifts_and_stars"` // True, if the bot can sell regular gifts received by the business account CanSellGifts bool `json:"can_sell_gifts"` @@ -8490,7 +8567,7 @@ func (*ChatAdministratorRights) GetType() string { // Describes price of a resold gift in Telegram Stars type GiftResalePriceStar struct { meta - // The amount of Telegram Stars expected to be paid for the gift. Must be in the range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale + // The Telegram Star amount expected to be paid for the gift. Must be in the range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale StarCount int64 `json:"star_count"` } @@ -8619,7 +8696,7 @@ func (*GiftPurchaseOfferStateRejected) GiftPurchaseOfferStateType() string { // Describes price of a suggested post in Telegram Stars type SuggestedPostPriceStar struct { meta - // The amount of Telegram Stars expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") + // The Telegram Star amount expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") StarCount int64 `json:"star_count"` } @@ -8897,10 +8974,10 @@ func (*SuggestedPostRefundReasonPaymentRefunded) SuggestedPostRefundReasonType() return TypeSuggestedPostRefundReasonPaymentRefunded } -// Describes a possibly non-integer amount of Telegram Stars +// Describes a possibly non-integer Telegram Star amount type StarAmount struct { meta - // The integer amount of Telegram Stars rounded to 0 + // The integer Telegram Star amount rounded to 0 StarCount int64 `json:"star_count"` // The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 NanostarCount int32 `json:"nanostar_count"` @@ -8989,7 +9066,7 @@ type StarSubscriptionPricing struct { meta // The number of seconds between consecutive Telegram Star debiting Period int32 `json:"period"` - // The amount of Telegram Stars that must be paid for each period + // The Telegram Star amount that must be paid for each period StarCount int64 `json:"star_count"` } @@ -9315,7 +9392,7 @@ type AffiliateInfo struct { CommissionPerMille int32 `json:"commission_per_mille"` // Identifier of the chat which received the commission AffiliateChatId int64 `json:"affiliate_chat_id"` - // The amount of Telegram Stars that were received by the affiliate; can be negative for refunds + // The Telegram Star amount that was received by the affiliate; can be negative for refunds StarAmount *StarAmount `json:"star_amount"` } @@ -9572,7 +9649,7 @@ type PremiumGiftPaymentOption struct { Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible + // The alternative Telegram Star amount to pay; 0 if payment in Telegram Stars is not possible StarCount int64 `json:"star_count"` // The discount associated with this option, as a percentage DiscountPercentage int32 `json:"discount_percentage"` @@ -9682,7 +9759,7 @@ func (*PremiumGiveawayPaymentOptions) GetType() string { // Contains information about a Telegram Premium gift code type PremiumGiftCodeInfo struct { meta - // Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used + // Identifier of a chat or a user who created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used CreatorId MessageSender `json:"creator_id"` // Point in time (Unix timestamp) when the code was created CreationDate int32 `json:"creation_date"` @@ -10342,6 +10419,158 @@ func (upgradedGiftOriginOffer *UpgradedGiftOriginOffer) UnmarshalJSON(data []byt return nil } +// The gift was crafted from other gifts +type UpgradedGiftOriginCraft struct{ + meta +} + +func (entity *UpgradedGiftOriginCraft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginCraft + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginCraft) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginCraft) GetType() string { + return TypeUpgradedGiftOriginCraft +} + +func (*UpgradedGiftOriginCraft) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginCraft +} + +// The rarity is represented as the numeric frequence of the model +type UpgradedGiftAttributeRarityPerMille struct { + meta + // The number of upgraded gifts that receive this attribute for each 1000 gifts upgraded; if 0, then it can be shown as "<0.1%" + PerMille int32 `json:"per_mille"` +} + +func (entity *UpgradedGiftAttributeRarityPerMille) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityPerMille + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityPerMille) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityPerMille) GetType() string { + return TypeUpgradedGiftAttributeRarityPerMille +} + +func (*UpgradedGiftAttributeRarityPerMille) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityPerMille +} + +// The attribute is uncommon +type UpgradedGiftAttributeRarityUncommon struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityUncommon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityUncommon + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityUncommon) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityUncommon) GetType() string { + return TypeUpgradedGiftAttributeRarityUncommon +} + +func (*UpgradedGiftAttributeRarityUncommon) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityUncommon +} + +// The attribute is rare +type UpgradedGiftAttributeRarityRare struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityRare) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityRare + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityRare) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityRare) GetType() string { + return TypeUpgradedGiftAttributeRarityRare +} + +func (*UpgradedGiftAttributeRarityRare) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityRare +} + +// The attribute is epic +type UpgradedGiftAttributeRarityEpic struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityEpic) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityEpic + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityEpic) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityEpic) GetType() string { + return TypeUpgradedGiftAttributeRarityEpic +} + +func (*UpgradedGiftAttributeRarityEpic) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityEpic +} + +// The attribute is legendary +type UpgradedGiftAttributeRarityLegendary struct{ + meta +} + +func (entity *UpgradedGiftAttributeRarityLegendary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftAttributeRarityLegendary + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftAttributeRarityLegendary) GetClass() string { + return ClassUpgradedGiftAttributeRarity +} + +func (*UpgradedGiftAttributeRarityLegendary) GetType() string { + return TypeUpgradedGiftAttributeRarityLegendary +} + +func (*UpgradedGiftAttributeRarityLegendary) UpgradedGiftAttributeRarityType() string { + return TypeUpgradedGiftAttributeRarityLegendary +} + // Describes a model of an upgraded gift type UpgradedGiftModel struct { meta @@ -10349,8 +10578,10 @@ type UpgradedGiftModel struct { Name string `json:"name"` // The sticker representing the upgraded gift Sticker *Sticker `json:"sticker"` - // The number of upgraded gifts that receive this model for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the model + Rarity UpgradedGiftAttributeRarity `json:"rarity"` + // True, if the model can be obtained only through gift crafting + IsCrafted bool `json:"is_crafted"` } func (entity *UpgradedGiftModel) MarshalJSON() ([]byte, error) { @@ -10369,6 +10600,29 @@ func (*UpgradedGiftModel) GetType() string { return TypeUpgradedGiftModel } +func (upgradedGiftModel *UpgradedGiftModel) UnmarshalJSON(data []byte) error { + var tmp struct { + Name string `json:"name"` + Sticker *Sticker `json:"sticker"` + Rarity json.RawMessage `json:"rarity"` + IsCrafted bool `json:"is_crafted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftModel.Name = tmp.Name + upgradedGiftModel.Sticker = tmp.Sticker + upgradedGiftModel.IsCrafted = tmp.IsCrafted + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftModel.Rarity = fieldRarity + + return nil +} + // Describes a symbol shown on the pattern of an upgraded gift type UpgradedGiftSymbol struct { meta @@ -10376,8 +10630,8 @@ type UpgradedGiftSymbol struct { Name string `json:"name"` // The sticker representing the symbol Sticker *Sticker `json:"sticker"` - // The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the symbol + Rarity UpgradedGiftAttributeRarity `json:"rarity"` } func (entity *UpgradedGiftSymbol) MarshalJSON() ([]byte, error) { @@ -10396,6 +10650,27 @@ func (*UpgradedGiftSymbol) GetType() string { return TypeUpgradedGiftSymbol } +func (upgradedGiftSymbol *UpgradedGiftSymbol) UnmarshalJSON(data []byte) error { + var tmp struct { + Name string `json:"name"` + Sticker *Sticker `json:"sticker"` + Rarity json.RawMessage `json:"rarity"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftSymbol.Name = tmp.Name + upgradedGiftSymbol.Sticker = tmp.Sticker + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftSymbol.Rarity = fieldRarity + + return nil +} + // Describes colors of a backdrop of an upgraded gift type UpgradedGiftBackdropColors struct { meta @@ -10434,8 +10709,8 @@ type UpgradedGiftBackdrop struct { Name string `json:"name"` // Colors of the backdrop Colors *UpgradedGiftBackdropColors `json:"colors"` - // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded - RarityPerMille int32 `json:"rarity_per_mille"` + // The rarity of the backdrop + Rarity UpgradedGiftAttributeRarity `json:"rarity"` } func (entity *UpgradedGiftBackdrop) MarshalJSON() ([]byte, error) { @@ -10454,6 +10729,29 @@ func (*UpgradedGiftBackdrop) GetType() string { return TypeUpgradedGiftBackdrop } +func (upgradedGiftBackdrop *UpgradedGiftBackdrop) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Name string `json:"name"` + Colors *UpgradedGiftBackdropColors `json:"colors"` + Rarity json.RawMessage `json:"rarity"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + upgradedGiftBackdrop.Id = tmp.Id + upgradedGiftBackdrop.Name = tmp.Name + upgradedGiftBackdrop.Colors = tmp.Colors + + fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) + upgradedGiftBackdrop.Rarity = fieldRarity + + return nil +} + // Describes the original details about the gift type UpgradedGiftOriginalDetails struct { meta @@ -10617,6 +10915,10 @@ type UpgradedGift struct { TotalUpgradedCount int32 `json:"total_upgraded_count"` // The maximum number of gifts that can be upgraded from the same gift MaxUpgradedCount int32 `json:"max_upgraded_count"` + // True, if the gift was used to craft another gift + IsBurned bool `json:"is_burned"` + // True, if the gift was craft from another gifts + IsCrafted bool `json:"is_crafted"` // True, if the original gift could have been bought only by Telegram Premium subscribers IsPremium bool `json:"is_premium"` // True, if the gift can be used to set a theme in a chat @@ -10641,12 +10943,14 @@ type UpgradedGift struct { Backdrop *UpgradedGiftBackdrop `json:"backdrop"` // Information about the originally sent gift; may be null if unknown OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` - // Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none + // Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none or unknown Colors *UpgradedGiftColors `json:"colors"` // Resale parameters of the gift; may be null if resale isn't possible ResaleParameters *GiftResaleParameters `json:"resale_parameters"` // True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` + // Probability that the gift adds to the chance of successful crafting of a new gift; 0 if the gift can't be used for crafting + CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` // ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable ValueCurrency string `json:"value_currency"` // Estimated value of the gift; in the smallest units of the currency; 0 if unavailable @@ -10681,6 +10985,8 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { Number int32 `json:"number"` TotalUpgradedCount int32 `json:"total_upgraded_count"` MaxUpgradedCount int32 `json:"max_upgraded_count"` + IsBurned bool `json:"is_burned"` + IsCrafted bool `json:"is_crafted"` IsPremium bool `json:"is_premium"` IsThemeAvailable bool `json:"is_theme_available"` UsedThemeChatId int64 `json:"used_theme_chat_id"` @@ -10696,6 +11002,7 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { Colors *UpgradedGiftColors `json:"colors"` ResaleParameters *GiftResaleParameters `json:"resale_parameters"` CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` + CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` ValueCurrency string `json:"value_currency"` ValueAmount int64 `json:"value_amount"` ValueUsdAmount int64 `json:"value_usd_amount"` @@ -10714,6 +11021,8 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.Number = tmp.Number upgradedGift.TotalUpgradedCount = tmp.TotalUpgradedCount upgradedGift.MaxUpgradedCount = tmp.MaxUpgradedCount + upgradedGift.IsBurned = tmp.IsBurned + upgradedGift.IsCrafted = tmp.IsCrafted upgradedGift.IsPremium = tmp.IsPremium upgradedGift.IsThemeAvailable = tmp.IsThemeAvailable upgradedGift.UsedThemeChatId = tmp.UsedThemeChatId @@ -10727,6 +11036,7 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.Colors = tmp.Colors upgradedGift.ResaleParameters = tmp.ResaleParameters upgradedGift.CanSendPurchaseOffer = tmp.CanSendPurchaseOffer + upgradedGift.CraftProbabilityPerMille = tmp.CraftProbabilityPerMille upgradedGift.ValueCurrency = tmp.ValueCurrency upgradedGift.ValueAmount = tmp.ValueAmount upgradedGift.ValueUsdAmount = tmp.ValueUsdAmount @@ -10751,7 +11061,7 @@ type UpgradedGiftValueInfo struct { IsValueAverage bool `json:"is_value_average"` // Point in time (Unix timestamp) when the corresponding regular gift was originally purchased InitialSaleDate int32 `json:"initial_sale_date"` - // Amount of Telegram Stars that were paid for the gift + // The Telegram Star amount that was paid for the gift InitialSaleStarCount int64 `json:"initial_sale_star_count"` // Initial price of the gift; in the smallest units of the currency InitialSalePrice int64 `json:"initial_sale_price"` @@ -10828,6 +11138,112 @@ func (*UpgradeGiftResult) GetType() string { return TypeUpgradeGiftResult } +// Crafting was successful +type CraftGiftResultSuccess struct { + meta + // The created gift + Gift *UpgradedGift `json:"gift"` + // Unique identifier of the received gift for the current user + ReceivedGiftId string `json:"received_gift_id"` +} + +func (entity *CraftGiftResultSuccess) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultSuccess + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultSuccess) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultSuccess) GetType() string { + return TypeCraftGiftResultSuccess +} + +func (*CraftGiftResultSuccess) CraftGiftResultType() string { + return TypeCraftGiftResultSuccess +} + +// Crafting isn't possible because one of the gifts can't be used for crafting yet +type CraftGiftResultTooEarly struct { + meta + // Time left before the gift can be used for crafting + RetryAfter int32 `json:"retry_after"` +} + +func (entity *CraftGiftResultTooEarly) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultTooEarly + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultTooEarly) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultTooEarly) GetType() string { + return TypeCraftGiftResultTooEarly +} + +func (*CraftGiftResultTooEarly) CraftGiftResultType() string { + return TypeCraftGiftResultTooEarly +} + +// Crafting isn't possible because one of the gifts isn't suitable for crafting +type CraftGiftResultInvalidGift struct{ + meta +} + +func (entity *CraftGiftResultInvalidGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultInvalidGift + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultInvalidGift) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultInvalidGift) GetType() string { + return TypeCraftGiftResultInvalidGift +} + +func (*CraftGiftResultInvalidGift) CraftGiftResultType() string { + return TypeCraftGiftResultInvalidGift +} + +// Crafting has failed +type CraftGiftResultFail struct{ + meta +} + +func (entity *CraftGiftResultFail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CraftGiftResultFail + + return json.Marshal((*stub)(entity)) +} + +func (*CraftGiftResultFail) GetClass() string { + return ClassCraftGiftResult +} + +func (*CraftGiftResultFail) GetType() string { + return TypeCraftGiftResultFail +} + +func (*CraftGiftResultFail) CraftGiftResultType() string { + return TypeCraftGiftResultFail +} + // Describes a gift that is available for purchase type AvailableGift struct { meta @@ -10885,7 +11301,7 @@ type GiftUpgradePrice struct { meta // Point in time (Unix timestamp) when the price will be in effect Date int32 `json:"date"` - // The amount of Telegram Stars required to pay to upgrade the gift + // The Telegram Star amount required to pay to upgrade the gift StarCount int64 `json:"star_count"` } @@ -11195,8 +11611,10 @@ func (*GiftsForResale) GetType() string { } // Operation was successfully completed -type GiftResaleResultOk struct{ +type GiftResaleResultOk struct { meta + // Unique identifier of the received gift; only for the gifts sent to the current user + ReceivedGiftId string `json:"received_gift_id"` } func (entity *GiftResaleResultOk) MarshalJSON() ([]byte, error) { @@ -11363,6 +11781,8 @@ type ReceivedGift struct { ExportDate int32 `json:"export_date"` // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` + // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + CraftDate int32 `json:"craft_date"` } func (entity *ReceivedGift) MarshalJSON() ([]byte, error) { @@ -11405,6 +11825,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` + CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -11432,6 +11853,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.NextResaleDate = tmp.NextResaleDate receivedGift.ExportDate = tmp.ExportDate receivedGift.PrepaidUpgradeHash = tmp.PrepaidUpgradeHash + receivedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) receivedGift.SenderId = fieldSenderId @@ -11471,6 +11893,58 @@ func (*ReceivedGifts) GetType() string { return TypeReceivedGifts } +// Describes chance of the crafted gift to have the backdrop or symbol of one of the original gifts +type AttributeCraftPersistenceProbability struct { + meta + // The 4 numbers that describe probability of the craft result to have the same attribute as one of the original gifts if 1, 2, 3, or 4 gifts with the attribute are used in the craft. Each number represents the number of crafted gifts with the original attribute per 1000 successful craftings + PersistenceChancePerMille []int32 `json:"persistence_chance_per_mille"` +} + +func (entity *AttributeCraftPersistenceProbability) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AttributeCraftPersistenceProbability + + return json.Marshal((*stub)(entity)) +} + +func (*AttributeCraftPersistenceProbability) GetClass() string { + return ClassAttributeCraftPersistenceProbability +} + +func (*AttributeCraftPersistenceProbability) GetType() string { + return TypeAttributeCraftPersistenceProbability +} + +// Represents a list of gifts received by a user or a chat +type GiftsForCrafting struct { + meta + // The total number of received gifts + TotalCount int32 `json:"total_count"` + // The list of gifts + Gifts []*ReceivedGift `json:"gifts"` + // The 4 objects that describe probabilities of the crafted gift to have the backdrop or symbol of one of the original gifts for the cases when 1, 2, 3 or 4 gifts are used in the craft correspondingly + AttributePersistenceProbabilities []*AttributeCraftPersistenceProbability `json:"attribute_persistence_probabilities"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *GiftsForCrafting) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftsForCrafting + + return json.Marshal((*stub)(entity)) +} + +func (*GiftsForCrafting) GetClass() string { + return ClassGiftsForCrafting +} + +func (*GiftsForCrafting) GetType() string { + return TypeGiftsForCrafting +} + // Contains examples of possible upgraded gifts for the given regular gift type GiftUpgradePreview struct { meta @@ -12019,7 +12493,7 @@ func (*StarTransactionTypeFragmentDeposit) StarTransactionTypeType() string { // The transaction is a deposit of Telegram Stars by another user; relevant for regular users only type StarTransactionTypeUserDeposit struct { meta - // Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous + // Identifier of the user who gifted Telegram Stars; 0 if the user was anonymous UserId int64 `json:"user_id"` // The sticker to be shown in the transaction information; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -12172,7 +12646,7 @@ func (*StarTransactionTypeTelegramApiUsage) StarTransactionTypeType() string { // The transaction is a purchase of paid media from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotPaidMediaPurchase struct { meta - // Identifier of the bot or the business account user that sent the paid media + // Identifier of the bot or the business account user who sent the paid media UserId int64 `json:"user_id"` // The bought media if the transaction wasn't refunded Media []PaidMedia `json:"media"` @@ -12220,7 +12694,7 @@ func (starTransactionTypeBotPaidMediaPurchase *StarTransactionTypeBotPaidMediaPu // The transaction is a sale of paid media by the bot or a business account managed by the bot; relevant for bots only type StarTransactionTypeBotPaidMediaSale struct { meta - // Identifier of the user that bought the media + // Identifier of the user who bought the media UserId int64 `json:"user_id"` // The bought media Media []PaidMedia `json:"media"` @@ -12328,7 +12802,7 @@ func (starTransactionTypeChannelPaidMediaPurchase *StarTransactionTypeChannelPai // The transaction is a sale of paid media by the channel chat; relevant for channel chats only type StarTransactionTypeChannelPaidMediaSale struct { meta - // Identifier of the user that bought the media + // Identifier of the user who bought the media UserId int64 `json:"user_id"` // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` @@ -12380,7 +12854,7 @@ func (starTransactionTypeChannelPaidMediaSale *StarTransactionTypeChannelPaidMed // The transaction is a purchase of a product from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotInvoicePurchase struct { meta - // Identifier of the bot or the business account user that created the invoice + // Identifier of the bot or the business account user who created the invoice UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -12409,7 +12883,7 @@ func (*StarTransactionTypeBotInvoicePurchase) StarTransactionTypeType() string { // The transaction is a sale of a product by the bot; relevant for bots only type StarTransactionTypeBotInvoiceSale struct { meta - // Identifier of the user that bought the product + // Identifier of the user who bought the product UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -12442,7 +12916,7 @@ func (*StarTransactionTypeBotInvoiceSale) StarTransactionTypeType() string { // The transaction is a purchase of a subscription from a bot or a business account by the current user; relevant for regular users only type StarTransactionTypeBotSubscriptionPurchase struct { meta - // Identifier of the bot or the business account user that created the subscription link + // Identifier of the bot or the business account user who created the subscription link UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -12473,7 +12947,7 @@ func (*StarTransactionTypeBotSubscriptionPurchase) StarTransactionTypeType() str // The transaction is a sale of a subscription by the bot; relevant for bots only type StarTransactionTypeBotSubscriptionSale struct { meta - // Identifier of the user that bought the subscription + // Identifier of the user who bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -12537,7 +13011,7 @@ func (*StarTransactionTypeChannelSubscriptionPurchase) StarTransactionTypeType() // The transaction is a sale of a subscription by the channel chat; relevant for channel chats only type StarTransactionTypeChannelSubscriptionSale struct { meta - // Identifier of the user that bought the subscription + // Identifier of the user who bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -12566,7 +13040,7 @@ func (*StarTransactionTypeChannelSubscriptionSale) StarTransactionTypeType() str // The transaction is a bid on a gift auction; relevant for regular users only type StarTransactionTypeGiftAuctionBid struct { meta - // Identifier of the user that will receive the gift + // Identifier of the user who will receive the gift OwnerId MessageSender `json:"owner_id"` // The gift Gift *Gift `json:"gift"` @@ -12785,7 +13259,7 @@ func (starTransactionTypeGiftOriginalDetailsDrop *StarTransactionTypeGiftOrigina // The transaction is a sale of a received gift; relevant for regular users and channel chats only type StarTransactionTypeGiftSale struct { meta - // Identifier of the user that sent the gift + // Identifier of the user who sent the gift UserId int64 `json:"user_id"` // The gift Gift *Gift `json:"gift"` @@ -12814,7 +13288,7 @@ func (*StarTransactionTypeGiftSale) StarTransactionTypeType() string { // The transaction is an upgrade of a gift; relevant for regular users only type StarTransactionTypeGiftUpgrade struct { meta - // Identifier of the user that initially sent the gift + // Identifier of the user who initially sent the gift UserId int64 `json:"user_id"` // The upgraded gift Gift *UpgradedGift `json:"gift"` @@ -12891,7 +13365,7 @@ func (starTransactionTypeGiftUpgradePurchase *StarTransactionTypeGiftUpgradePurc // The transaction is a purchase of an upgraded gift for some user or channel; relevant for regular users only type StarTransactionTypeUpgradedGiftPurchase struct { meta - // Identifier of the user that sold the gift + // Identifier of the user who sold the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` @@ -12920,13 +13394,13 @@ func (*StarTransactionTypeUpgradedGiftPurchase) StarTransactionTypeType() string // The transaction is a sale of an upgraded gift; relevant for regular users only type StarTransactionTypeUpgradedGiftSale struct { meta - // Identifier of the user that bought the gift + // Identifier of the user who bought the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Telegram Stars that were received by Telegram; can be negative for refunds + // The Telegram Star amount that was received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` // True, if the gift was sold through a purchase offer ViaOffer bool `json:"via_offer"` @@ -12984,7 +13458,7 @@ func (*StarTransactionTypeChannelPaidReactionSend) StarTransactionTypeType() str // The transaction is a receiving of a paid reaction to a message by the channel chat; relevant for channel chats only type StarTransactionTypeChannelPaidReactionReceive struct { meta - // Identifier of the user that added the paid reaction + // Identifier of the user who added the paid reaction UserId int64 `json:"user_id"` // Identifier of the reacted message; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` @@ -13077,7 +13551,7 @@ type StarTransactionTypePaidMessageReceive struct { MessageCount int32 `json:"message_count"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Telegram Stars that were received by Telegram; can be negative for refunds + // The Telegram Star amount that was received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` } @@ -13158,7 +13632,7 @@ type StarTransactionTypePaidGroupCallMessageReceive struct { SenderId MessageSender `json:"sender_id"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Telegram Stars that were received by Telegram; can be negative for refunds + // The Telegram Star amount that was received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` } @@ -13237,7 +13711,7 @@ type StarTransactionTypePaidGroupCallReactionReceive struct { SenderId MessageSender `json:"sender_id"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for reaction sending CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Telegram Stars that were received by Telegram; can be negative for refunds + // The Telegram Star amount that was received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` } @@ -13312,7 +13786,7 @@ func (*StarTransactionTypeSuggestedPostPaymentSend) StarTransactionTypeType() st // The transaction is a receiving of a payment for a suggested post by the channel chat; relevant for channel chats only type StarTransactionTypeSuggestedPostPaymentReceive struct { meta - // Identifier of the user that paid for the suggested post + // Identifier of the user who paid for the suggested post UserId int64 `json:"user_id"` } @@ -13339,7 +13813,7 @@ func (*StarTransactionTypeSuggestedPostPaymentReceive) StarTransactionTypeType() // The transaction is a purchase of Telegram Premium subscription; relevant for regular users and bots only type StarTransactionTypePremiumPurchase struct { meta - // Identifier of the user that received the Telegram Premium subscription + // Identifier of the user who received the Telegram Premium subscription UserId int64 `json:"user_id"` // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` @@ -13397,7 +13871,7 @@ func (*StarTransactionTypeBusinessBotTransferSend) StarTransactionTypeType() str // The transaction is a transfer of Telegram Stars from a business account; relevant for bots only type StarTransactionTypeBusinessBotTransferReceive struct { meta - // Identifier of the user that sent Telegram Stars + // Identifier of the user who sent Telegram Stars UserId int64 `json:"user_id"` } @@ -13683,7 +14157,7 @@ func (*TonTransactionTypeGiftPurchaseOffer) TonTransactionTypeType() string { // The transaction is a purchase of an upgraded gift for some user or channel type TonTransactionTypeUpgradedGiftPurchase struct { meta - // Identifier of the user that sold the gift + // Identifier of the user who sold the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` @@ -13712,13 +14186,13 @@ func (*TonTransactionTypeUpgradedGiftPurchase) TonTransactionTypeType() string { // The transaction is a sale of an upgraded gift type TonTransactionTypeUpgradedGiftSale struct { meta - // Identifier of the user that bought the gift + // Identifier of the user who bought the gift UserId int64 `json:"user_id"` // The gift Gift *UpgradedGift `json:"gift"` // The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift CommissionPerMille int32 `json:"commission_per_mille"` - // The amount of Toncoins that were received by the Telegram; in the smallest units of the currency + // The Toncoin amount that was received by the Telegram; in the smallest units of the currency CommissionToncoinAmount int64 `json:"commission_toncoin_amount"` // True, if the gift was sold through a purchase offer ViaOffer bool `json:"via_offer"` @@ -13744,6 +14218,56 @@ func (*TonTransactionTypeUpgradedGiftSale) TonTransactionTypeType() string { return TypeTonTransactionTypeUpgradedGiftSale } +// The transaction is a payment for stake dice throw +type TonTransactionTypeStakeDiceStake struct{ + meta +} + +func (entity *TonTransactionTypeStakeDiceStake) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeStakeDiceStake + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeStakeDiceStake) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeStakeDiceStake) GetType() string { + return TypeTonTransactionTypeStakeDiceStake +} + +func (*TonTransactionTypeStakeDiceStake) TonTransactionTypeType() string { + return TypeTonTransactionTypeStakeDiceStake +} + +// The transaction is a payment for successful stake dice throw +type TonTransactionTypeStakeDicePayout struct{ + meta +} + +func (entity *TonTransactionTypeStakeDicePayout) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeStakeDicePayout + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeStakeDicePayout) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeStakeDicePayout) GetType() string { + return TypeTonTransactionTypeStakeDicePayout +} + +func (*TonTransactionTypeStakeDicePayout) TonTransactionTypeType() string { + return TypeTonTransactionTypeStakeDicePayout +} + // The transaction is a transaction of an unsupported type type TonTransactionTypeUnsupported struct{ meta @@ -14129,7 +14653,7 @@ type GiveawayInfoCompleted struct { ActivationCount int32 `json:"activation_count"` // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway GiftCode string `json:"gift_code"` - // The amount of Telegram Stars won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway + // The Telegram Star amount won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway WonStarCount int64 `json:"won_star_count"` } @@ -15252,7 +15776,7 @@ type ChatMember struct { meta // Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels MemberId MessageSender `json:"member_id"` - // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown + // Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int64 `json:"inviter_user_id"` // Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat JoinedChatDate int32 `json:"joined_chat_date"` @@ -16118,7 +16642,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { return nil } -// Describes a user that sent a join request and waits for administrator approval +// Describes a user who sent a join request and waits for administrator approval type ChatJoinRequest struct { meta // User identifier @@ -16795,7 +17319,7 @@ func (*PublicPostSearchLimits) GetType() string { // The message was sent by a known user type MessageSenderUser struct { meta - // Identifier of the user that sent the message + // Identifier of the user who sent the message UserId int64 `json:"user_id"` } @@ -17135,7 +17659,7 @@ func (*MessageViewers) GetType() string { // The message was originally sent by a known user type MessageOriginUser struct { meta - // Identifier of the user that originally sent the message + // Identifier of the user who originally sent the message SenderUserId int64 `json:"sender_user_id"` } @@ -17462,7 +17986,7 @@ func (*PaidReactionTypeChat) PaidReactionTypeType() string { return TypePaidReactionTypeChat } -// Contains information about a user that added paid reactions +// Contains information about a user who added paid reactions type PaidReactor struct { meta // Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user @@ -21055,7 +21579,7 @@ func (*Chats) GetType() string { return TypeChats } -// Contains information about a user that has failed to be added to a chat +// Contains information about a user who has failed to be added to a chat type FailedToAddMember struct { meta // User identifier @@ -21180,7 +21704,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// Contains basic information about another user that started a chat with the current user +// Contains basic information about another user who started a chat with the current user type AccountInfo struct { meta // Month when the user was registered in Telegram; 0-12; may be 0 if unknown @@ -21373,6 +21897,106 @@ func (*ChatActionBarJoinRequest) ChatActionBarType() string { return TypeChatActionBarJoinRequest } +// The button has default style +type ButtonStyleDefault struct{ + meta +} + +func (entity *ButtonStyleDefault) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleDefault + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleDefault) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleDefault) GetType() string { + return TypeButtonStyleDefault +} + +func (*ButtonStyleDefault) ButtonStyleType() string { + return TypeButtonStyleDefault +} + +// The button has dark blue color +type ButtonStylePrimary struct{ + meta +} + +func (entity *ButtonStylePrimary) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStylePrimary + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStylePrimary) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStylePrimary) GetType() string { + return TypeButtonStylePrimary +} + +func (*ButtonStylePrimary) ButtonStyleType() string { + return TypeButtonStylePrimary +} + +// The button has red color +type ButtonStyleDanger struct{ + meta +} + +func (entity *ButtonStyleDanger) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleDanger + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleDanger) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleDanger) GetType() string { + return TypeButtonStyleDanger +} + +func (*ButtonStyleDanger) ButtonStyleType() string { + return TypeButtonStyleDanger +} + +// The button has green color +type ButtonStyleSuccess struct{ + meta +} + +func (entity *ButtonStyleSuccess) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ButtonStyleSuccess + + return json.Marshal((*stub)(entity)) +} + +func (*ButtonStyleSuccess) GetClass() string { + return ClassButtonStyle +} + +func (*ButtonStyleSuccess) GetType() string { + return TypeButtonStyleSuccess +} + +func (*ButtonStyleSuccess) ButtonStyleType() string { + return TypeButtonStyleSuccess +} + // A simple button, with text that must be sent when the button is pressed type KeyboardButtonTypeText struct{ meta @@ -21603,6 +22227,10 @@ type KeyboardButton struct { meta // Text of the button Text string `json:"text"` + // Identifier of the custom emoji that must be shown on the button; 0 if none + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + // Style of the button + Style ButtonStyle `json:"style"` // Type of the button Type KeyboardButtonType `json:"type"` } @@ -21626,6 +22254,8 @@ func (*KeyboardButton) GetType() string { func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -21635,6 +22265,10 @@ func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { } keyboardButton.Text = tmp.Text + keyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId + + fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) + keyboardButton.Style = fieldStyle fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type) keyboardButton.Type = fieldType @@ -21938,6 +22572,10 @@ type InlineKeyboardButton struct { meta // Text of the button Text string `json:"text"` + // Identifier of the custom emoji that must be shown on the button; 0 if none + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + // Style of the button + Style ButtonStyle `json:"style"` // Type of the button Type InlineKeyboardButtonType `json:"type"` } @@ -21961,6 +22599,8 @@ func (*InlineKeyboardButton) GetType() string { func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` + IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` + Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -21970,6 +22610,10 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err } inlineKeyboardButton.Text = tmp.Text + inlineKeyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId + + fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) + inlineKeyboardButton.Style = fieldStyle fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) inlineKeyboardButton.Type = fieldType @@ -22137,6 +22781,16 @@ type LoginUrlInfoRequestConfirmation struct { BotUserId int64 `json:"bot_user_id"` // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` + // True, if the user must be asked for the permission to share their phone number + RequestPhoneNumberAccess bool `json:"request_phone_number_access"` + // The version of a browser used for the authorization; may be empty if irrelevant + Browser string `json:"browser"` + // Operating system the browser is running on; may be empty if irrelevant + Platform string `json:"platform"` + // IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant + IpAddress string `json:"ip_address"` + // Human-readable description of a country and a region from which the authorization is performed, based on the IP address; may be empty if irrelevant + Location string `json:"location"` } func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { @@ -30838,9 +31492,9 @@ type MessageStakeDice struct { FinalState DiceStickers `json:"final_state"` // The dice value. If the value is 0, then the dice don't have final state yet Value int32 `json:"value"` - // The amount of Toncoins that were staked; in the smallest units of the currency + // The Toncoin amount that was staked; in the smallest units of the currency StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // The amount of Toncoins that were gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet + // The Toncoin amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` } @@ -31080,6 +31734,8 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { // A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden type MessageGroupCall struct { meta + // Persistent unique group call identifier + UniqueId JsonInt64 `json:"unique_id"` // True, if the call is active, i.e. the called user joined the call IsActive bool `json:"is_active"` // True, if the called user missed or declined the call @@ -31114,6 +31770,7 @@ func (*MessageGroupCall) MessageContentType() string { func (messageGroupCall *MessageGroupCall) UnmarshalJSON(data []byte) error { var tmp struct { + UniqueId JsonInt64 `json:"unique_id"` IsActive bool `json:"is_active"` WasMissed bool `json:"was_missed"` IsVideo bool `json:"is_video"` @@ -31126,6 +31783,7 @@ func (messageGroupCall *MessageGroupCall) UnmarshalJSON(data []byte) error { return err } + messageGroupCall.UniqueId = tmp.UniqueId messageGroupCall.IsActive = tmp.IsActive messageGroupCall.WasMissed = tmp.WasMissed messageGroupCall.IsVideo = tmp.IsVideo @@ -31384,6 +32042,60 @@ func (*MessageChatDeletePhoto) MessageContentType() string { return TypeMessageChatDeletePhoto } +// The owner of the chat has left +type MessageChatOwnerLeft struct { + meta + // Identifier of the user who will become the new owner of the chat if the previous owner isn't return; 0 if none + NewOwnerUserId int64 `json:"new_owner_user_id"` +} + +func (entity *MessageChatOwnerLeft) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatOwnerLeft + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatOwnerLeft) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatOwnerLeft) GetType() string { + return TypeMessageChatOwnerLeft +} + +func (*MessageChatOwnerLeft) MessageContentType() string { + return TypeMessageChatOwnerLeft +} + +// The owner of the chat has changed +type MessageChatOwnerChanged struct { + meta + // Identifier of the user who is the new owner of the chat + NewOwnerUserId int64 `json:"new_owner_user_id"` +} + +func (entity *MessageChatOwnerChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatOwnerChanged + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatOwnerChanged) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatOwnerChanged) GetType() string { + return TypeMessageChatOwnerChanged +} + +func (*MessageChatOwnerChanged) MessageContentType() string { + return TypeMessageChatOwnerChanged +} + // New chat members were added type MessageChatAddMembers struct { meta @@ -32107,9 +32819,9 @@ func (messagePaymentRefunded *MessagePaymentRefunded) UnmarshalJSON(data []byte) // Telegram Premium was gifted to a user type MessageGiftedPremium struct { meta - // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Telegram Premium; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Telegram Premium; 0 if the gift is incoming + // The identifier of a user who received Telegram Premium; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Message added to the gifted Telegram Premium by the sender Text *FormattedText `json:"text"` @@ -32152,7 +32864,7 @@ func (*MessageGiftedPremium) MessageContentType() string { // A Telegram Premium gift code was created for the user type MessagePremiumGiftCode struct { meta - // Identifier of a chat or a user that created the gift code; may be null if unknown + // Identifier of a chat or a user who created the gift code; may be null if unknown CreatorId MessageSender `json:"creator_id"` // Message added to the gift Text *FormattedText `json:"text"` @@ -32440,9 +33152,9 @@ func (messageGiveawayWinners *MessageGiveawayWinners) UnmarshalJSON(data []byte) // Telegram Stars were gifted to a user type MessageGiftedStars struct { meta - // The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Telegram Stars; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Telegram Stars; 0 if the gift is incoming + // The identifier of a user who received Telegram Stars; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Currency for the paid amount Currency string `json:"currency"` @@ -32483,11 +33195,11 @@ func (*MessageGiftedStars) MessageContentType() string { // Toncoins were gifted to a user type MessageGiftedTon struct { meta - // The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing + // The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user that received Toncoins; 0 if the gift is incoming + // The identifier of a user who received Toncoins; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` - // The received amount of Toncoins, in the smallest units of the cryptocurrency + // The received Toncoin amount, in the smallest units of the cryptocurrency TonAmount int64 `json:"ton_amount"` // Identifier of the transaction for Toncoin credit; for receiver only TransactionId string `json:"transaction_id"` @@ -32699,6 +33411,8 @@ type MessageUpgradedGift struct { NextResaleDate int32 `json:"next_resale_date"` // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` + // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift + CraftDate int32 `json:"craft_date"` } func (entity *MessageUpgradedGift) MarshalJSON() ([]byte, error) { @@ -32736,6 +33450,7 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error NextTransferDate int32 `json:"next_transfer_date"` NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` + CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -32753,6 +33468,7 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error messageUpgradedGift.NextTransferDate = tmp.NextTransferDate messageUpgradedGift.NextResaleDate = tmp.NextResaleDate messageUpgradedGift.ExportDate = tmp.ExportDate + messageUpgradedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageUpgradedGift.SenderId = fieldSenderId @@ -35508,7 +36224,7 @@ type InputMessageStakeDice struct { meta // Hash of the stake dice state. The state hash can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState StateHash string `json:"state_hash"` - // The amount of Toncoins that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") + // The Toncoin amount that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") StakeToncoinAmount int64 `json:"stake_toncoin_amount"` // True, if the chat message draft must be deleted ClearDraft bool `json:"clear_draft"` @@ -38019,6 +38735,106 @@ func (*StoryVideo) GetType() string { return TypeStoryVideo } +// A photo story +type StoryContentTypePhoto struct{ + meta +} + +func (entity *StoryContentTypePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypePhoto) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypePhoto) GetType() string { + return TypeStoryContentTypePhoto +} + +func (*StoryContentTypePhoto) StoryContentTypeType() string { + return TypeStoryContentTypePhoto +} + +// A video story +type StoryContentTypeVideo struct{ + meta +} + +func (entity *StoryContentTypeVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeVideo) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeVideo) GetType() string { + return TypeStoryContentTypeVideo +} + +func (*StoryContentTypeVideo) StoryContentTypeType() string { + return TypeStoryContentTypeVideo +} + +// A live story +type StoryContentTypeLive struct{ + meta +} + +func (entity *StoryContentTypeLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeLive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeLive) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeLive) GetType() string { + return TypeStoryContentTypeLive +} + +func (*StoryContentTypeLive) StoryContentTypeType() string { + return TypeStoryContentTypeLive +} + +// A story of unknown content type +type StoryContentTypeUnsupported struct{ + meta +} + +func (entity *StoryContentTypeUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentTypeUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentTypeUnsupported) GetClass() string { + return ClassStoryContentType +} + +func (*StoryContentTypeUnsupported) GetType() string { + return TypeStoryContentTypeUnsupported +} + +func (*StoryContentTypeUnsupported) StoryContentTypeType() string { + return TypeStoryContentTypeUnsupported +} + // A photo story type StoryContentPhoto struct { meta @@ -38445,7 +39261,7 @@ type Story struct { CanBeEdited bool `json:"can_be_edited"` // True, if the story can be forwarded as a message or reposted as a story. Otherwise, screenshotting and saving of the story content must be also forbidden CanBeForwarded bool `json:"can_be_forwarded"` - // True, if the story can be replied in the chat with the user that posted the story + // True, if the story can be replied in the chat with the user who posted the story CanBeReplied bool `json:"can_be_replied"` // True, if the story privacy settings can be changed CanSetPrivacySettings bool `json:"can_set_privacy_settings"` @@ -39412,7 +40228,7 @@ func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { // The chat created a giveaway type ChatBoostSourceGiveaway struct { meta - // Identifier of a user that won in the giveaway; 0 if none + // Identifier of a user who won in the giveaway; 0 if none UserId int64 `json:"user_id"` // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only GiftCode string `json:"gift_code"` @@ -40535,6 +41351,8 @@ type GroupCall struct { meta // Group call identifier Id int32 `json:"id"` + // Persistent unique group call identifier + UniqueId JsonInt64 `json:"unique_id"` // Group call title; for video chats only Title string `json:"title"` // Invite link for the group call; for group calls that aren't bound to a chat. For video chats call getVideoChatInviteLink to get the link. For live stories in chats with username call getInternalLink with internalLinkTypeLiveStory @@ -40616,6 +41434,7 @@ func (*GroupCall) GetType() string { func (groupCall *GroupCall) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` + UniqueId JsonInt64 `json:"unique_id"` Title string `json:"title"` InviteLink string `json:"invite_link"` PaidMessageStarCount int64 `json:"paid_message_star_count"` @@ -40654,6 +41473,7 @@ func (groupCall *GroupCall) UnmarshalJSON(data []byte) error { } groupCall.Id = tmp.Id + groupCall.UniqueId = tmp.UniqueId groupCall.Title = tmp.Title groupCall.InviteLink = tmp.InviteLink groupCall.PaidMessageStarCount = tmp.PaidMessageStarCount @@ -41458,6 +42278,8 @@ type Call struct { meta // Call identifier, not persistent Id int32 `json:"id"` + // Persistent unique call identifier; 0 if isn't assigned yet by the server + UniqueId JsonInt64 `json:"unique_id"` // User identifier of the other call participant UserId int64 `json:"user_id"` // True, if the call is outgoing @@ -41487,6 +42309,7 @@ func (*Call) GetType() string { func (call *Call) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` + UniqueId JsonInt64 `json:"unique_id"` UserId int64 `json:"user_id"` IsOutgoing bool `json:"is_outgoing"` IsVideo bool `json:"is_video"` @@ -41499,6 +42322,7 @@ func (call *Call) UnmarshalJSON(data []byte) error { } call.Id = tmp.Id + call.UniqueId = tmp.UniqueId call.UserId = tmp.UserId call.IsOutgoing = tmp.IsOutgoing call.IsVideo = tmp.IsVideo @@ -42128,7 +42952,7 @@ type BusinessConnection struct { meta // Unique identifier of the connection Id string `json:"id"` - // Identifier of the business user that created the connection + // Identifier of the business user who created the connection UserId int64 `json:"user_id"` // Chat identifier of the private chat with the user UserChatId int64 `json:"user_chat_id"` @@ -48074,7 +48898,7 @@ func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data [ return nil } -// A user opened an internal link of the type internalLinkTypePremiumFeatures +// A user opened an internal link of the type internalLinkTypePremiumFeaturesPage type PremiumSourceLink struct { meta // The referrer from the link @@ -49828,7 +50652,7 @@ func (*CanPostStoryResultActiveStoryLimitExceeded) CanPostStoryResultType() stri // The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time type CanPostStoryResultWeeklyLimitExceeded struct { meta - // Time left before the user can post the next story + // Time left before the user can post the next story, in seconds RetryAfter int32 `json:"retry_after"` } @@ -49855,7 +50679,7 @@ func (*CanPostStoryResultWeeklyLimitExceeded) CanPostStoryResultType() string { // The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time type CanPostStoryResultMonthlyLimitExceeded struct { meta - // Time left before the user can post the next story + // Time left before the user can post the next story, in seconds RetryAfter int32 `json:"retry_after"` } @@ -52164,6 +52988,54 @@ func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error { return nil } +// Describes a proxy server +type Proxy struct { + meta + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Type of the proxy + Type ProxyType `json:"type"` +} + +func (entity *Proxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Proxy + + return json.Marshal((*stub)(entity)) +} + +func (*Proxy) GetClass() string { + return ClassProxy +} + +func (*Proxy) GetType() string { + return TypeProxy +} + +func (proxy *Proxy) UnmarshalJSON(data []byte) error { + var tmp struct { + Server string `json:"server"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + proxy.Server = tmp.Server + proxy.Port = tmp.Port + + fieldType, _ := UnmarshalProxyType(tmp.Type) + proxy.Type = fieldType + + return nil +} + // Represents a boolean option type OptionValueBoolean struct { meta @@ -54554,29 +55426,557 @@ func (*ReportStoryResultTextRequired) ReportStoryResultType() string { return TypeReportStoryResultTextRequired } -// The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user -type InternalLinkTypeActiveSessions struct{ +// The appearance section +type SettingsSectionAppearance struct { meta + // Subsection of the section; may be one of "", "themes", "themes/edit", "themes/create", "wallpapers", "wallpapers/edit", "wallpapers/set", "wallpapers/choose-photo", "your-color/profile", "your-color/profile/add-icons", "your-color/profile/use-gift", "your-color/profile/reset", "your-color/name", "your-color/name/add-icons", "your-color/name/use-gift", "night-mode", "auto-night-mode", "text-size", "text-size/use-system", "message-corners", "animations", "stickers-and-emoji", "stickers-and-emoji/edit", "stickers-and-emoji/trending", "stickers-and-emoji/archived", "stickers-and-emoji/archived/edit", "stickers-and-emoji/emoji", "stickers-and-emoji/emoji/edit", "stickers-and-emoji/emoji/archived", "stickers-and-emoji/emoji/archived/edit", "stickers-and-emoji/emoji/suggest", "stickers-and-emoji/emoji/quick-reaction", "stickers-and-emoji/emoji/quick-reaction/choose", "stickers-and-emoji/suggest-by-emoji", "stickers-and-emoji/large-emoji", "stickers-and-emoji/dynamic-order", "stickers-and-emoji/emoji/show-more", "app-icon", "tap-for-next-media" + Subsection string `json:"subsection"` } -func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) { +func (entity *SettingsSectionAppearance) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeActiveSessions + type stub SettingsSectionAppearance return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeActiveSessions) GetClass() string { - return ClassInternalLinkType +func (*SettingsSectionAppearance) GetClass() string { + return ClassSettingsSection } -func (*InternalLinkTypeActiveSessions) GetType() string { - return TypeInternalLinkTypeActiveSessions +func (*SettingsSectionAppearance) GetType() string { + return TypeSettingsSectionAppearance } -func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { - return TypeInternalLinkTypeActiveSessions +func (*SettingsSectionAppearance) SettingsSectionType() string { + return TypeSettingsSectionAppearance +} + +// The "Ask a question" section +type SettingsSectionAskQuestion struct{ + meta +} + +func (entity *SettingsSectionAskQuestion) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionAskQuestion + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionAskQuestion) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionAskQuestion) GetType() string { + return TypeSettingsSectionAskQuestion +} + +func (*SettingsSectionAskQuestion) SettingsSectionType() string { + return TypeSettingsSectionAskQuestion +} + +// The "Telegram Business" section +type SettingsSectionBusiness struct { + meta + // Subsection of the section; may be one of "", "do-not-hide-ads" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionBusiness) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionBusiness + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionBusiness) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionBusiness) GetType() string { + return TypeSettingsSectionBusiness +} + +func (*SettingsSectionBusiness) SettingsSectionType() string { + return TypeSettingsSectionBusiness +} + +// The chat folder settings section +type SettingsSectionChatFolders struct { + meta + // Subsection of the section; may be one of "", "edit", "create", "add-recommended", "show-tags", "tab-view" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionChatFolders) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionChatFolders + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionChatFolders) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionChatFolders) GetType() string { + return TypeSettingsSectionChatFolders +} + +func (*SettingsSectionChatFolders) SettingsSectionType() string { + return TypeSettingsSectionChatFolders +} + +// The data and storage settings section +type SettingsSectionDataAndStorage struct { + meta + // Subsection of the section; may be one of "", "storage", "storage/edit", "storage/auto-remove", "storage/clear-cache", "storage/max-cache", "usage", "usage/mobile", "usage/wifi", "usage/reset", "usage/roaming", "auto-download/mobile", "auto-download/mobile/enable", "auto-download/mobile/usage", "auto-download/mobile/photos", "auto-download/mobile/stories", "auto-download/mobile/videos", "auto-download/mobile/files", "auto-download/wifi", "auto-download/wifi/enable", "auto-download/wifi/usage", "auto-download/wifi/photos", "auto-download/wifi/stories", "auto-download/wifi/videos", "auto-download/wifi/files", "auto-download/roaming", "auto-download/roaming/enable", "auto-download/roaming/usage", "auto-download/roaming/photos", "auto-download/roaming/stories", "auto-download/roaming/videos", "auto-download/roaming/files", "auto-download/reset", "save-to-photos/chats", "save-to-photos/chats/max-video-size", "save-to-photos/chats/add-exception", "save-to-photos/chats/delete-all", "save-to-photos/groups", "save-to-photos/groups/max-video-size", "save-to-photos/groups/add-exception", "save-to-photos/groups/delete-all", "save-to-photos/channels", "save-to-photos/channels/max-video-size", "save-to-photos/channels/add-exception", "save-to-photos/channels/delete-all", "less-data-calls", "open-links", "share-sheet", "share-sheet/suggested-chats", "share-sheet/suggest-by", "share-sheet/reset", "saved-edited-photos", "pause-music", "raise-to-listen", "raise-to-speak", "show-18-content", "proxy", "proxy/edit", "proxy/use-proxy", "proxy/add-proxy", "proxy/share-list", "proxy/use-for-calls" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionDataAndStorage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionDataAndStorage + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionDataAndStorage) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionDataAndStorage) GetType() string { + return TypeSettingsSectionDataAndStorage +} + +func (*SettingsSectionDataAndStorage) SettingsSectionType() string { + return TypeSettingsSectionDataAndStorage +} + +// The Devices section +type SettingsSectionDevices struct { + meta + // Subsection of the section; may be one of "", "edit", "link-desktop", "terminate-sessions", "auto-terminate" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionDevices) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionDevices + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionDevices) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionDevices) GetType() string { + return TypeSettingsSectionDevices +} + +func (*SettingsSectionDevices) SettingsSectionType() string { + return TypeSettingsSectionDevices +} + +// The profile edit section +type SettingsSectionEditProfile struct { + meta + // Subsection of the section; may be one of "", "set-photo", "first-name", "last-name", "emoji-status", "bio", "birthday", "change-number", "username", "your-color", "channel", "add-account", "log-out", "profile-color/profile", "profile-color/profile/add-icons", "profile-color/profile/use-gift", "profile-color/name", "profile-color/name/add-icons", "profile-color/name/use-gift", "profile-photo/use-emoji" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionEditProfile) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionEditProfile + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionEditProfile) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionEditProfile) GetType() string { + return TypeSettingsSectionEditProfile +} + +func (*SettingsSectionEditProfile) SettingsSectionType() string { + return TypeSettingsSectionEditProfile +} + +// The FAQ section +type SettingsSectionFaq struct{ + meta +} + +func (entity *SettingsSectionFaq) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionFaq + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionFaq) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionFaq) GetType() string { + return TypeSettingsSectionFaq +} + +func (*SettingsSectionFaq) SettingsSectionType() string { + return TypeSettingsSectionFaq +} + +// The "Telegram Features" section +type SettingsSectionFeatures struct{ + meta +} + +func (entity *SettingsSectionFeatures) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionFeatures + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionFeatures) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionFeatures) GetType() string { + return TypeSettingsSectionFeatures +} + +func (*SettingsSectionFeatures) SettingsSectionType() string { + return TypeSettingsSectionFeatures +} + +// The in-app browser settings section +type SettingsSectionInAppBrowser struct { + meta + // Subsection of the section; may be one of "", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionInAppBrowser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionInAppBrowser + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionInAppBrowser) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionInAppBrowser) GetType() string { + return TypeSettingsSectionInAppBrowser +} + +func (*SettingsSectionInAppBrowser) SettingsSectionType() string { + return TypeSettingsSectionInAppBrowser +} + +// The application language section +type SettingsSectionLanguage struct { + meta + // Subsection of the section; may be one of "", "show-button" for Show Translate Button toggle, "translate-chats" for Translate Entire Chats toggle, "do-not-translate" - for Do Not Translate language list + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionLanguage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionLanguage + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionLanguage) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionLanguage) GetType() string { + return TypeSettingsSectionLanguage +} + +func (*SettingsSectionLanguage) SettingsSectionType() string { + return TypeSettingsSectionLanguage +} + +// The Telegram Star balance and transaction section +type SettingsSectionMyStars struct { + meta + // Subsection of the section; may be one of "", "top-up", "stats", "gift", "earn" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionMyStars) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionMyStars + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionMyStars) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionMyStars) GetType() string { + return TypeSettingsSectionMyStars +} + +func (*SettingsSectionMyStars) SettingsSectionType() string { + return TypeSettingsSectionMyStars +} + +// The Toncoin balance and transaction section +type SettingsSectionMyToncoins struct{ + meta +} + +func (entity *SettingsSectionMyToncoins) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionMyToncoins + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionMyToncoins) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionMyToncoins) GetType() string { + return TypeSettingsSectionMyToncoins +} + +func (*SettingsSectionMyToncoins) SettingsSectionType() string { + return TypeSettingsSectionMyToncoins +} + +// The notification settings section +type SettingsSectionNotifications struct { + meta + // Subsection of the section; may be one of "", "accounts", "private-chats", "private-chats/edit", "private-chats/show", "private-chats/preview", "private-chats/sound", "private-chats/add-exception", "private-chats/delete-exceptions", "private-chats/light-color", "private-chats/vibrate", "private-chats/priority", "groups", "groups/edit", "groups/show", "groups/preview", "groups/sound", "groups/add-exception", "groups/delete-exceptions", "groups/light-color", "groups/vibrate", "groups/priority", "channels", "channels/edit", "channels/show", "channels/preview", "channels/sound", "channels/add-exception", "channels/delete-exceptions", "channels/light-color", "channels/vibrate", "channels/priority", "stories", "stories/new", "stories/important", "stories/show-sender", "stories/sound", "stories/add-exception", "stories/delete-exceptions", "stories/light-color", "stories/vibrate", "stories/priority", "reactions", "reactions/messages", "reactions/stories", "reactions/show-sender", "reactions/sound", "reactions/light-color", "reactions/vibrate", "reactions/priority", "in-app-sounds", "in-app-vibrate", "in-app-preview", "in-chat-sounds", "in-app-popup", "lock-screen-names", "include-channels", "include-muted-chats", "count-unread-messages", "new-contacts", "pinned-messages", "reset", "web" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionNotifications) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionNotifications + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionNotifications) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionNotifications) GetType() string { + return TypeSettingsSectionNotifications +} + +func (*SettingsSectionNotifications) SettingsSectionType() string { + return TypeSettingsSectionNotifications +} + +// The power saving settings section +type SettingsSectionPowerSaving struct { + meta + // Subsection of the section; may be one of "", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionPowerSaving) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPowerSaving + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPowerSaving) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPowerSaving) GetType() string { + return TypeSettingsSectionPowerSaving +} + +func (*SettingsSectionPowerSaving) SettingsSectionType() string { + return TypeSettingsSectionPowerSaving +} + +// The "Telegram Premium" section +type SettingsSectionPremium struct{ + meta +} + +func (entity *SettingsSectionPremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPremium + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPremium) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPremium) GetType() string { + return TypeSettingsSectionPremium +} + +func (*SettingsSectionPremium) SettingsSectionType() string { + return TypeSettingsSectionPremium +} + +// The privacy and security section +type SettingsSectionPrivacyAndSecurity struct { + meta + // Subsection of the section; may be one of "", "blocked", "blocked/edit", "blocked/block-user", "blocked/block-user/chats", "blocked/block-user/contacts", "active-websites", "active-websites/edit", "active-websites/disconnect-all", "passcode", "passcode/disable", "passcode/change", "passcode/auto-lock", "passcode/face-id", "passcode/fingerprint", "2sv", "2sv/change", "2sv/disable", "2sv/change-email", "passkey", "passkey/create", "auto-delete", "auto-delete/set-custom", "login-email", "phone-number", "phone-number/never", "phone-number/always", "last-seen", "last-seen/never", "last-seen/always", "last-seen/hide-read-time", "profile-photos", "profile-photos/never", "profile-photos/always", "profile-photos/set-public", "profile-photos/update-public", "profile-photos/remove-public", "bio", "bio/never", "bio/always", "gifts", "gifts/show-icon", "gifts/never", "gifts/always", "gifts/accepted-types", "birthday", "birthday/add", "birthday/never", "birthday/always", "saved-music", "saved-music/never", "saved-music/always", "forwards", "forwards/never", "forwards/always", "calls", "calls/never", "calls/always", "calls/p2p", "calls/p2p/never", "calls/p2p/always", "calls/ios-integration", "voice", "voice/never", "voice/always", "messages", "messages/set-price", "messages/exceptions", "invites", "invites/never", "invites/always", "self-destruct", "data-settings", "data-settings/sync-contacts", "data-settings/delete-synced", "data-settings/suggest-contacts", "data-settings/delete-cloud-drafts", "data-settings/clear-payment-info", "data-settings/link-previews", "data-settings/bot-settings", "data-settings/map-provider", "archive-and-mute" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionPrivacyAndSecurity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPrivacyAndSecurity + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPrivacyAndSecurity) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPrivacyAndSecurity) GetType() string { + return TypeSettingsSectionPrivacyAndSecurity +} + +func (*SettingsSectionPrivacyAndSecurity) SettingsSectionType() string { + return TypeSettingsSectionPrivacyAndSecurity +} + +// The "Privacy Policy" section +type SettingsSectionPrivacyPolicy struct{ + meta +} + +func (entity *SettingsSectionPrivacyPolicy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionPrivacyPolicy + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionPrivacyPolicy) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionPrivacyPolicy) GetType() string { + return TypeSettingsSectionPrivacyPolicy +} + +func (*SettingsSectionPrivacyPolicy) SettingsSectionType() string { + return TypeSettingsSectionPrivacyPolicy +} + +// The current user's QR code section +type SettingsSectionQrCode struct { + meta + // Subsection of the section; may be one of "", "share", "scan" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionQrCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionQrCode + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionQrCode) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionQrCode) GetType() string { + return TypeSettingsSectionQrCode +} + +func (*SettingsSectionQrCode) SettingsSectionType() string { + return TypeSettingsSectionQrCode +} + +// Search in Settings +type SettingsSectionSearch struct{ + meta +} + +func (entity *SettingsSectionSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionSearch + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionSearch) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionSearch) GetType() string { + return TypeSettingsSectionSearch +} + +func (*SettingsSectionSearch) SettingsSectionType() string { + return TypeSettingsSectionSearch +} + +// The "Send a gift" section +type SettingsSectionSendGift struct { + meta + // Subsection of the section; may be one of "", "self" + Subsection string `json:"subsection"` +} + +func (entity *SettingsSectionSendGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SettingsSectionSendGift + + return json.Marshal((*stub)(entity)) +} + +func (*SettingsSectionSendGift) GetClass() string { + return ClassSettingsSection +} + +func (*SettingsSectionSendGift) GetType() string { + return TypeSettingsSectionSendGift +} + +func (*SettingsSectionSendGift) SettingsSectionType() string { + return TypeSettingsSectionSendGift } // The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL @@ -54803,58 +56203,31 @@ func (*InternalLinkTypeBusinessChat) InternalLinkTypeType() string { return TypeInternalLinkTypeBusinessChat } -// The link is a link to the Telegram Star purchase section of the application -type InternalLinkTypeBuyStars struct { +// The link is a link to the Call tab or page +type InternalLinkTypeCallsPage struct { meta - // The number of Telegram Stars that must be owned by the user - StarCount int64 `json:"star_count"` - // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions - Purpose string `json:"purpose"` + // Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call" + Section string `json:"section"` } -func (entity *InternalLinkTypeBuyStars) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeCallsPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeBuyStars + type stub InternalLinkTypeCallsPage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeBuyStars) GetClass() string { +func (*InternalLinkTypeCallsPage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeBuyStars) GetType() string { - return TypeInternalLinkTypeBuyStars +func (*InternalLinkTypeCallsPage) GetType() string { + return TypeInternalLinkTypeCallsPage } -func (*InternalLinkTypeBuyStars) InternalLinkTypeType() string { - return TypeInternalLinkTypeBuyStars -} - -// The link is a link to the change phone number section of the application -type InternalLinkTypeChangePhoneNumber struct{ - meta -} - -func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeChangePhoneNumber - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeChangePhoneNumber) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeChangePhoneNumber) GetType() string { - return TypeInternalLinkTypeChangePhoneNumber -} - -func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { - return TypeInternalLinkTypeChangePhoneNumber +func (*InternalLinkTypeCallsPage) InternalLinkTypeType() string { + return TypeInternalLinkTypeCallsPage } // The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link @@ -54940,31 +56313,6 @@ func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatFolderInvite } -// The link is a link to the folder section of the application settings -type InternalLinkTypeChatFolderSettings struct{ - meta -} - -func (entity *InternalLinkTypeChatFolderSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeChatFolderSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeChatFolderSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeChatFolderSettings) GetType() string { - return TypeInternalLinkTypeChatFolderSettings -} - -func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeChatFolderSettings -} - // The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink type InternalLinkTypeChatInvite struct { meta @@ -54992,29 +56340,56 @@ func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatInvite } -// The link is a link to the default message auto-delete timer settings section of the application settings -type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct{ +// The link is a link that allows to select some chats +type InternalLinkTypeChatSelection struct{ meta } -func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeChatSelection) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings + type stub InternalLinkTypeChatSelection return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { +func (*InternalLinkTypeChatSelection) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func (*InternalLinkTypeChatSelection) GetType() string { + return TypeInternalLinkTypeChatSelection } -func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func (*InternalLinkTypeChatSelection) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatSelection +} + +// The link is a link to the Contacts tab or page +type InternalLinkTypeContactsPage struct { + meta + // Section of the page; may be one of "", "search", "sort", "new", "invite", "manage" + Section string `json:"section"` +} + +func (entity *InternalLinkTypeContactsPage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeContactsPage + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeContactsPage) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeContactsPage) GetType() string { + return TypeInternalLinkTypeContactsPage +} + +func (*InternalLinkTypeContactsPage) InternalLinkTypeType() string { + return TypeInternalLinkTypeContactsPage } // The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. If the chat is found and is channel, open the direct messages chat of the channel @@ -55044,31 +56419,6 @@ func (*InternalLinkTypeDirectMessagesChat) InternalLinkTypeType() string { return TypeInternalLinkTypeDirectMessagesChat } -// The link is a link to the edit profile section of the application settings -type InternalLinkTypeEditProfileSettings struct{ - meta -} - -func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeEditProfileSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeEditProfileSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeEditProfileSettings) GetType() string { - return TypeInternalLinkTypeEditProfileSettings -} - -func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeEditProfileSettings -} - // The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame type InternalLinkTypeGame struct { meta @@ -55264,31 +56614,6 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// The link is a link to the language section of the application settings -type InternalLinkTypeLanguageSettings struct{ - meta -} - -func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeLanguageSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeLanguageSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeLanguageSettings) GetType() string { - return TypeInternalLinkTypeLanguageSettings -} - -func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeLanguageSettings -} - // The link is a link to a live story. Call searchPublicChat with the given chat username, then getChatActiveStories to get active stories in the chat, then find a live story among active stories of the chat, and then joinLiveStory to join the live story type InternalLinkTypeLiveStory struct { meta @@ -55316,31 +56641,6 @@ func (*InternalLinkTypeLiveStory) InternalLinkTypeType() string { return TypeInternalLinkTypeLiveStory } -// The link is a link to the login email set up section of the application settings, forcing set up of the login email -type InternalLinkTypeLoginEmailSettings struct{ - meta -} - -func (entity *InternalLinkTypeLoginEmailSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeLoginEmailSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeLoginEmailSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeLoginEmailSettings) GetType() string { - return TypeInternalLinkTypeLoginEmailSettings -} - -func (*InternalLinkTypeLoginEmailSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeLoginEmailSettings -} - // The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and mode and open the returned URL as a Web App type InternalLinkTypeMainWebApp struct { meta @@ -55449,54 +56749,149 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { return TypeInternalLinkTypeMessageDraft } -// The link is a link to the screen with information about Telegram Star balance and transactions of the current user -type InternalLinkTypeMyStars struct{ +// The link is a link to the My Profile application page +type InternalLinkTypeMyProfilePage struct { meta + // Section of the page; may be one of "", "posts", "posts/all-stories", "posts/add-album", "gifts", "archived-posts" + Section string `json:"section"` } -func (entity *InternalLinkTypeMyStars) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeMyProfilePage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMyStars + type stub InternalLinkTypeMyProfilePage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeMyStars) GetClass() string { +func (*InternalLinkTypeMyProfilePage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeMyStars) GetType() string { - return TypeInternalLinkTypeMyStars +func (*InternalLinkTypeMyProfilePage) GetType() string { + return TypeInternalLinkTypeMyProfilePage } -func (*InternalLinkTypeMyStars) InternalLinkTypeType() string { - return TypeInternalLinkTypeMyStars +func (*InternalLinkTypeMyProfilePage) InternalLinkTypeType() string { + return TypeInternalLinkTypeMyProfilePage } -// The link is a link to the screen with information about Toncoin balance and transactions of the current user -type InternalLinkTypeMyToncoins struct{ +// The link is a link to the screen for creating a new channel chat +type InternalLinkTypeNewChannelChat struct{ meta } -func (entity *InternalLinkTypeMyToncoins) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeNewChannelChat) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeMyToncoins + type stub InternalLinkTypeNewChannelChat return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeMyToncoins) GetClass() string { +func (*InternalLinkTypeNewChannelChat) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeMyToncoins) GetType() string { - return TypeInternalLinkTypeMyToncoins +func (*InternalLinkTypeNewChannelChat) GetType() string { + return TypeInternalLinkTypeNewChannelChat } -func (*InternalLinkTypeMyToncoins) InternalLinkTypeType() string { - return TypeInternalLinkTypeMyToncoins +func (*InternalLinkTypeNewChannelChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewChannelChat +} + +// The link is a link to the screen for creating a new group chat +type InternalLinkTypeNewGroupChat struct{ + meta +} + +func (entity *InternalLinkTypeNewGroupChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewGroupChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewGroupChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewGroupChat) GetType() string { + return TypeInternalLinkTypeNewGroupChat +} + +func (*InternalLinkTypeNewGroupChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewGroupChat +} + +// The link is a link to the screen for creating a new private chat with a contact +type InternalLinkTypeNewPrivateChat struct{ + meta +} + +func (entity *InternalLinkTypeNewPrivateChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewPrivateChat + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewPrivateChat) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewPrivateChat) GetType() string { + return TypeInternalLinkTypeNewPrivateChat +} + +func (*InternalLinkTypeNewPrivateChat) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewPrivateChat +} + +// The link is a link to open the story posting interface +type InternalLinkTypeNewStory struct { + meta + // The type of the content of the story to post; may be null if unspecified + ContentType StoryContentType `json:"content_type"` +} + +func (entity *InternalLinkTypeNewStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeNewStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeNewStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeNewStory) GetType() string { + return TypeInternalLinkTypeNewStory +} + +func (*InternalLinkTypeNewStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeNewStory +} + +func (internalLinkTypeNewStory *InternalLinkTypeNewStory) UnmarshalJSON(data []byte) error { + var tmp struct { + ContentType json.RawMessage `json:"content_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldContentType, _ := UnmarshalStoryContentType(tmp.ContentType) + internalLinkTypeNewStory.ContentType = fieldContentType + + return nil } // 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 @@ -55534,31 +56929,6 @@ func (*InternalLinkTypePassportDataRequest) InternalLinkTypeType() string { return TypeInternalLinkTypePassportDataRequest } -// The link is a link to the password section of the application settings -type InternalLinkTypePasswordSettings struct{ - meta -} - -func (entity *InternalLinkTypePasswordSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypePasswordSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypePasswordSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypePasswordSettings) GetType() string { - return TypeInternalLinkTypePasswordSettings -} - -func (*InternalLinkTypePasswordSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePasswordSettings -} - // The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it type InternalLinkTypePhoneNumberConfirmation struct { meta @@ -55588,83 +56958,31 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { return TypeInternalLinkTypePhoneNumberConfirmation } -// The link is a link to the phone number privacy settings section of the application settings -type InternalLinkTypePhoneNumberPrivacySettings struct{ - meta -} - -func (entity *InternalLinkTypePhoneNumberPrivacySettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypePhoneNumberPrivacySettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypePhoneNumberPrivacySettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypePhoneNumberPrivacySettings) GetType() string { - return TypeInternalLinkTypePhoneNumberPrivacySettings -} - -func (*InternalLinkTypePhoneNumberPrivacySettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePhoneNumberPrivacySettings -} - // The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link -type InternalLinkTypePremiumFeatures struct { +type InternalLinkTypePremiumFeaturesPage struct { meta // Referrer specified in the link Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePremiumFeaturesPage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePremiumFeatures + type stub InternalLinkTypePremiumFeaturesPage return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePremiumFeatures) GetClass() string { +func (*InternalLinkTypePremiumFeaturesPage) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePremiumFeatures) GetType() string { - return TypeInternalLinkTypePremiumFeatures +func (*InternalLinkTypePremiumFeaturesPage) GetType() string { + return TypeInternalLinkTypePremiumFeaturesPage } -func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumFeatures -} - -// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases -type InternalLinkTypePremiumGift struct { - meta - // Referrer specified in the link - Referrer string `json:"referrer"` -} - -func (entity *InternalLinkTypePremiumGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypePremiumGift - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypePremiumGift) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypePremiumGift) GetType() string { - return TypeInternalLinkTypePremiumGift -} - -func (*InternalLinkTypePremiumGift) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumGift +func (*InternalLinkTypePremiumFeaturesPage) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumFeaturesPage } // The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode @@ -55694,40 +57012,38 @@ func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { return TypeInternalLinkTypePremiumGiftCode } -// The link is a link to the privacy and security section of the application settings -type InternalLinkTypePrivacyAndSecuritySettings struct{ +// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases +type InternalLinkTypePremiumGiftPurchase struct { meta + // Referrer specified in the link + Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePremiumGiftPurchase) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePrivacyAndSecuritySettings + type stub InternalLinkTypePremiumGiftPurchase return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { +func (*InternalLinkTypePremiumGiftPurchase) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings +func (*InternalLinkTypePremiumGiftPurchase) GetType() string { + return TypeInternalLinkTypePremiumGiftPurchase } -func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { - return TypeInternalLinkTypePrivacyAndSecuritySettings +func (*InternalLinkTypePremiumGiftPurchase) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGiftPurchase } // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Type of the proxy - Type ProxyType `json:"type"` + // The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user + Proxy *Proxy `json:"proxy"` } func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) { @@ -55750,27 +57066,6 @@ func (*InternalLinkTypeProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeProxy } -func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Server string `json:"server"` - Port int32 `json:"port"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - internalLinkTypeProxy.Server = tmp.Server - internalLinkTypeProxy.Port = tmp.Port - - fieldType, _ := UnmarshalProxyType(tmp.Type) - internalLinkTypeProxy.Type = fieldType - - return nil -} - // The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. If the chat is found, open its profile information screen or the chat itself. If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field type InternalLinkTypePublicChat struct { meta @@ -55852,11 +57147,63 @@ func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { return TypeInternalLinkTypeRestorePurchases } -// The link is a link to application settings -type InternalLinkTypeSettings struct{ +// The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat +type InternalLinkTypeSavedMessages struct{ meta } +func (entity *InternalLinkTypeSavedMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSavedMessages + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSavedMessages) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSavedMessages) GetType() string { + return TypeInternalLinkTypeSavedMessages +} + +func (*InternalLinkTypeSavedMessages) InternalLinkTypeType() string { + return TypeInternalLinkTypeSavedMessages +} + +// The link is a link to the global chat and messages search field +type InternalLinkTypeSearch struct{ + meta +} + +func (entity *InternalLinkTypeSearch) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeSearch + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeSearch) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeSearch) GetType() string { + return TypeInternalLinkTypeSearch +} + +func (*InternalLinkTypeSearch) InternalLinkTypeType() string { + return TypeInternalLinkTypeSearch +} + +// The link is a link to application settings +type InternalLinkTypeSettings struct { + meta + // Section of the application settings to open; may be null if none + Section SettingsSection `json:"section"` +} + func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() @@ -55877,6 +57224,51 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } +func (internalLinkTypeSettings *InternalLinkTypeSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + Section json.RawMessage `json:"section"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldSection, _ := UnmarshalSettingsSection(tmp.Section) + internalLinkTypeSettings.Section = fieldSection + + return nil +} + +// The link is a link to the Telegram Star purchase section of the application +type InternalLinkTypeStarPurchase struct { + meta + // The number of Telegram Stars that must be owned by the user + StarCount int64 `json:"star_count"` + // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions + Purpose string `json:"purpose"` +} + +func (entity *InternalLinkTypeStarPurchase) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStarPurchase + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStarPurchase) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStarPurchase) GetType() string { + return TypeInternalLinkTypeStarPurchase +} + +func (*InternalLinkTypeStarPurchase) InternalLinkTypeType() string { + return TypeInternalLinkTypeStarPurchase +} + // The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet type InternalLinkTypeStickerSet struct { meta @@ -55991,31 +57383,6 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } -// The link is a link to the theme section of the application settings -type InternalLinkTypeThemeSettings struct{ - meta -} - -func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeThemeSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeThemeSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeThemeSettings) GetType() string { - return TypeInternalLinkTypeThemeSettings -} - -func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeThemeSettings -} - // The link is an unknown tg: link. Call getDeepLinkInfo to process the link type InternalLinkTypeUnknownDeepLink struct { meta @@ -56043,31 +57410,6 @@ func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string { return TypeInternalLinkTypeUnknownDeepLink } -// The link is a link to an unsupported proxy. An alert can be shown to the user -type InternalLinkTypeUnsupportedProxy struct{ - meta -} - -func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeUnsupportedProxy - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeUnsupportedProxy) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeUnsupportedProxy) GetType() string { - return TypeInternalLinkTypeUnsupportedProxy -} - -func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { - return TypeInternalLinkTypeUnsupportedProxy -} - // The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link type InternalLinkTypeUpgradedGift struct { meta @@ -59008,87 +60350,56 @@ func (*ProxyTypeMtproto) ProxyTypeType() string { return TypeProxyTypeMtproto } -// Contains information about a proxy server -type Proxy struct { +// Contains information about a proxy server added to the list of proxies +type AddedProxy struct { meta // Unique identifier of the proxy Id int32 `json:"id"` - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` // Point in time (Unix timestamp) when the proxy was last used; 0 if never LastUsedDate int32 `json:"last_used_date"` // True, if the proxy is enabled now IsEnabled bool `json:"is_enabled"` - // Type of the proxy - Type ProxyType `json:"type"` + // The proxy + Proxy *Proxy `json:"proxy"` } -func (entity *Proxy) MarshalJSON() ([]byte, error) { +func (entity *AddedProxy) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub Proxy + type stub AddedProxy return json.Marshal((*stub)(entity)) } -func (*Proxy) GetClass() string { - return ClassProxy +func (*AddedProxy) GetClass() string { + return ClassAddedProxy } -func (*Proxy) GetType() string { - return TypeProxy +func (*AddedProxy) GetType() string { + return TypeAddedProxy } -func (proxy *Proxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int32 `json:"id"` - Server string `json:"server"` - Port int32 `json:"port"` - LastUsedDate int32 `json:"last_used_date"` - IsEnabled bool `json:"is_enabled"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - proxy.Id = tmp.Id - proxy.Server = tmp.Server - proxy.Port = tmp.Port - proxy.LastUsedDate = tmp.LastUsedDate - proxy.IsEnabled = tmp.IsEnabled - - fieldType, _ := UnmarshalProxyType(tmp.Type) - proxy.Type = fieldType - - return nil -} - -// Represents a list of proxy servers -type Proxies struct { +// Represents a list of added proxy servers +type AddedProxies struct { meta // List of proxy servers - Proxies []*Proxy `json:"proxies"` + Proxies []*AddedProxy `json:"proxies"` } -func (entity *Proxies) MarshalJSON() ([]byte, error) { +func (entity *AddedProxies) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub Proxies + type stub AddedProxies return json.Marshal((*stub)(entity)) } -func (*Proxies) GetClass() string { - return ClassProxies +func (*AddedProxies) GetClass() string { + return ClassAddedProxies } -func (*Proxies) GetType() string { - return TypeProxies +func (*AddedProxies) GetType() string { + return TypeAddedProxies } // A sticker to be added to a sticker set @@ -60050,7 +61361,7 @@ func (*ChatRevenueTransactionTypeSponsoredMessageEarnings) ChatRevenueTransactio // Describes earnings from a published suggested post type ChatRevenueTransactionTypeSuggestedPostEarnings struct { meta - // Identifier of the user that paid for the suggested post + // Identifier of the user who paid for the suggested post UserId int64 `json:"user_id"` } @@ -60227,11 +61538,11 @@ func (*ChatRevenueTransactions) GetType() string { // Contains information about Telegram Stars earned by a user or a chat type StarRevenueStatus struct { meta - // Total amount of Telegram Stars earned + // Total Telegram Star amount earned TotalAmount *StarAmount `json:"total_amount"` - // The amount of Telegram Stars that aren't withdrawn yet + // The Telegram Star amount that isn't withdrawn yet CurrentAmount *StarAmount `json:"current_amount"` - // The amount of Telegram Stars that are available for withdrawal + // The Telegram Star amount that is available for withdrawal AvailableAmount *StarAmount `json:"available_amount"` // True, if Telegram Stars can be withdrawn now or later WithdrawalEnabled bool `json:"withdrawal_enabled"` @@ -60306,11 +61617,11 @@ func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) e // Contains information about Toncoins earned by the current user type TonRevenueStatus struct { meta - // Total amount of Toncoins earned; in the smallest units of the cryptocurrency + // Total Toncoin amount earned; in the smallest units of the cryptocurrency TotalAmount JsonInt64 `json:"total_amount"` - // Amount of Toncoins that aren't withdrawn yet; in the smallest units of the cryptocurrency + // The Toncoin amount that isn't withdrawn yet; in the smallest units of the cryptocurrency BalanceAmount JsonInt64 `json:"balance_amount"` - // Amount of Toncoins that are available for withdrawal; in the smallest units of the cryptocurrency + // The Toncoin amount that is available for withdrawal; in the smallest units of the cryptocurrency AvailableAmount JsonInt64 `json:"available_amount"` // True, if Toncoins can be withdrawn WithdrawalEnabled bool `json:"withdrawal_enabled"` diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 60a638b..5319fa2 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -1059,6 +1059,9 @@ func UnmarshalUpgradedGiftOrigin(data json.RawMessage) (UpgradedGiftOrigin, erro case TypeUpgradedGiftOriginOffer: return UnmarshalUpgradedGiftOriginOffer(data) + case TypeUpgradedGiftOriginCraft: + return UnmarshalUpgradedGiftOriginCraft(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1078,6 +1081,89 @@ func UnmarshalListOfUpgradedGiftOrigin(dataList []json.RawMessage) ([]UpgradedGi return list, nil } +func UnmarshalUpgradedGiftAttributeRarity(data json.RawMessage) (UpgradedGiftAttributeRarity, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeUpgradedGiftAttributeRarityPerMille: + return UnmarshalUpgradedGiftAttributeRarityPerMille(data) + + case TypeUpgradedGiftAttributeRarityUncommon: + return UnmarshalUpgradedGiftAttributeRarityUncommon(data) + + case TypeUpgradedGiftAttributeRarityRare: + return UnmarshalUpgradedGiftAttributeRarityRare(data) + + case TypeUpgradedGiftAttributeRarityEpic: + return UnmarshalUpgradedGiftAttributeRarityEpic(data) + + case TypeUpgradedGiftAttributeRarityLegendary: + return UnmarshalUpgradedGiftAttributeRarityLegendary(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfUpgradedGiftAttributeRarity(dataList []json.RawMessage) ([]UpgradedGiftAttributeRarity, error) { + list := []UpgradedGiftAttributeRarity{} + + for _, data := range dataList { + entity, err := UnmarshalUpgradedGiftAttributeRarity(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalCraftGiftResult(data json.RawMessage) (CraftGiftResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfCraftGiftResult(dataList []json.RawMessage) ([]CraftGiftResult, error) { + list := []CraftGiftResult{} + + for _, data := range dataList { + entity, err := UnmarshalCraftGiftResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUpgradedGiftAttributeId(data json.RawMessage) (UpgradedGiftAttributeId, error) { var meta meta @@ -1478,6 +1564,12 @@ func UnmarshalTonTransactionType(data json.RawMessage) (TonTransactionType, erro case TypeTonTransactionTypeUpgradedGiftSale: return UnmarshalTonTransactionTypeUpgradedGiftSale(data) + case TypeTonTransactionTypeStakeDiceStake: + return UnmarshalTonTransactionTypeStakeDiceStake(data) + + case TypeTonTransactionTypeStakeDicePayout: + return UnmarshalTonTransactionTypeStakeDicePayout(data) + case TypeTonTransactionTypeUnsupported: return UnmarshalTonTransactionTypeUnsupported(data) @@ -2676,6 +2768,46 @@ func UnmarshalListOfChatActionBar(dataList []json.RawMessage) ([]ChatActionBar, return list, nil } +func UnmarshalButtonStyle(data json.RawMessage) (ButtonStyle, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeButtonStyleDefault: + return UnmarshalButtonStyleDefault(data) + + case TypeButtonStylePrimary: + return UnmarshalButtonStylePrimary(data) + + case TypeButtonStyleDanger: + return UnmarshalButtonStyleDanger(data) + + case TypeButtonStyleSuccess: + return UnmarshalButtonStyleSuccess(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfButtonStyle(dataList []json.RawMessage) ([]ButtonStyle, error) { + list := []ButtonStyle{} + + for _, data := range dataList { + entity, err := UnmarshalButtonStyle(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, error) { var meta meta @@ -4105,6 +4237,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageChatOwnerLeft: + return UnmarshalMessageChatOwnerLeft(data) + + case TypeMessageChatOwnerChanged: + return UnmarshalMessageChatOwnerChanged(data) + case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -4995,6 +5133,46 @@ func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStory return list, nil } +func UnmarshalStoryContentType(data json.RawMessage) (StoryContentType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryContentTypePhoto: + return UnmarshalStoryContentTypePhoto(data) + + case TypeStoryContentTypeVideo: + return UnmarshalStoryContentTypeVideo(data) + + case TypeStoryContentTypeLive: + return UnmarshalStoryContentTypeLive(data) + + case TypeStoryContentTypeUnsupported: + return UnmarshalStoryContentTypeUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryContentType(dataList []json.RawMessage) ([]StoryContentType, error) { + list := []StoryContentType{} + + for _, data := range dataList { + entity, err := UnmarshalStoryContentType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { var meta meta @@ -8000,6 +8178,97 @@ func UnmarshalListOfReportStoryResult(dataList []json.RawMessage) ([]ReportStory return list, nil } +func UnmarshalSettingsSection(data json.RawMessage) (SettingsSection, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeSettingsSectionAppearance: + return UnmarshalSettingsSectionAppearance(data) + + case TypeSettingsSectionAskQuestion: + return UnmarshalSettingsSectionAskQuestion(data) + + case TypeSettingsSectionBusiness: + return UnmarshalSettingsSectionBusiness(data) + + case TypeSettingsSectionChatFolders: + return UnmarshalSettingsSectionChatFolders(data) + + case TypeSettingsSectionDataAndStorage: + return UnmarshalSettingsSectionDataAndStorage(data) + + case TypeSettingsSectionDevices: + return UnmarshalSettingsSectionDevices(data) + + case TypeSettingsSectionEditProfile: + return UnmarshalSettingsSectionEditProfile(data) + + case TypeSettingsSectionFaq: + return UnmarshalSettingsSectionFaq(data) + + case TypeSettingsSectionFeatures: + return UnmarshalSettingsSectionFeatures(data) + + case TypeSettingsSectionInAppBrowser: + return UnmarshalSettingsSectionInAppBrowser(data) + + case TypeSettingsSectionLanguage: + return UnmarshalSettingsSectionLanguage(data) + + case TypeSettingsSectionMyStars: + return UnmarshalSettingsSectionMyStars(data) + + case TypeSettingsSectionMyToncoins: + return UnmarshalSettingsSectionMyToncoins(data) + + case TypeSettingsSectionNotifications: + return UnmarshalSettingsSectionNotifications(data) + + case TypeSettingsSectionPowerSaving: + return UnmarshalSettingsSectionPowerSaving(data) + + case TypeSettingsSectionPremium: + return UnmarshalSettingsSectionPremium(data) + + case TypeSettingsSectionPrivacyAndSecurity: + return UnmarshalSettingsSectionPrivacyAndSecurity(data) + + case TypeSettingsSectionPrivacyPolicy: + return UnmarshalSettingsSectionPrivacyPolicy(data) + + case TypeSettingsSectionQrCode: + return UnmarshalSettingsSectionQrCode(data) + + case TypeSettingsSectionSearch: + return UnmarshalSettingsSectionSearch(data) + + case TypeSettingsSectionSendGift: + return UnmarshalSettingsSectionSendGift(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfSettingsSection(dataList []json.RawMessage) ([]SettingsSection, error) { + list := []SettingsSection{} + + for _, data := range dataList { + entity, err := UnmarshalSettingsSection(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { var meta meta @@ -8009,9 +8278,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { } switch meta.Type { - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) - case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -8033,11 +8299,8 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -8048,21 +8311,18 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(data) + + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) @@ -8084,15 +8344,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) - case TypeInternalLinkTypeLiveStory: return UnmarshalInternalLinkTypeLiveStory(data) - case TypeInternalLinkTypeLoginEmailSettings: - return UnmarshalInternalLinkTypeLoginEmailSettings(data) - case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -8102,35 +8356,35 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) - case TypeInternalLinkTypePasswordSettings: - return UnmarshalInternalLinkTypePasswordSettings(data) - case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePhoneNumberPrivacySettings: - return UnmarshalInternalLinkTypePhoneNumberPrivacySettings(data) - - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -8144,9 +8398,18 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) @@ -8159,15 +8422,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -11387,6 +11644,54 @@ func UnmarshalUpgradedGiftOriginOffer(data json.RawMessage) (*UpgradedGiftOrigin return &resp, err } +func UnmarshalUpgradedGiftOriginCraft(data json.RawMessage) (*UpgradedGiftOriginCraft, error) { + var resp UpgradedGiftOriginCraft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityPerMille(data json.RawMessage) (*UpgradedGiftAttributeRarityPerMille, error) { + var resp UpgradedGiftAttributeRarityPerMille + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityUncommon(data json.RawMessage) (*UpgradedGiftAttributeRarityUncommon, error) { + var resp UpgradedGiftAttributeRarityUncommon + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityRare(data json.RawMessage) (*UpgradedGiftAttributeRarityRare, error) { + var resp UpgradedGiftAttributeRarityRare + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityEpic(data json.RawMessage) (*UpgradedGiftAttributeRarityEpic, error) { + var resp UpgradedGiftAttributeRarityEpic + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpgradedGiftAttributeRarityLegendary(data json.RawMessage) (*UpgradedGiftAttributeRarityLegendary, error) { + var resp UpgradedGiftAttributeRarityLegendary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) { var resp UpgradedGiftModel @@ -11467,6 +11772,38 @@ func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error return &resp, err } +func UnmarshalCraftGiftResultSuccess(data json.RawMessage) (*CraftGiftResultSuccess, error) { + var resp CraftGiftResultSuccess + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultTooEarly(data json.RawMessage) (*CraftGiftResultTooEarly, error) { + var resp CraftGiftResultTooEarly + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultInvalidGift(data json.RawMessage) (*CraftGiftResultInvalidGift, error) { + var resp CraftGiftResultInvalidGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalCraftGiftResultFail(data json.RawMessage) (*CraftGiftResultFail, error) { + var resp CraftGiftResultFail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAvailableGift(data json.RawMessage) (*AvailableGift, error) { var resp AvailableGift @@ -11627,6 +11964,22 @@ func UnmarshalReceivedGifts(data json.RawMessage) (*ReceivedGifts, error) { return &resp, err } +func UnmarshalAttributeCraftPersistenceProbability(data json.RawMessage) (*AttributeCraftPersistenceProbability, error) { + var resp AttributeCraftPersistenceProbability + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftsForCrafting(data json.RawMessage) (*GiftsForCrafting, error) { + var resp GiftsForCrafting + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, error) { var resp GiftUpgradePreview @@ -12147,6 +12500,22 @@ func UnmarshalTonTransactionTypeUpgradedGiftSale(data json.RawMessage) (*TonTran return &resp, err } +func UnmarshalTonTransactionTypeStakeDiceStake(data json.RawMessage) (*TonTransactionTypeStakeDiceStake, error) { + var resp TonTransactionTypeStakeDiceStake + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTonTransactionTypeStakeDicePayout(data json.RawMessage) (*TonTransactionTypeStakeDicePayout, error) { + var resp TonTransactionTypeStakeDicePayout + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTonTransactionTypeUnsupported(data json.RawMessage) (*TonTransactionTypeUnsupported, error) { var resp TonTransactionTypeUnsupported @@ -13883,6 +14252,38 @@ func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoin return &resp, err } +func UnmarshalButtonStyleDefault(data json.RawMessage) (*ButtonStyleDefault, error) { + var resp ButtonStyleDefault + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStylePrimary(data json.RawMessage) (*ButtonStylePrimary, error) { + var resp ButtonStylePrimary + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStyleDanger(data json.RawMessage) (*ButtonStyleDanger, error) { + var resp ButtonStyleDanger + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalButtonStyleSuccess(data json.RawMessage) (*ButtonStyleSuccess, error) { + var resp ButtonStyleSuccess + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -16275,6 +16676,22 @@ func UnmarshalMessageChatDeletePhoto(data json.RawMessage) (*MessageChatDeletePh return &resp, err } +func UnmarshalMessageChatOwnerLeft(data json.RawMessage) (*MessageChatOwnerLeft, error) { + var resp MessageChatOwnerLeft + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageChatOwnerChanged(data json.RawMessage) (*MessageChatOwnerChanged, error) { + var resp MessageChatOwnerChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) { var resp MessageChatAddMembers @@ -17795,6 +18212,38 @@ func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { return &resp, err } +func UnmarshalStoryContentTypePhoto(data json.RawMessage) (*StoryContentTypePhoto, error) { + var resp StoryContentTypePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeVideo(data json.RawMessage) (*StoryContentTypeVideo, error) { + var resp StoryContentTypeVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeLive(data json.RawMessage) (*StoryContentTypeLive, error) { + var resp StoryContentTypeLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentTypeUnsupported(data json.RawMessage) (*StoryContentTypeUnsupported, error) { + var resp StoryContentTypeUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { var resp StoryContentPhoto @@ -21307,6 +21756,14 @@ func UnmarshalNotificationGroup(data json.RawMessage) (*NotificationGroup, error return &resp, err } +func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { + var resp Proxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalOptionValueBoolean(data json.RawMessage) (*OptionValueBoolean, error) { var resp OptionValueBoolean @@ -22011,8 +22468,168 @@ func UnmarshalReportStoryResultTextRequired(data json.RawMessage) (*ReportStoryR return &resp, err } -func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { - var resp InternalLinkTypeActiveSessions +func UnmarshalSettingsSectionAppearance(data json.RawMessage) (*SettingsSectionAppearance, error) { + var resp SettingsSectionAppearance + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionAskQuestion(data json.RawMessage) (*SettingsSectionAskQuestion, error) { + var resp SettingsSectionAskQuestion + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionBusiness(data json.RawMessage) (*SettingsSectionBusiness, error) { + var resp SettingsSectionBusiness + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionChatFolders(data json.RawMessage) (*SettingsSectionChatFolders, error) { + var resp SettingsSectionChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionDataAndStorage(data json.RawMessage) (*SettingsSectionDataAndStorage, error) { + var resp SettingsSectionDataAndStorage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionDevices(data json.RawMessage) (*SettingsSectionDevices, error) { + var resp SettingsSectionDevices + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionEditProfile(data json.RawMessage) (*SettingsSectionEditProfile, error) { + var resp SettingsSectionEditProfile + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionFaq(data json.RawMessage) (*SettingsSectionFaq, error) { + var resp SettingsSectionFaq + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionFeatures(data json.RawMessage) (*SettingsSectionFeatures, error) { + var resp SettingsSectionFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionInAppBrowser(data json.RawMessage) (*SettingsSectionInAppBrowser, error) { + var resp SettingsSectionInAppBrowser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionLanguage(data json.RawMessage) (*SettingsSectionLanguage, error) { + var resp SettingsSectionLanguage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionMyStars(data json.RawMessage) (*SettingsSectionMyStars, error) { + var resp SettingsSectionMyStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionMyToncoins(data json.RawMessage) (*SettingsSectionMyToncoins, error) { + var resp SettingsSectionMyToncoins + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionNotifications(data json.RawMessage) (*SettingsSectionNotifications, error) { + var resp SettingsSectionNotifications + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPowerSaving(data json.RawMessage) (*SettingsSectionPowerSaving, error) { + var resp SettingsSectionPowerSaving + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPremium(data json.RawMessage) (*SettingsSectionPremium, error) { + var resp SettingsSectionPremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPrivacyAndSecurity(data json.RawMessage) (*SettingsSectionPrivacyAndSecurity, error) { + var resp SettingsSectionPrivacyAndSecurity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionPrivacyPolicy(data json.RawMessage) (*SettingsSectionPrivacyPolicy, error) { + var resp SettingsSectionPrivacyPolicy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionQrCode(data json.RawMessage) (*SettingsSectionQrCode, error) { + var resp SettingsSectionQrCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionSearch(data json.RawMessage) (*SettingsSectionSearch, error) { + var resp SettingsSectionSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSettingsSectionSendGift(data json.RawMessage) (*SettingsSectionSendGift, error) { + var resp SettingsSectionSendGift err := json.Unmarshal(data, &resp) @@ -22075,16 +22692,8 @@ func UnmarshalInternalLinkTypeBusinessChat(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeBuyStars(data json.RawMessage) (*InternalLinkTypeBuyStars, error) { - var resp InternalLinkTypeBuyStars - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { - var resp InternalLinkTypeChangePhoneNumber +func UnmarshalInternalLinkTypeCallsPage(data json.RawMessage) (*InternalLinkTypeCallsPage, error) { + var resp InternalLinkTypeCallsPage err := json.Unmarshal(data, &resp) @@ -22115,14 +22724,6 @@ func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalL return &resp, err } -func UnmarshalInternalLinkTypeChatFolderSettings(data json.RawMessage) (*InternalLinkTypeChatFolderSettings, error) { - var resp InternalLinkTypeChatFolderSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { var resp InternalLinkTypeChatInvite @@ -22131,8 +22732,16 @@ func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTyp return &resp, err } -func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { - var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings +func UnmarshalInternalLinkTypeChatSelection(data json.RawMessage) (*InternalLinkTypeChatSelection, error) { + var resp InternalLinkTypeChatSelection + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeContactsPage(data json.RawMessage) (*InternalLinkTypeContactsPage, error) { + var resp InternalLinkTypeContactsPage err := json.Unmarshal(data, &resp) @@ -22147,14 +22756,6 @@ func UnmarshalInternalLinkTypeDirectMessagesChat(data json.RawMessage) (*Interna return &resp, err } -func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { - var resp InternalLinkTypeEditProfileSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { var resp InternalLinkTypeGame @@ -22211,14 +22812,6 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { - var resp InternalLinkTypeLanguageSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeLiveStory(data json.RawMessage) (*InternalLinkTypeLiveStory, error) { var resp InternalLinkTypeLiveStory @@ -22227,14 +22820,6 @@ func UnmarshalInternalLinkTypeLiveStory(data json.RawMessage) (*InternalLinkType return &resp, err } -func UnmarshalInternalLinkTypeLoginEmailSettings(data json.RawMessage) (*InternalLinkTypeLoginEmailSettings, error) { - var resp InternalLinkTypeLoginEmailSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeMainWebApp(data json.RawMessage) (*InternalLinkTypeMainWebApp, error) { var resp InternalLinkTypeMainWebApp @@ -22259,16 +22844,40 @@ func UnmarshalInternalLinkTypeMessageDraft(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeMyStars(data json.RawMessage) (*InternalLinkTypeMyStars, error) { - var resp InternalLinkTypeMyStars +func UnmarshalInternalLinkTypeMyProfilePage(data json.RawMessage) (*InternalLinkTypeMyProfilePage, error) { + var resp InternalLinkTypeMyProfilePage err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInternalLinkTypeMyToncoins(data json.RawMessage) (*InternalLinkTypeMyToncoins, error) { - var resp InternalLinkTypeMyToncoins +func UnmarshalInternalLinkTypeNewChannelChat(data json.RawMessage) (*InternalLinkTypeNewChannelChat, error) { + var resp InternalLinkTypeNewChannelChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewGroupChat(data json.RawMessage) (*InternalLinkTypeNewGroupChat, error) { + var resp InternalLinkTypeNewGroupChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewPrivateChat(data json.RawMessage) (*InternalLinkTypeNewPrivateChat, error) { + var resp InternalLinkTypeNewPrivateChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeNewStory(data json.RawMessage) (*InternalLinkTypeNewStory, error) { + var resp InternalLinkTypeNewStory err := json.Unmarshal(data, &resp) @@ -22283,14 +22892,6 @@ func UnmarshalInternalLinkTypePassportDataRequest(data json.RawMessage) (*Intern return &resp, err } -func UnmarshalInternalLinkTypePasswordSettings(data json.RawMessage) (*InternalLinkTypePasswordSettings, error) { - var resp InternalLinkTypePasswordSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*InternalLinkTypePhoneNumberConfirmation, error) { var resp InternalLinkTypePhoneNumberConfirmation @@ -22299,24 +22900,8 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } -func UnmarshalInternalLinkTypePhoneNumberPrivacySettings(data json.RawMessage) (*InternalLinkTypePhoneNumberPrivacySettings, error) { - var resp InternalLinkTypePhoneNumberPrivacySettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { - var resp InternalLinkTypePremiumFeatures - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) { - var resp InternalLinkTypePremiumGift +func UnmarshalInternalLinkTypePremiumFeaturesPage(data json.RawMessage) (*InternalLinkTypePremiumFeaturesPage, error) { + var resp InternalLinkTypePremiumFeaturesPage err := json.Unmarshal(data, &resp) @@ -22331,8 +22916,8 @@ func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { - var resp InternalLinkTypePrivacyAndSecuritySettings +func UnmarshalInternalLinkTypePremiumGiftPurchase(data json.RawMessage) (*InternalLinkTypePremiumGiftPurchase, error) { + var resp InternalLinkTypePremiumGiftPurchase err := json.Unmarshal(data, &resp) @@ -22371,6 +22956,22 @@ func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeSavedMessages(data json.RawMessage) (*InternalLinkTypeSavedMessages, error) { + var resp InternalLinkTypeSavedMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeSearch(data json.RawMessage) (*InternalLinkTypeSearch, error) { + var resp InternalLinkTypeSearch + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { var resp InternalLinkTypeSettings @@ -22379,6 +22980,14 @@ func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeS return &resp, err } +func UnmarshalInternalLinkTypeStarPurchase(data json.RawMessage) (*InternalLinkTypeStarPurchase, error) { + var resp InternalLinkTypeStarPurchase + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { var resp InternalLinkTypeStickerSet @@ -22411,14 +23020,6 @@ func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeThem return &resp, err } -func UnmarshalInternalLinkTypeThemeSettings(data json.RawMessage) (*InternalLinkTypeThemeSettings, error) { - var resp InternalLinkTypeThemeSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { var resp InternalLinkTypeUnknownDeepLink @@ -22427,14 +23028,6 @@ func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalLinkTypeUnsupportedProxy, error) { - var resp InternalLinkTypeUnsupportedProxy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeUpgradedGift(data json.RawMessage) (*InternalLinkTypeUpgradedGift, error) { var resp InternalLinkTypeUpgradedGift @@ -23291,16 +23884,16 @@ func UnmarshalProxyTypeMtproto(data json.RawMessage) (*ProxyTypeMtproto, error) return &resp, err } -func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { - var resp Proxy +func UnmarshalAddedProxy(data json.RawMessage) (*AddedProxy, error) { + var resp AddedProxy err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { - var resp Proxies +func UnmarshalAddedProxies(data json.RawMessage) (*AddedProxies, error) { + var resp AddedProxies err := json.Unmarshal(data, &resp) @@ -25840,6 +26433,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginOffer: return UnmarshalUpgradedGiftOriginOffer(data) + case TypeUpgradedGiftOriginCraft: + return UnmarshalUpgradedGiftOriginCraft(data) + + case TypeUpgradedGiftAttributeRarityPerMille: + return UnmarshalUpgradedGiftAttributeRarityPerMille(data) + + case TypeUpgradedGiftAttributeRarityUncommon: + return UnmarshalUpgradedGiftAttributeRarityUncommon(data) + + case TypeUpgradedGiftAttributeRarityRare: + return UnmarshalUpgradedGiftAttributeRarityRare(data) + + case TypeUpgradedGiftAttributeRarityEpic: + return UnmarshalUpgradedGiftAttributeRarityEpic(data) + + case TypeUpgradedGiftAttributeRarityLegendary: + return UnmarshalUpgradedGiftAttributeRarityLegendary(data) + case TypeUpgradedGiftModel: return UnmarshalUpgradedGiftModel(data) @@ -25870,6 +26481,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradeGiftResult: return UnmarshalUpgradeGiftResult(data) + case TypeCraftGiftResultSuccess: + return UnmarshalCraftGiftResultSuccess(data) + + case TypeCraftGiftResultTooEarly: + return UnmarshalCraftGiftResultTooEarly(data) + + case TypeCraftGiftResultInvalidGift: + return UnmarshalCraftGiftResultInvalidGift(data) + + case TypeCraftGiftResultFail: + return UnmarshalCraftGiftResultFail(data) + case TypeAvailableGift: return UnmarshalAvailableGift(data) @@ -25930,6 +26553,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReceivedGifts: return UnmarshalReceivedGifts(data) + case TypeAttributeCraftPersistenceProbability: + return UnmarshalAttributeCraftPersistenceProbability(data) + + case TypeGiftsForCrafting: + return UnmarshalGiftsForCrafting(data) + case TypeGiftUpgradePreview: return UnmarshalGiftUpgradePreview(data) @@ -26125,6 +26754,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactionTypeUpgradedGiftSale: return UnmarshalTonTransactionTypeUpgradedGiftSale(data) + case TypeTonTransactionTypeStakeDiceStake: + return UnmarshalTonTransactionTypeStakeDiceStake(data) + + case TypeTonTransactionTypeStakeDicePayout: + return UnmarshalTonTransactionTypeStakeDicePayout(data) + case TypeTonTransactionTypeUnsupported: return UnmarshalTonTransactionTypeUnsupported(data) @@ -26776,6 +27411,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionBarJoinRequest: return UnmarshalChatActionBarJoinRequest(data) + case TypeButtonStyleDefault: + return UnmarshalButtonStyleDefault(data) + + case TypeButtonStylePrimary: + return UnmarshalButtonStylePrimary(data) + + case TypeButtonStyleDanger: + return UnmarshalButtonStyleDanger(data) + + case TypeButtonStyleSuccess: + return UnmarshalButtonStyleSuccess(data) + case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -27673,6 +28320,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) + case TypeMessageChatOwnerLeft: + return UnmarshalMessageChatOwnerLeft(data) + + case TypeMessageChatOwnerChanged: + return UnmarshalMessageChatOwnerChanged(data) + case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -28243,6 +28896,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryVideo: return UnmarshalStoryVideo(data) + case TypeStoryContentTypePhoto: + return UnmarshalStoryContentTypePhoto(data) + + case TypeStoryContentTypeVideo: + return UnmarshalStoryContentTypeVideo(data) + + case TypeStoryContentTypeLive: + return UnmarshalStoryContentTypeLive(data) + + case TypeStoryContentTypeUnsupported: + return UnmarshalStoryContentTypeUnsupported(data) + case TypeStoryContentPhoto: return UnmarshalStoryContentPhoto(data) @@ -29560,6 +30225,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroup: return UnmarshalNotificationGroup(data) + case TypeProxy: + return UnmarshalProxy(data) + case TypeOptionValueBoolean: return UnmarshalOptionValueBoolean(data) @@ -29824,8 +30492,68 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReportStoryResultTextRequired: return UnmarshalReportStoryResultTextRequired(data) - case TypeInternalLinkTypeActiveSessions: - return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeSettingsSectionAppearance: + return UnmarshalSettingsSectionAppearance(data) + + case TypeSettingsSectionAskQuestion: + return UnmarshalSettingsSectionAskQuestion(data) + + case TypeSettingsSectionBusiness: + return UnmarshalSettingsSectionBusiness(data) + + case TypeSettingsSectionChatFolders: + return UnmarshalSettingsSectionChatFolders(data) + + case TypeSettingsSectionDataAndStorage: + return UnmarshalSettingsSectionDataAndStorage(data) + + case TypeSettingsSectionDevices: + return UnmarshalSettingsSectionDevices(data) + + case TypeSettingsSectionEditProfile: + return UnmarshalSettingsSectionEditProfile(data) + + case TypeSettingsSectionFaq: + return UnmarshalSettingsSectionFaq(data) + + case TypeSettingsSectionFeatures: + return UnmarshalSettingsSectionFeatures(data) + + case TypeSettingsSectionInAppBrowser: + return UnmarshalSettingsSectionInAppBrowser(data) + + case TypeSettingsSectionLanguage: + return UnmarshalSettingsSectionLanguage(data) + + case TypeSettingsSectionMyStars: + return UnmarshalSettingsSectionMyStars(data) + + case TypeSettingsSectionMyToncoins: + return UnmarshalSettingsSectionMyToncoins(data) + + case TypeSettingsSectionNotifications: + return UnmarshalSettingsSectionNotifications(data) + + case TypeSettingsSectionPowerSaving: + return UnmarshalSettingsSectionPowerSaving(data) + + case TypeSettingsSectionPremium: + return UnmarshalSettingsSectionPremium(data) + + case TypeSettingsSectionPrivacyAndSecurity: + return UnmarshalSettingsSectionPrivacyAndSecurity(data) + + case TypeSettingsSectionPrivacyPolicy: + return UnmarshalSettingsSectionPrivacyPolicy(data) + + case TypeSettingsSectionQrCode: + return UnmarshalSettingsSectionQrCode(data) + + case TypeSettingsSectionSearch: + return UnmarshalSettingsSectionSearch(data) + + case TypeSettingsSectionSendGift: + return UnmarshalSettingsSectionSendGift(data) case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -29848,11 +30576,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeBuyStars: - return UnmarshalInternalLinkTypeBuyStars(data) - - case TypeInternalLinkTypeChangePhoneNumber: - return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeCallsPage: + return UnmarshalInternalLinkTypeCallsPage(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -29863,21 +30588,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) - case TypeInternalLinkTypeChatFolderSettings: - return UnmarshalInternalLinkTypeChatFolderSettings(data) - case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: - return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) + case TypeInternalLinkTypeChatSelection: + return UnmarshalInternalLinkTypeChatSelection(data) + + case TypeInternalLinkTypeContactsPage: + return UnmarshalInternalLinkTypeContactsPage(data) case TypeInternalLinkTypeDirectMessagesChat: return UnmarshalInternalLinkTypeDirectMessagesChat(data) - case TypeInternalLinkTypeEditProfileSettings: - return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) @@ -29899,15 +30621,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLanguageSettings: - return UnmarshalInternalLinkTypeLanguageSettings(data) - case TypeInternalLinkTypeLiveStory: return UnmarshalInternalLinkTypeLiveStory(data) - case TypeInternalLinkTypeLoginEmailSettings: - return UnmarshalInternalLinkTypeLoginEmailSettings(data) - case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -29917,35 +30633,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyStars: - return UnmarshalInternalLinkTypeMyStars(data) + case TypeInternalLinkTypeMyProfilePage: + return UnmarshalInternalLinkTypeMyProfilePage(data) - case TypeInternalLinkTypeMyToncoins: - return UnmarshalInternalLinkTypeMyToncoins(data) + case TypeInternalLinkTypeNewChannelChat: + return UnmarshalInternalLinkTypeNewChannelChat(data) + + case TypeInternalLinkTypeNewGroupChat: + return UnmarshalInternalLinkTypeNewGroupChat(data) + + case TypeInternalLinkTypeNewPrivateChat: + return UnmarshalInternalLinkTypeNewPrivateChat(data) + + case TypeInternalLinkTypeNewStory: + return UnmarshalInternalLinkTypeNewStory(data) case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) - case TypeInternalLinkTypePasswordSettings: - return UnmarshalInternalLinkTypePasswordSettings(data) - case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePhoneNumberPrivacySettings: - return UnmarshalInternalLinkTypePhoneNumberPrivacySettings(data) - - case TypeInternalLinkTypePremiumFeatures: - return UnmarshalInternalLinkTypePremiumFeatures(data) - - case TypeInternalLinkTypePremiumGift: - return UnmarshalInternalLinkTypePremiumGift(data) + case TypeInternalLinkTypePremiumFeaturesPage: + return UnmarshalInternalLinkTypePremiumFeaturesPage(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePrivacyAndSecuritySettings: - return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) + case TypeInternalLinkTypePremiumGiftPurchase: + return UnmarshalInternalLinkTypePremiumGiftPurchase(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -29959,9 +30675,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) + case TypeInternalLinkTypeSavedMessages: + return UnmarshalInternalLinkTypeSavedMessages(data) + + case TypeInternalLinkTypeSearch: + return UnmarshalInternalLinkTypeSearch(data) + case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) + case TypeInternalLinkTypeStarPurchase: + return UnmarshalInternalLinkTypeStarPurchase(data) + case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) @@ -29974,15 +30699,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) - case TypeInternalLinkTypeThemeSettings: - return UnmarshalInternalLinkTypeThemeSettings(data) - case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) - case TypeInternalLinkTypeUnsupportedProxy: - return UnmarshalInternalLinkTypeUnsupportedProxy(data) - case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -30304,11 +31023,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxyTypeMtproto: return UnmarshalProxyTypeMtproto(data) - case TypeProxy: - return UnmarshalProxy(data) + case TypeAddedProxy: + return UnmarshalAddedProxy(data) - case TypeProxies: - return UnmarshalProxies(data) + case TypeAddedProxies: + return UnmarshalAddedProxies(data) case TypeInputSticker: return UnmarshalInputSticker(data) diff --git a/data/td_api.tl b/data/td_api.tl index c4e58c4..1423dab 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -558,7 +558,7 @@ game id:int64 short_name:string title:string text:formattedText description:stri //@description Describes state of the stake dice //@state_hash Hash of the state to use for sending the next dice; may be empty if the stake dice can't be sent by the current user -//@stake_toncoin_amount The amount of Toncoins that was staked in the previous roll; in the smallest units of the currency +//@stake_toncoin_amount The Toncoin amount that was staked in the previous roll; in the smallest units of the currency //@suggested_stake_toncoin_amounts The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency //@current_streak The number of rolled sixes towards the streak; 0-2 //@prize_per_mille The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 1-6 correspondingly; may be empty if the stake dice can't be sent by the current user @@ -679,13 +679,14 @@ userTypeDeleted = UserType; //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages //@has_main_web_app True, if the bot has the main Web App //@has_topics True, if the bot has topics +//@allows_users_to_create_topics True, if users can create and delete topics in the chat with the bot //@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 //@active_user_count The number of recently active users of the bot -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool allows_users_to_create_topics:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = 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; @@ -731,7 +732,7 @@ 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 +//@description Describes a user who had or will have a birthday soon @user_id User identifier @birthdate Birthdate of the user closeBirthdayUser user_id:int53 birthdate:birthdate = CloseBirthdayUser; @@ -784,7 +785,7 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@can_edit_bio True, if the bot can edit bio of the business account //@can_edit_profile_photo True, if the bot can edit profile photo of the business account //@can_edit_username True, if the bot can edit username of the business account -//@can_view_gifts_and_stars True, if the bot can view gifts and amount of Telegram Stars owned by the business account +//@can_view_gifts_and_stars True, if the bot can view gifts and Telegram Star amount owned by the business account //@can_sell_gifts True, if the bot can sell regular gifts received by the business account //@can_change_gift_settings True, if the bot can change gift receiving settings of the business account //@can_transfer_and_upgrade_gifts True, if the bot can transfer and upgrade gifts received by the business account @@ -951,7 +952,7 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa //@class GiftResalePrice @description Describes price of a resold gift //@description Describes price of a resold gift in Telegram Stars -//@star_count The amount of Telegram Stars expected to be paid for the gift. Must be in the range +//@star_count The Telegram Star amount expected to be paid for the gift. Must be in the range //-getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale giftResalePriceStar star_count:int53 = GiftResalePrice; @@ -976,7 +977,7 @@ giftPurchaseOfferStateRejected = GiftPurchaseOfferState; //@class SuggestedPostPrice @description Describes price of a suggested post //@description Describes price of a suggested post in Telegram Stars -//@star_count The amount of Telegram Stars expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") +//@star_count The Telegram Star amount expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") suggestedPostPriceStar star_count:int53 = SuggestedPostPrice; //@description Describes price of a suggested post in Toncoins @@ -1022,8 +1023,8 @@ suggestedPostRefundReasonPostDeleted = SuggestedPostRefundReason; suggestedPostRefundReasonPaymentRefunded = SuggestedPostRefundReason; -//@description Describes a possibly non-integer amount of Telegram Stars -//@star_count The integer amount of Telegram Stars rounded to 0 +//@description Describes a possibly non-integer Telegram Star amount +//@star_count The integer Telegram Star amount rounded to 0 //@nanostar_count The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 starAmount star_count:int53 nanostar_count:int32 = StarAmount; @@ -1045,7 +1046,7 @@ starSubscriptionTypeBot is_canceled_by_bot:Bool title:string photo:photo invoice //@description Describes subscription plan paid in Telegram Stars //@period The number of seconds between consecutive Telegram Star debiting -//@star_count The amount of Telegram Stars that must be paid for each period +//@star_count The Telegram Star amount that must be paid for each period starSubscriptionPricing period:int32 star_count:int53 = StarSubscriptionPricing; //@description Contains information about subscription to a channel chat, a bot, or a business account that was paid in Telegram Stars @@ -1106,7 +1107,7 @@ affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_ //@description Contains information about an affiliate that received commission from a Telegram Star transaction //@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner //@affiliate_chat_id Identifier of the chat which received the commission -//@star_amount The amount of Telegram Stars that were received by the affiliate; can be negative for refunds +//@star_amount The Telegram Star amount that was received by the affiliate; can be negative for refunds affiliateInfo commission_per_mille:int32 affiliate_chat_id:int53 star_amount:starAmount = AffiliateInfo; //@description Describes a found affiliate program @@ -1163,7 +1164,7 @@ premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is //@description Describes an option for gifting Telegram Premium to a user. Use telegramPaymentPurposePremiumGift for out-of-store payments or payments in Telegram Stars //@currency ISO 4217 currency code for the payment //@amount The amount to pay, in the smallest units of the currency -//@star_count The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible +//@star_count The alternative Telegram Star amount to pay; 0 if payment in Telegram Stars is not possible //@discount_percentage The discount associated with this option, as a percentage //@month_count Number of months the Telegram Premium subscription will be active //@store_product_id Identifier of the store product associated with the option @@ -1186,7 +1187,7 @@ premiumGiveawayPaymentOption currency:string amount:int53 winner_count:int32 mon premiumGiveawayPaymentOptions options:vector = PremiumGiveawayPaymentOptions; //@description Contains information about a Telegram Premium gift code -//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used +//@creator_id Identifier of a chat or a user who created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used //@creation_date Point in time (Unix timestamp) when the code was created //@is_from_giveaway True, if the gift code was created for a giveaway //@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; may be 0 or an identifier of a deleted message @@ -1306,18 +1307,41 @@ upgradedGiftOriginPrepaidUpgrade = UpgradedGiftOrigin; //@description The gift was bought through an offer @price Price paid for the gift upgradedGiftOriginOffer price:GiftResalePrice = UpgradedGiftOrigin; +//@description The gift was crafted from other gifts +upgradedGiftOriginCraft = UpgradedGiftOrigin; + + +//@class UpgradedGiftAttributeRarity @description Describes rarity of an upgraded gift attribute + +//@description The rarity is represented as the numeric frequence of the model +//@per_mille The number of upgraded gifts that receive this attribute for each 1000 gifts upgraded; if 0, then it can be shown as "<0.1%" +upgradedGiftAttributeRarityPerMille per_mille:int32 = UpgradedGiftAttributeRarity; + +//@description The attribute is uncommon +upgradedGiftAttributeRarityUncommon = UpgradedGiftAttributeRarity; + +//@description The attribute is rare +upgradedGiftAttributeRarityRare = UpgradedGiftAttributeRarity; + +//@description The attribute is epic +upgradedGiftAttributeRarityEpic = UpgradedGiftAttributeRarity; + +//@description The attribute is legendary +upgradedGiftAttributeRarityLegendary = UpgradedGiftAttributeRarity; + //@description Describes a model of an upgraded gift //@name Name of the model //@sticker The sticker representing the upgraded gift -//@rarity_per_mille The number of upgraded gifts that receive this model for each 1000 gifts upgraded -upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel; +//@rarity The rarity of the model +//@is_crafted True, if the model can be obtained only through gift crafting +upgradedGiftModel name:string sticker:sticker rarity:UpgradedGiftAttributeRarity is_crafted:Bool = UpgradedGiftModel; //@description Describes a symbol shown on the pattern of an upgraded gift //@name Name of the symbol //@sticker The sticker representing the symbol -//@rarity_per_mille The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded -upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol; +//@rarity The rarity of the symbol +upgradedGiftSymbol name:string sticker:sticker rarity:UpgradedGiftAttributeRarity = UpgradedGiftSymbol; //@description Describes colors of a backdrop of an upgraded gift //@center_color A color in the center of the backdrop in the RGB format @@ -1330,8 +1354,8 @@ upgradedGiftBackdropColors center_color:int32 edge_color:int32 symbol_color:int3 //@id Unique identifier of the backdrop //@name Name of the backdrop //@colors Colors of the backdrop -//@rarity_per_mille The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded -upgradedGiftBackdrop id:int32 name:string colors:upgradedGiftBackdropColors rarity_per_mille:int32 = UpgradedGiftBackdrop; +//@rarity The rarity of the backdrop +upgradedGiftBackdrop id:int32 name:string colors:upgradedGiftBackdropColors rarity:UpgradedGiftAttributeRarity = UpgradedGiftBackdrop; //@description Describes the original details about the gift //@sender_id Identifier of the user or the chat that sent the gift; may be null if the gift was private @@ -1380,6 +1404,8 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@number Unique number of the upgraded gift among gifts upgraded from the same gift //@total_upgraded_count Total number of gifts that were upgraded from the same gift //@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift +//@is_burned True, if the gift was used to craft another gift +//@is_crafted True, if the gift was craft from another gifts //@is_premium True, if the original gift could have been bought only by Telegram Premium subscribers //@is_theme_available True, if the gift can be used to set a theme in a chat //@used_theme_chat_id Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn't owned by the current user @@ -1392,20 +1418,21 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@symbol Symbol of the upgraded gift //@backdrop Backdrop of the upgraded gift //@original_details Information about the originally sent gift; may be null if unknown -//@colors Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none +//@colors Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none or unknown //@resale_parameters Resale parameters of the gift; may be null if resale isn't possible //@can_send_purchase_offer True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer +//@craft_probability_per_mille Probability that the gift adds to the chance of successful crafting of a new gift; 0 if the gift can't be used for crafting //@value_currency ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable //@value_amount Estimated value of the gift; in the smallest units of the currency; 0 if unavailable //@value_usd_amount Estimated value of the gift in USD; in USD cents; 0 if unavailable -upgradedGift id:int64 regular_gift_id:int64 publisher_chat_id:int53 title:string name:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 is_premium:Bool is_theme_available:Bool used_theme_chat_id:int53 host_id:MessageSender owner_id:MessageSender owner_address:string owner_name:string gift_address:string model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails colors:upgradedGiftColors resale_parameters:giftResaleParameters can_send_purchase_offer:Bool value_currency:string value_amount:int53 value_usd_amount:int53 = UpgradedGift; +upgradedGift id:int64 regular_gift_id:int64 publisher_chat_id:int53 title:string name:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 is_burned:Bool is_crafted:Bool is_premium:Bool is_theme_available:Bool used_theme_chat_id:int53 host_id:MessageSender owner_id:MessageSender owner_address:string owner_name:string gift_address:string model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails colors:upgradedGiftColors resale_parameters:giftResaleParameters can_send_purchase_offer:Bool craft_probability_per_mille:int32 value_currency:string value_amount:int53 value_usd_amount:int53 = UpgradedGift; //@description Contains information about value of an upgraded gift //@currency ISO 4217 currency code of the currency in which the prices are represented //@value Estimated value of the gift; in the smallest units of the currency //@is_value_average True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift //@initial_sale_date Point in time (Unix timestamp) when the corresponding regular gift was originally purchased -//@initial_sale_star_count Amount of Telegram Stars that were paid for the gift +//@initial_sale_star_count The Telegram Star amount that was paid for the gift //@initial_sale_price Initial price of the gift; in the smallest units of the currency //@last_sale_date Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never //@last_sale_price Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold @@ -1429,6 +1456,24 @@ upgradedGiftValueInfo currency:string value:int53 is_value_average:Bool initial_ //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past upgradeGiftResult gift:upgradedGift received_gift_id:string is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 = UpgradeGiftResult; + +//@class CraftGiftResult @description Contains result of gift crafting + +//@description Crafting was successful +//@gift The created gift +//@received_gift_id Unique identifier of the received gift for the current user +craftGiftResultSuccess gift:upgradedGift received_gift_id:string = CraftGiftResult; + +//@description Crafting isn't possible because one of the gifts can't be used for crafting yet @retry_after Time left before the gift can be used for crafting +craftGiftResultTooEarly retry_after:int32 = CraftGiftResult; + +//@description Crafting isn't possible because one of the gifts isn't suitable for crafting +craftGiftResultInvalidGift = CraftGiftResult; + +//@description Crafting has failed +craftGiftResultFail = CraftGiftResult; + + //@description Describes a gift that is available for purchase //@gift The gift //@resale_count Number of gifts that are available for resale @@ -1442,7 +1487,7 @@ availableGifts gifts:vector = AvailableGifts; //@description Describes a price required to pay to upgrade a gift //@date Point in time (Unix timestamp) when the price will be in effect -//@star_count The amount of Telegram Stars required to pay to upgrade the gift +//@star_count The Telegram Star amount required to pay to upgrade the gift giftUpgradePrice date:int32 star_count:int53 = GiftUpgradePrice; @@ -1498,7 +1543,8 @@ giftsForResale total_count:int32 gifts:vector models:vector sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 prepaid_upgrade_hash:string = ReceivedGift; +//@craft_date Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift +receivedGift received_gift_id:string sender_id:MessageSender text:formattedText unique_gift_number:int32 is_private:Bool is_saved:Bool is_pinned:Bool can_be_upgraded:Bool can_be_transferred:Bool was_refunded:Bool date:int32 gift:SentGift collection_ids:vector sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 prepaid_upgrade_hash:string craft_date:int32 = ReceivedGift; //@description Represents a list of gifts received by a user or a chat //@total_count The total number of received gifts @@ -1545,6 +1592,19 @@ receivedGift received_gift_id:string sender_id:MessageSender text:formattedText //@next_offset The offset for the next request. If empty, then there are no more results receivedGifts total_count:int32 gifts:vector are_notifications_enabled:Bool next_offset:string = ReceivedGifts; +//@description Describes chance of the crafted gift to have the backdrop or symbol of one of the original gifts +//@persistence_chance_per_mille The 4 numbers that describe probability of the craft result to have the same attribute as one of the original gifts +//-if 1, 2, 3, or 4 gifts with the attribute are used in the craft. Each number represents the number of crafted gifts with the original attribute per 1000 successful craftings +attributeCraftPersistenceProbability persistence_chance_per_mille:vector = AttributeCraftPersistenceProbability; + +//@description Represents a list of gifts received by a user or a chat +//@total_count The total number of received gifts +//@gifts The list of gifts +//@attribute_persistence_probabilities The 4 objects that describe probabilities of the crafted gift to have the backdrop or symbol of one of the original gifts +//-for the cases when 1, 2, 3 or 4 gifts are used in the craft correspondingly +//@next_offset The offset for the next request. If empty, then there are no more results +giftsForCrafting total_count:int32 gifts:vector attribute_persistence_probabilities:vector next_offset:string = GiftsForCrafting; + //@description Contains examples of possible upgraded gifts for the given regular gift //@models Examples of possible models that can be chosen for the gift after upgrade //@symbols Examples of possible symbols that can be chosen for the gift after upgrade @@ -1655,7 +1715,7 @@ starTransactionTypeGooglePlayDeposit = StarTransactionType; starTransactionTypeFragmentDeposit = StarTransactionType; //@description The transaction is a deposit of Telegram Stars by another user; relevant for regular users only -//@user_id Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous +//@user_id Identifier of the user who gifted Telegram Stars; 0 if the user was anonymous //@sticker The sticker to be shown in the transaction information; may be null if unknown starTransactionTypeUserDeposit user_id:int53 sticker:sticker = StarTransactionType; @@ -1675,12 +1735,12 @@ starTransactionTypeTelegramAdsWithdrawal = StarTransactionType; starTransactionTypeTelegramApiUsage request_count:int32 = StarTransactionType; //@description The transaction is a purchase of paid media from a bot or a business account by the current user; relevant for regular users only -//@user_id Identifier of the bot or the business account user that sent the paid media +//@user_id Identifier of the bot or the business account user who sent the paid media //@media The bought media if the transaction wasn't refunded starTransactionTypeBotPaidMediaPurchase user_id:int53 media:vector = StarTransactionType; //@description The transaction is a sale of paid media by the bot or a business account managed by the bot; relevant for bots only -//@user_id Identifier of the user that bought the media +//@user_id Identifier of the user who bought the media //@media The bought media //@payload Bot-provided payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none @@ -1693,31 +1753,31 @@ starTransactionTypeBotPaidMediaSale user_id:int53 media:vector payloa starTransactionTypeChannelPaidMediaPurchase chat_id:int53 message_id:int53 media:vector = StarTransactionType; //@description The transaction is a sale of paid media by the channel chat; relevant for channel chats only -//@user_id Identifier of the user that bought the media +//@user_id Identifier of the user who bought the media //@message_id Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message //@media The bought media starTransactionTypeChannelPaidMediaSale user_id:int53 message_id:int53 media:vector = StarTransactionType; //@description The transaction is a purchase of a product from a bot or a business account by the current user; relevant for regular users only -//@user_id Identifier of the bot or the business account user that created the invoice +//@user_id Identifier of the bot or the business account user who created the invoice //@product_info Information about the bought product starTransactionTypeBotInvoicePurchase user_id:int53 product_info:productInfo = StarTransactionType; //@description The transaction is a sale of a product by the bot; relevant for bots only -//@user_id Identifier of the user that bought the product +//@user_id Identifier of the user who bought the product //@product_info Information about the bought product //@invoice_payload Invoice payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotInvoiceSale user_id:int53 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; //@description The transaction is a purchase of a subscription from a bot or a business account by the current user; relevant for regular users only -//@user_id Identifier of the bot or the business account user that created the subscription link +//@user_id Identifier of the bot or the business account user who created the subscription link //@subscription_period The number of seconds between consecutive Telegram Star debitings //@product_info Information about the bought subscription starTransactionTypeBotSubscriptionPurchase user_id:int53 subscription_period:int32 product_info:productInfo = StarTransactionType; //@description The transaction is a sale of a subscription by the bot; relevant for bots only -//@user_id Identifier of the user that bought the subscription +//@user_id Identifier of the user who bought the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings //@product_info Information about the bought subscription //@invoice_payload Invoice payload @@ -1730,11 +1790,11 @@ starTransactionTypeBotSubscriptionSale user_id:int53 subscription_period:int32 p starTransactionTypeChannelSubscriptionPurchase chat_id:int53 subscription_period:int32 = StarTransactionType; //@description The transaction is a sale of a subscription by the channel chat; relevant for channel chats only -//@user_id Identifier of the user that bought the subscription +//@user_id Identifier of the user who bought the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a bid on a gift auction; relevant for regular users only @owner_id Identifier of the user that will receive the gift @gift The gift +//@description The transaction is a bid on a gift auction; relevant for regular users only @owner_id Identifier of the user who will receive the gift @gift The gift starTransactionTypeGiftAuctionBid owner_id:MessageSender gift:gift = StarTransactionType; //@description The transaction is a purchase of a regular gift; relevant for regular users and bots only @owner_id Identifier of the user or the channel that received the gift @gift The gift @@ -1749,23 +1809,23 @@ starTransactionTypeGiftTransfer owner_id:MessageSender gift:upgradedGift = StarT //@description The transaction is a drop of original details of an upgraded gift; relevant for regular users only @owner_id Identifier of the user or the channel that owns the gift @gift The gift starTransactionTypeGiftOriginalDetailsDrop owner_id:MessageSender gift:upgradedGift = StarTransactionType; -//@description The transaction is a sale of a received gift; relevant for regular users and channel chats only @user_id Identifier of the user that sent the gift @gift The gift +//@description The transaction is a sale of a received gift; relevant for regular users and channel chats only @user_id Identifier of the user who sent the gift @gift The gift starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; -//@description The transaction is an upgrade of a gift; relevant for regular users only @user_id Identifier of the user that initially sent the gift @gift The upgraded gift +//@description The transaction is an upgrade of a gift; relevant for regular users only @user_id Identifier of the user who initially sent the gift @gift The upgraded gift starTransactionTypeGiftUpgrade user_id:int53 gift:upgradedGift = StarTransactionType; //@description The transaction is a purchase of an upgrade of a gift owned by another user or channel; relevant for regular users only @owner_id Owner of the upgraded gift @gift The gift starTransactionTypeGiftUpgradePurchase owner_id:MessageSender gift:gift = StarTransactionType; -//@description The transaction is a purchase of an upgraded gift for some user or channel; relevant for regular users only @user_id Identifier of the user that sold the gift @gift The gift +//@description The transaction is a purchase of an upgraded gift for some user or channel; relevant for regular users only @user_id Identifier of the user who sold the gift @gift The gift starTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = StarTransactionType; //@description The transaction is a sale of an upgraded gift; relevant for regular users only -//@user_id Identifier of the user that bought the gift +//@user_id Identifier of the user who bought the gift //@gift The gift //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds //@via_offer True, if the gift was sold through a purchase offer starTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_star_amount:starAmount via_offer:Bool = StarTransactionType; @@ -1775,7 +1835,7 @@ starTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_p starTransactionTypeChannelPaidReactionSend chat_id:int53 message_id:int53 = StarTransactionType; //@description The transaction is a receiving of a paid reaction to a message by the channel chat; relevant for channel chats only -//@user_id Identifier of the user that added the paid reaction +//@user_id Identifier of the user who added the paid reaction //@message_id Identifier of the reacted message; may be 0 or an identifier of a deleted message starTransactionTypeChannelPaidReactionReceive user_id:int53 message_id:int53 = StarTransactionType; @@ -1791,7 +1851,7 @@ starTransactionTypePaidMessageSend chat_id:int53 message_count:int32 = StarTrans //@sender_id Identifier of the sender of the message //@message_count Number of received paid messages //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds starTransactionTypePaidMessageReceive sender_id:MessageSender message_count:int32 commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; //@description The transaction is a sending of a paid group call message; relevant for regular users only @chat_id Identifier of the chat that received the payment @@ -1800,7 +1860,7 @@ starTransactionTypePaidGroupCallMessageSend chat_id:int53 = StarTransactionType; //@description The transaction is a receiving of a paid group call message; relevant for regular users and channel chats only //@sender_id Identifier of the sender of the message //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds starTransactionTypePaidGroupCallMessageReceive sender_id:MessageSender commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; //@description The transaction is a sending of a paid group reaction; relevant for regular users only @chat_id Identifier of the chat that received the payment @@ -1809,7 +1869,7 @@ starTransactionTypePaidGroupCallReactionSend chat_id:int53 = StarTransactionType //@description The transaction is a receiving of a paid group call reaction; relevant for regular users and channel chats only //@sender_id Identifier of the sender of the reaction //@commission_per_mille The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for reaction sending -//@commission_star_amount The amount of Telegram Stars that were received by Telegram; can be negative for refunds +//@commission_star_amount The Telegram Star amount that was received by Telegram; can be negative for refunds starTransactionTypePaidGroupCallReactionReceive sender_id:MessageSender commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; //@description The transaction is a payment for a suggested post; relevant for regular users only @@ -1817,11 +1877,11 @@ starTransactionTypePaidGroupCallReactionReceive sender_id:MessageSender commissi starTransactionTypeSuggestedPostPaymentSend chat_id:int53 = StarTransactionType; //@description The transaction is a receiving of a payment for a suggested post by the channel chat; relevant for channel chats only -//@user_id Identifier of the user that paid for the suggested post +//@user_id Identifier of the user who paid for the suggested post starTransactionTypeSuggestedPostPaymentReceive user_id:int53 = StarTransactionType; //@description The transaction is a purchase of Telegram Premium subscription; relevant for regular users and bots only -//@user_id Identifier of the user that received the Telegram Premium subscription +//@user_id Identifier of the user who received the Telegram Premium subscription //@month_count Number of months the Telegram Premium subscription will be active //@sticker A sticker to be shown in the transaction information; may be null if unknown starTransactionTypePremiumPurchase user_id:int53 month_count:int32 sticker:sticker = StarTransactionType; @@ -1829,7 +1889,7 @@ starTransactionTypePremiumPurchase user_id:int53 month_count:int32 sticker:stick //@description The transaction is a transfer of Telegram Stars to a business bot; relevant for regular users only @user_id Identifier of the bot that received Telegram Stars starTransactionTypeBusinessBotTransferSend user_id:int53 = StarTransactionType; -//@description The transaction is a transfer of Telegram Stars from a business account; relevant for bots only @user_id Identifier of the user that sent Telegram Stars +//@description The transaction is a transfer of Telegram Stars from a business account; relevant for bots only @user_id Identifier of the user who sent Telegram Stars starTransactionTypeBusinessBotTransferReceive user_id:int53 = StarTransactionType; //@description The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only @@ -1870,17 +1930,23 @@ tonTransactionTypeSuggestedPostPayment chat_id:int53 = TonTransactionType; //@description The transaction is an offer of gift purchase @gift The gift tonTransactionTypeGiftPurchaseOffer gift:upgradedGift = TonTransactionType; -//@description The transaction is a purchase of an upgraded gift for some user or channel @user_id Identifier of the user that sold the gift @gift The gift +//@description The transaction is a purchase of an upgraded gift for some user or channel @user_id Identifier of the user who sold the gift @gift The gift tonTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = TonTransactionType; //@description The transaction is a sale of an upgraded gift -//@user_id Identifier of the user that bought the gift +//@user_id Identifier of the user who bought the gift //@gift The gift //@commission_per_mille The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift -//@commission_toncoin_amount The amount of Toncoins that were received by the Telegram; in the smallest units of the currency +//@commission_toncoin_amount The Toncoin amount that was received by the Telegram; in the smallest units of the currency //@via_offer True, if the gift was sold through a purchase offer tonTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_toncoin_amount:int53 via_offer:Bool = TonTransactionType; +//@description The transaction is a payment for stake dice throw +tonTransactionTypeStakeDiceStake = TonTransactionType; + +//@description The transaction is a payment for successful stake dice throw +tonTransactionTypeStakeDicePayout = TonTransactionType; + //@description The transaction is a transaction of an unsupported type tonTransactionTypeUnsupported = TonTransactionType; @@ -1947,7 +2013,7 @@ giveawayInfoOngoing creation_date:int32 status:GiveawayParticipantStatus is_ende //@winner_count Number of winners in the giveaway //@activation_count Number of winners, which activated their gift codes; for Telegram Premium giveaways only //@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway -//@won_star_count The amount of Telegram Stars won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway +//@won_star_count The Telegram Star amount won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway giveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool is_winner:Bool winner_count:int32 activation_count:int32 gift_code:string won_star_count:int53 = GiveawayInfo; @@ -2178,7 +2244,7 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus; //@description Describes a user or a chat as a member of another chat //@member_id Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels -//@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown +//@inviter_user_id Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown //@joined_chat_date Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat //@status Status of the member in the chat chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember; @@ -2313,7 +2379,7 @@ chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool fo chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool verification_status:verificationStatus = ChatInviteLinkInfo; -//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user +//@description Describes a user who sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user chatJoinRequest user_id:int53 date:int32 bio:string = ChatJoinRequest; //@description Contains a list of requests to join a chat @total_count Approximate total number of requests found @requests List of the requests @@ -2457,7 +2523,7 @@ publicPostSearchLimits daily_free_query_count:int32 remaining_free_query_count:i //@class MessageSender @description Contains information about the sender of a message -//@description The message was sent by a known user @user_id Identifier of the user that sent the message +//@description The message was sent by a known user @user_id Identifier of the user who sent the message messageSenderUser user_id:int53 = MessageSender; //@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message @@ -2502,7 +2568,7 @@ messageViewers viewers:vector = MessageViewers; //@class MessageOrigin @description Contains information about the origin of a message -//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message +//@description The message was originally sent by a known user @sender_user_id Identifier of the user who originally sent the message messageOriginUser sender_user_id:int53 = MessageOrigin; //@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender @@ -2554,7 +2620,7 @@ paidReactionTypeAnonymous = PaidReactionType; paidReactionTypeChat chat_id:int53 = PaidReactionType; -//@description Contains information about a user that added paid reactions +//@description Contains information about a user who added paid reactions //@sender_id Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user //@star_count Number of Telegram Stars added //@is_top True, if the reactor is one of the most active reactors; may be false if the reactor is the current user @@ -3198,7 +3264,7 @@ chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int chats total_count:int32 chat_ids:vector = Chats; -//@description Contains information about a user that has failed to be added to a chat +//@description Contains information about a user who has failed to be added to a chat //@user_id User identifier //@premium_would_allow_invite True, if subscription to Telegram Premium would have allowed to add the user to the chat //@premium_required_to_send_messages True, if subscription to Telegram Premium is required to send the user chat invite link @@ -3221,7 +3287,7 @@ publicChatTypeHasUsername = PublicChatType; publicChatTypeIsLocationBased = PublicChatType; -//@description Contains basic information about another user that started a chat with the current user +//@description Contains basic information about another user who started a chat with the current user //@registration_month Month when the user was registered in Telegram; 0-12; may be 0 if unknown //@registration_year Year when the user was registered in Telegram; 0-9999; may be 0 if unknown //@phone_number_country_code A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user; may be empty if unknown @@ -3258,6 +3324,21 @@ chatActionBarSharePhoneNumber = ChatActionBar; chatActionBarJoinRequest title:string is_channel:Bool request_date:int32 = ChatActionBar; +//@class ButtonStyle @description Describes style of a button + +//@description The button has default style +buttonStyleDefault = ButtonStyle; + +//@description The button has dark blue color +buttonStylePrimary = ButtonStyle; + +//@description The button has red color +buttonStyleDanger = ButtonStyle; + +//@description The button has green color +buttonStyleSuccess = ButtonStyle; + + //@class KeyboardButtonType @description Describes a keyboard button type //@description A simple button, with text that must be sent when the button is pressed @@ -3304,8 +3385,12 @@ keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_for keyboardButtonTypeWebApp url:string = KeyboardButtonType; -//@description Represents a single button in a bot keyboard @text Text of the button @type Type of the button -keyboardButton text:string type:KeyboardButtonType = KeyboardButton; +//@description Represents a single button in a bot keyboard +//@text Text of the button +//@icon_custom_emoji_id Identifier of the custom emoji that must be shown on the button; 0 if none +//@style Style of the button +//@type Type of the button +keyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:KeyboardButtonType = KeyboardButton; //@class InlineKeyboardButtonType @description Describes the type of inline keyboard button @@ -3341,8 +3426,12 @@ inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; inlineKeyboardButtonTypeCopyText text:string = InlineKeyboardButtonType; -//@description Represents a single button in an inline keyboard @text Text of the button @type Type of the button -inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton; +//@description Represents a single button in an inline keyboard +//@text Text of the button +//@icon_custom_emoji_id Identifier of the custom emoji that must be shown on the button; 0 if none +//@style Style of the button +//@type Type of the button +inlineKeyboardButton text:string icon_custom_emoji_id:int64 style:ButtonStyle type:InlineKeyboardButtonType = InlineKeyboardButton; //@class ReplyMarkup @description Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots @@ -3380,7 +3469,12 @@ loginUrlInfoOpen url:string skip_confirmation:Bool = LoginUrlInfo; //@domain A domain of the URL //@bot_user_id User identifier of a bot linked with the website //@request_write_access True, if the user must be asked for the permission to the bot to send them messages -loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo; +//@request_phone_number_access True, if the user must be asked for the permission to share their phone number +//@browser The version of a browser used for the authorization; may be empty if irrelevant +//@platform Operating system the browser is running on; may be empty if irrelevant +//@ip_address IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant +//@location Human-readable description of a country and a region from which the authorization is performed, based on the IP address; may be empty if irrelevant +loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool browser:string platform:string ip_address:string location:string = LoginUrlInfo; //@description Contains parameters of the application theme @@ -4645,8 +4739,8 @@ messagePoll poll:poll = MessageContent; //@initial_state The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known //@final_state The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known //@value The dice value. If the value is 0, then the dice don't have final state yet -//@stake_toncoin_amount The amount of Toncoins that were staked; in the smallest units of the currency -//@prize_toncoin_amount The amount of Toncoins that were gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet +//@stake_toncoin_amount The Toncoin amount that was staked; in the smallest units of the currency +//@prize_toncoin_amount The Toncoin amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet messageStakeDice initial_state:DiceStickers final_state:DiceStickers value:int32 stake_toncoin_amount:int53 prize_toncoin_amount:int53 = MessageContent; //@description A message with a forwarded story @@ -4676,12 +4770,13 @@ messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = Mess //@description A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, //-and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. //-Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden +//@unique_id Persistent unique group call identifier //@is_active True, if the call is active, i.e. the called user joined the call //@was_missed True, if the called user missed or declined the call //@is_video True, if the call is a video call //@duration Call duration, in seconds; for left calls only //@other_participant_ids Identifiers of some other call participants -messageGroupCall is_active:Bool was_missed:Bool is_video:Bool duration:int32 other_participant_ids:vector = MessageContent; +messageGroupCall unique_id:int64 is_active:Bool was_missed:Bool is_video:Bool duration:int32 other_participant_ids:vector = MessageContent; //@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator messageVideoChatScheduled group_call_id:int32 start_date:int32 = MessageContent; @@ -4710,6 +4805,12 @@ messageChatChangePhoto photo:chatPhoto = MessageContent; //@description A deleted chat photo messageChatDeletePhoto = MessageContent; +//@description The owner of the chat has left @new_owner_user_id Identifier of the user who will become the new owner of the chat if the previous owner isn't return; 0 if none +messageChatOwnerLeft new_owner_user_id:int53 = MessageContent; + +//@description The owner of the chat has changed @new_owner_user_id Identifier of the user who is the new owner of the chat +messageChatOwnerChanged new_owner_user_id:int53 = MessageContent; + //@description New chat members were added @member_user_ids User identifiers of the new members messageChatAddMembers member_user_ids:vector = MessageContent; @@ -4813,8 +4914,8 @@ messagePaymentSuccessfulBot currency:string total_amount:int53 subscription_unti messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 invoice_payload:bytes telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description Telegram Premium was gifted to a user -//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Telegram Premium; 0 if the gift is incoming +//@gifter_user_id The identifier of a user who gifted Telegram Premium; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Telegram Premium; 0 if the gift is incoming //@text Message added to the gifted Telegram Premium by the sender //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency @@ -4826,7 +4927,7 @@ messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedText currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 day_count:int32 sticker:sticker = MessageContent; //@description A Telegram Premium gift code was created for the user -//@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown +//@creator_id Identifier of a chat or a user who created the gift code; may be null if unknown //@text Message added to the gift //@is_from_giveaway True, if the gift code was created for a giveaway //@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen @@ -4873,8 +4974,8 @@ messageGiveawayCompleted giveaway_message_id:int53 winner_count:int32 is_star_gi messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool prize:GiveawayPrize prize_description:string winner_count:int32 winner_user_ids:vector unclaimed_prize_count:int32 = MessageContent; //@description Telegram Stars were gifted to a user -//@gifter_user_id The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Telegram Stars; 0 if the gift is incoming +//@gifter_user_id The identifier of a user who gifted Telegram Stars; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Telegram Stars; 0 if the gift is incoming //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none @@ -4885,9 +4986,9 @@ messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additiona messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 star_count:int53 transaction_id:string sticker:sticker = MessageContent; //@description Toncoins were gifted to a user -//@gifter_user_id The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing -//@receiver_user_id The identifier of a user that received Toncoins; 0 if the gift is incoming -//@ton_amount The received amount of Toncoins, in the smallest units of the cryptocurrency +//@gifter_user_id The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user who received Toncoins; 0 if the gift is incoming +//@ton_amount The received Toncoin amount, in the smallest units of the cryptocurrency //@transaction_id Identifier of the transaction for Toncoin credit; for receiver only //@sticker A sticker to be shown in the message; may be null if unknown messageGiftedTon gifter_user_id:int53 receiver_user_id:int53 ton_amount:int53 transaction_id:string sticker:sticker = MessageContent; @@ -4937,7 +5038,8 @@ messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received //@next_transfer_date Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift //@next_resale_date Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can't be resold; only for the receiver of the gift //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift -messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 = MessageContent; +//@craft_date Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift +messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin received_gift_id:string is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 drop_original_details_star_count:int53 next_transfer_date:int32 next_resale_date:int32 export_date:int32 craft_date:int32 = MessageContent; //@description A gift which purchase, upgrade or transfer were refunded //@gift The gift @@ -5333,7 +5435,7 @@ inputMessagePoll question:formattedText options:vector is_anonymo //@description A stake dice message //@state_hash Hash of the stake dice state. The state hash can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState -//@stake_toncoin_amount The amount of Toncoins that will be staked; in the smallest units of the currency. Must be in the range +//@stake_toncoin_amount The Toncoin amount that will be staked; in the smallest units of the currency. Must be in the range //-getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") //@clear_draft True, if the chat message draft must be deleted inputMessageStakeDice state_hash:string stake_toncoin_amount:int53 clear_draft:Bool = InputMessageContent; @@ -5743,6 +5845,21 @@ inputStoryAreas areas:vector = InputStoryAreas; storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 cover_frame_timestamp:double video:file = StoryVideo; +//@class StoryContentType @description Contains the type of the content of a story + +//@description A photo story +storyContentTypePhoto = StoryContentType; + +//@description A video story +storyContentTypeVideo = StoryContentType; + +//@description A live story +storyContentTypeLive = StoryContentType; + +//@description A story of unknown content type +storyContentTypeUnsupported = StoryContentType; + + //@class StoryContent @description Contains the content of a story //@description A photo story @photo The photo @@ -5820,7 +5937,7 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@can_be_deleted True, if the story can be deleted //@can_be_edited True, if the story can be edited //@can_be_forwarded True, if the story can be forwarded as a message or reposted as a story. Otherwise, screenshotting and saving of the story content must be also forbidden -//@can_be_replied True, if the story can be replied in the chat with the user that posted the story +//@can_be_replied True, if the story can be replied in the chat with the user who posted the story //@can_set_privacy_settings True, if the story privacy settings can be changed //@can_toggle_is_posted_to_chat_page True, if the story's is_posted_to_chat_page value can be changed //@can_get_statistics True, if the story statistics are available through getStoryStatistics @@ -5998,7 +6115,7 @@ chatBoostFeatures features:vector min_profile_background chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; //@description The chat created a giveaway -//@user_id Identifier of a user that won in the giveaway; 0 if none +//@user_id Identifier of a user who won in the giveaway; 0 if none //@gift_code The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only //@star_count Number of Telegram Stars distributed among winners of the giveaway //@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message @@ -6197,6 +6314,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@description Describes a group call //@id Group call identifier +//@unique_id Persistent unique group call identifier //@title Group call title; for video chats only //@invite_link Invite link for the group call; for group calls that aren't bound to a chat. For video chats call getVideoChatInviteLink to get the link. //-For live stories in chats with username call getInternalLink with internalLinkTypeLiveStory @@ -6228,7 +6346,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on //@is_video_recorded True, if a video file is being recorded for the call //@duration Call duration, in seconds; for ended calls only -groupCall id:int32 title:string invite_link:string paid_message_star_count:int53 scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_video_chat:Bool is_live_story:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool is_owned:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool message_sender_id:MessageSender recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool can_send_messages:Bool are_messages_allowed:Bool can_toggle_are_messages_allowed:Bool can_delete_messages:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; +groupCall id:int32 unique_id:int64 title:string invite_link:string paid_message_star_count:int53 scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_video_chat:Bool is_live_story:Bool is_rtmp_stream:Bool is_joined:Bool need_rejoin:Bool is_owned:Bool can_be_managed:Bool participant_count:int32 has_hidden_listeners:Bool loaded_all_participants:Bool message_sender_id:MessageSender recent_speakers:vector is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool can_send_messages:Bool are_messages_allowed:Bool can_toggle_are_messages_allowed:Bool can_delete_messages:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; //@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers groupCallVideoSourceGroup semantics:string source_ids:vector = GroupCallVideoSourceGroup; @@ -6356,11 +6474,12 @@ callProblemPixelatedVideo = CallProblem; //@description Describes a call //@id Call identifier, not persistent +//@unique_id Persistent unique call identifier; 0 if isn't assigned yet by the server //@user_id User identifier of the other call participant //@is_outgoing True, if the call is outgoing //@is_video True, if the call is a video call //@state Call state -call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; +call id:int32 unique_id:int64 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; //@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications @@ -6474,7 +6593,7 @@ 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_id Identifier of the business user who 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 //@rights Rights of the bot; may be null if the connection was disabled @@ -7298,7 +7417,7 @@ premiumSourceBusinessFeature feature:BusinessFeature = PremiumSource; //@description A user tried to use a Premium story feature @feature The used feature premiumSourceStoryFeature feature:PremiumStoryFeature = PremiumSource; -//@description A user opened an internal link of the type internalLinkTypePremiumFeatures @referrer The referrer from the link +//@description A user opened an internal link of the type internalLinkTypePremiumFeaturesPage @referrer The referrer from the link premiumSourceLink referrer:string = PremiumSource; //@description A user opened the Premium features screen from settings @@ -7593,10 +7712,10 @@ canPostStoryResultBoostNeeded = CanPostStoryResult; //@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire canPostStoryResultActiveStoryLimitExceeded = CanPostStoryResult; -//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story +//@description The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story, in seconds canPostStoryResultWeeklyLimitExceeded retry_after:int32 = CanPostStoryResult; -//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story +//@description The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time @retry_after Time left before the user can post the next story, in seconds canPostStoryResultMonthlyLimitExceeded retry_after:int32 = CanPostStoryResult; //@description The user or the chat has an active live story. The live story must be deleted first @story_id Identifier of the active live story @@ -7923,6 +8042,13 @@ notification id:int32 date:int32 is_silent:Bool type:NotificationType = Notifica notificationGroup id:int32 type:NotificationGroupType chat_id:int53 total_count:int32 notifications:vector = NotificationGroup; +//@description Describes a proxy server +//@server Proxy server domain or IP address +//@port Proxy server port +//@type Type of the proxy +proxy server:string port:int32 type:ProxyType = Proxy; + + //@class OptionValue @description Represents the value of an option //@description Represents a boolean option @value The value of the option @@ -8259,10 +8385,140 @@ reportStoryResultOptionRequired title:string options:vector = Repo reportStoryResultTextRequired option_id:bytes is_optional:Bool = ReportStoryResult; -//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way +//@class SettingsSection @description Describes a section of the application settings -//@description The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user -internalLinkTypeActiveSessions = InternalLinkType; +//@description The appearance section @subsection Subsection of the section; may be one of +//-"", "themes", "themes/edit", "themes/create", "wallpapers", "wallpapers/edit", "wallpapers/set", +//-"wallpapers/choose-photo", "your-color/profile", "your-color/profile/add-icons", "your-color/profile/use-gift", +//-"your-color/profile/reset", "your-color/name", "your-color/name/add-icons", "your-color/name/use-gift", +//-"night-mode", "auto-night-mode", "text-size", "text-size/use-system", "message-corners", "animations", +//-"stickers-and-emoji", "stickers-and-emoji/edit", "stickers-and-emoji/trending", "stickers-and-emoji/archived", +//-"stickers-and-emoji/archived/edit", "stickers-and-emoji/emoji", "stickers-and-emoji/emoji/edit", +//-"stickers-and-emoji/emoji/archived", "stickers-and-emoji/emoji/archived/edit", "stickers-and-emoji/emoji/suggest", +//-"stickers-and-emoji/emoji/quick-reaction", "stickers-and-emoji/emoji/quick-reaction/choose", +//-"stickers-and-emoji/suggest-by-emoji", "stickers-and-emoji/large-emoji", "stickers-and-emoji/dynamic-order", +//-"stickers-and-emoji/emoji/show-more", "app-icon", "tap-for-next-media" +settingsSectionAppearance subsection:string = SettingsSection; + +//@description The "Ask a question" section +settingsSectionAskQuestion = SettingsSection; + +//@description The "Telegram Business" section @subsection Subsection of the section; may be one of +//-"", "do-not-hide-ads" +settingsSectionBusiness subsection:string = SettingsSection; + +//@description The chat folder settings section @subsection Subsection of the section; may be one of +//-"", "edit", "create", "add-recommended", "show-tags", "tab-view" +settingsSectionChatFolders subsection:string = SettingsSection; + +//@description The data and storage settings section @subsection Subsection of the section; may be one of +//-"", "storage", "storage/edit", "storage/auto-remove", "storage/clear-cache", "storage/max-cache", "usage", +//-"usage/mobile", "usage/wifi", "usage/reset", "usage/roaming", "auto-download/mobile", +//-"auto-download/mobile/enable", "auto-download/mobile/usage", "auto-download/mobile/photos", +//-"auto-download/mobile/stories", "auto-download/mobile/videos", "auto-download/mobile/files", "auto-download/wifi", +//-"auto-download/wifi/enable", "auto-download/wifi/usage", "auto-download/wifi/photos", +//-"auto-download/wifi/stories", "auto-download/wifi/videos", "auto-download/wifi/files", "auto-download/roaming", +//-"auto-download/roaming/enable", "auto-download/roaming/usage", "auto-download/roaming/photos", +//-"auto-download/roaming/stories", "auto-download/roaming/videos", "auto-download/roaming/files", +//-"auto-download/reset", "save-to-photos/chats", "save-to-photos/chats/max-video-size", +//-"save-to-photos/chats/add-exception", "save-to-photos/chats/delete-all", "save-to-photos/groups", +//-"save-to-photos/groups/max-video-size", "save-to-photos/groups/add-exception", "save-to-photos/groups/delete-all", +//-"save-to-photos/channels", "save-to-photos/channels/max-video-size", "save-to-photos/channels/add-exception", +//-"save-to-photos/channels/delete-all", "less-data-calls", "open-links", "share-sheet", +//-"share-sheet/suggested-chats", "share-sheet/suggest-by", "share-sheet/reset", "saved-edited-photos", +//-"pause-music", "raise-to-listen", "raise-to-speak", "show-18-content", "proxy", "proxy/edit", "proxy/use-proxy", +//-"proxy/add-proxy", "proxy/share-list", "proxy/use-for-calls" +settingsSectionDataAndStorage subsection:string = SettingsSection; + +//@description The Devices section @subsection Subsection of the section; may be one of +//-"", "edit", "link-desktop", "terminate-sessions", "auto-terminate" +settingsSectionDevices subsection:string = SettingsSection; + +//@description The profile edit section @subsection Subsection of the section; may be one of +//-"", "set-photo", "first-name", "last-name", "emoji-status", "bio", "birthday", "change-number", "username", +//-"your-color", "channel", "add-account", "log-out", "profile-color/profile", "profile-color/profile/add-icons", +//-"profile-color/profile/use-gift", "profile-color/name", "profile-color/name/add-icons", +//-"profile-color/name/use-gift", "profile-photo/use-emoji" +settingsSectionEditProfile subsection:string = SettingsSection; + +//@description The FAQ section +settingsSectionFaq = SettingsSection; + +//@description The "Telegram Features" section +settingsSectionFeatures = SettingsSection; + +//@description The in-app browser settings section @subsection Subsection of the section; may be one of +//-"", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search" +settingsSectionInAppBrowser subsection:string = SettingsSection; + +//@description The application language section @subsection Subsection of the section; may be one of "", "show-button" for Show Translate Button toggle, +//-"translate-chats" for Translate Entire Chats toggle, "do-not-translate" - for Do Not Translate language list +settingsSectionLanguage subsection:string = SettingsSection; + +//@description The Telegram Star balance and transaction section @subsection Subsection of the section; may be one of +//-"", "top-up", "stats", "gift", "earn" +settingsSectionMyStars subsection:string = SettingsSection; + +//@description The Toncoin balance and transaction section +settingsSectionMyToncoins = SettingsSection; + +//@description The notification settings section @subsection Subsection of the section; may be one of +//-"", "accounts", "private-chats", "private-chats/edit", "private-chats/show", "private-chats/preview", +//-"private-chats/sound", "private-chats/add-exception", "private-chats/delete-exceptions", +//-"private-chats/light-color", "private-chats/vibrate", "private-chats/priority", "groups", "groups/edit", +//-"groups/show", "groups/preview", "groups/sound", "groups/add-exception", "groups/delete-exceptions", +//-"groups/light-color", "groups/vibrate", "groups/priority", "channels", "channels/edit", "channels/show", +//-"channels/preview", "channels/sound", "channels/add-exception", "channels/delete-exceptions", +//-"channels/light-color", "channels/vibrate", "channels/priority", "stories", "stories/new", "stories/important", +//-"stories/show-sender", "stories/sound", "stories/add-exception", "stories/delete-exceptions", +//-"stories/light-color", "stories/vibrate", "stories/priority", "reactions", "reactions/messages", +//-"reactions/stories", "reactions/show-sender", "reactions/sound", "reactions/light-color", "reactions/vibrate", +//-"reactions/priority", "in-app-sounds", "in-app-vibrate", "in-app-preview", "in-chat-sounds", "in-app-popup", +//-"lock-screen-names", "include-channels", "include-muted-chats", "count-unread-messages", "new-contacts", +//-"pinned-messages", "reset", "web" +settingsSectionNotifications subsection:string = SettingsSection; + +//@description The power saving settings section @subsection Subsection of the section; may be one of +//-"", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions" +settingsSectionPowerSaving subsection:string = SettingsSection; + +//@description The "Telegram Premium" section +settingsSectionPremium = SettingsSection; + +//@description The privacy and security section @subsection Subsection of the section; may be one of +//-"", "blocked", "blocked/edit", "blocked/block-user", "blocked/block-user/chats", "blocked/block-user/contacts", +//-"active-websites", "active-websites/edit", "active-websites/disconnect-all", "passcode", "passcode/disable", +//-"passcode/change", "passcode/auto-lock", "passcode/face-id", "passcode/fingerprint", "2sv", "2sv/change", +//-"2sv/disable", "2sv/change-email", "passkey", "passkey/create", "auto-delete", "auto-delete/set-custom", +//-"login-email", "phone-number", "phone-number/never", "phone-number/always", "last-seen", "last-seen/never", +//-"last-seen/always", "last-seen/hide-read-time", "profile-photos", "profile-photos/never", "profile-photos/always", +//-"profile-photos/set-public", "profile-photos/update-public", "profile-photos/remove-public", "bio", "bio/never", +//-"bio/always", "gifts", "gifts/show-icon", "gifts/never", "gifts/always", "gifts/accepted-types", "birthday", +//-"birthday/add", "birthday/never", "birthday/always", "saved-music", "saved-music/never", "saved-music/always", +//-"forwards", "forwards/never", "forwards/always", "calls", "calls/never", "calls/always", "calls/p2p", +//-"calls/p2p/never", "calls/p2p/always", "calls/ios-integration", "voice", "voice/never", "voice/always", +//-"messages", "messages/set-price", "messages/exceptions", "invites", "invites/never", "invites/always", +//-"self-destruct", "data-settings", "data-settings/sync-contacts", "data-settings/delete-synced", +//-"data-settings/suggest-contacts", "data-settings/delete-cloud-drafts", "data-settings/clear-payment-info", +//-"data-settings/link-previews", "data-settings/bot-settings", "data-settings/map-provider", "archive-and-mute" +settingsSectionPrivacyAndSecurity subsection:string = SettingsSection; + +//@description The "Privacy Policy" section +settingsSectionPrivacyPolicy = SettingsSection; + +//@description The current user's QR code section @subsection Subsection of the section; may be one of +//-"", "share", "scan" +settingsSectionQrCode subsection:string = SettingsSection; + +//@description Search in Settings +settingsSectionSearch = SettingsSection; + +//@description The "Send a gift" section @subsection Subsection of the section; may be one of +//-"", "self" +settingsSectionSendGift subsection:string = SettingsSection; + + +//@class InternalLinkType @description Describes an internal https://t.me or tg: link, which must be processed by the application in a special way //@description The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. //-Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. @@ -8312,13 +8568,9 @@ internalLinkTypeBotStartInGroup bot_username:string start_parameter:string admin //@link_name Name of the link internalLinkTypeBusinessChat link_name:string = InternalLinkType; -//@description The link is a link to the Telegram Star purchase section of the application -//@star_count The number of Telegram Stars that must be owned by the user -//@purpose Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions -internalLinkTypeBuyStars star_count:int53 purpose:string = InternalLinkType; - -//@description The link is a link to the change phone number section of the application -internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is a link to the Call tab or page @section Section of the page; may be one of +//-"", "all", "missed", "edit", "show-tab", "start-call" +internalLinkTypeCallsPage section:string = InternalLinkType; //@description The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link //@username Username to be passed to searchChatAffiliateProgram @@ -8336,25 +8588,23 @@ internalLinkTypeChatBoost url:string = InternalLinkType; //@invite_link Internal representation of the invite link internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; -//@description The link is a link to the folder section of the application settings -internalLinkTypeChatFolderSettings = InternalLinkType; - //@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. //-If the link is valid and the user wants to join the chat, then call joinChatByInviteLink //@invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; -//@description The link is a link to the default message auto-delete timer settings section of the application settings -internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; +//@description The link is a link that allows to select some chats +internalLinkTypeChatSelection = InternalLinkType; + +//@description The link is a link to the Contacts tab or page @section Section of the page; may be one of +//-"", "search", "sort", "new", "invite", "manage" +internalLinkTypeContactsPage section:string = InternalLinkType; //@description The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. //-If the chat is found and is channel, open the direct messages chat of the channel //@channel_username Username of the channel internalLinkTypeDirectMessagesChat channel_username:string = InternalLinkType; -//@description The link is a link to the edit profile section of the application settings -internalLinkTypeEditProfileSettings = InternalLinkType; - //@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, //-ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game @@ -8390,17 +8640,11 @@ internalLinkTypeInvoice invoice_name:string = InternalLinkType; //@language_pack_id Language pack identifier internalLinkTypeLanguagePack language_pack_id:string = InternalLinkType; -//@description The link is a link to the language section of the application settings -internalLinkTypeLanguageSettings = InternalLinkType; - //@description The link is a link to a live story. Call searchPublicChat with the given chat username, then getChatActiveStories to get active stories in the chat, //-then find a live story among active stories of the chat, and then joinLiveStory to join the live story //@story_poster_username Username of the poster of the story internalLinkTypeLiveStory story_poster_username:string = InternalLinkType; -//@description The link is a link to the login email set up section of the application settings, forcing set up of the login email -internalLinkTypeLoginEmailSettings = InternalLinkType; - //@description The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. //-If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, //-show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, @@ -8421,11 +8665,21 @@ internalLinkTypeMessage url:string = InternalLinkType; //@contains_link True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLinkType; -//@description The link is a link to the screen with information about Telegram Star balance and transactions of the current user -internalLinkTypeMyStars = InternalLinkType; +//@description The link is a link to the My Profile application page @section Section of the page; may be one of +//-"", "posts", "posts/all-stories", "posts/add-album", "gifts", "archived-posts" +internalLinkTypeMyProfilePage section:string = InternalLinkType; -//@description The link is a link to the screen with information about Toncoin balance and transactions of the current user -internalLinkTypeMyToncoins = InternalLinkType; +//@description The link is a link to the screen for creating a new channel chat +internalLinkTypeNewChannelChat = InternalLinkType; + +//@description The link is a link to the screen for creating a new group chat +internalLinkTypeNewGroupChat = InternalLinkType; + +//@description The link is a link to the screen for creating a new private chat with a contact +internalLinkTypeNewPrivateChat = InternalLinkType; + +//@description The link is a link to open the story posting interface @content_type The type of the content of the story to post; may be null if unspecified +internalLinkTypeNewStory content_type:StoryContentType = 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; the corresponding user may be unknown yet @@ -8436,39 +8690,28 @@ internalLinkTypeMyToncoins = InternalLinkType; //-If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType; -//@description The link is a link to the password section of the application settings -internalLinkTypePasswordSettings = InternalLinkType; - //@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. //-If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it //@hash Hash value from the link //@phone_number Phone number value from the link internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = InternalLinkType; -//@description The link is a link to the phone number privacy settings section of the application settings -internalLinkTypePhoneNumberPrivacySettings = InternalLinkType; - //@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link //@referrer Referrer specified in the link -internalLinkTypePremiumFeatures referrer:string = InternalLinkType; - -//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases -//@referrer Referrer specified in the link -internalLinkTypePremiumGift referrer:string = InternalLinkType; +internalLinkTypePremiumFeaturesPage referrer:string = InternalLinkType; //@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. //-If the code is valid and the user wants to apply it, then call applyPremiumGiftCode //@code The Telegram Premium gift code internalLinkTypePremiumGiftCode code:string = InternalLinkType; -//@description The link is a link to the privacy and security section of the application settings -internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; +//@description The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases +//@referrer Referrer specified in the link +internalLinkTypePremiumGiftPurchase referrer:string = InternalLinkType; //@description The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy -//@server Proxy server domain or IP address -//@port Proxy server port -//@type Type of the proxy -internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType; +//@proxy The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user +internalLinkTypeProxy proxy:proxy = InternalLinkType; //@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. //-If the chat is found, open its profile information screen or the chat itself. @@ -8485,8 +8728,19 @@ internalLinkTypeQrCodeAuthentication = InternalLinkType; //@description The link forces restore of App Store purchases when opened. For official iOS application only internalLinkTypeRestorePurchases = InternalLinkType; -//@description The link is a link to application settings -internalLinkTypeSettings = InternalLinkType; +//@description The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat +internalLinkTypeSavedMessages = InternalLinkType; + +//@description The link is a link to the global chat and messages search field +internalLinkTypeSearch = InternalLinkType; + +//@description The link is a link to application settings @section Section of the application settings to open; may be null if none +internalLinkTypeSettings section:SettingsSection = InternalLinkType; + +//@description The link is a link to the Telegram Star purchase section of the application +//@star_count The number of Telegram Stars that must be owned by the user +//@purpose Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions +internalLinkTypeStarPurchase star_count:int53 purpose:string = InternalLinkType; //@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. //-If the sticker set is found and the user wants to add it, then call changeStickerSet @@ -8508,15 +8762,9 @@ internalLinkTypeStoryAlbum story_album_owner_username:string story_album_id:int3 //@description The link is a link to a cloud theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; -//@description The link is a link to the theme section of the application settings -internalLinkTypeThemeSettings = InternalLinkType; - //@description The link is an unknown tg: link. Call getDeepLinkInfo to process the link @link Link to be passed to getDeepLinkInfo internalLinkTypeUnknownDeepLink link:string = InternalLinkType; -//@description The link is a link to an unsupported proxy. An alert can be shown to the user -internalLinkTypeUnsupportedProxy = InternalLinkType; - //@description The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link @name Name of the unique gift internalLinkTypeUpgradedGift name:string = InternalLinkType; @@ -8962,17 +9210,15 @@ proxyTypeHttp username:string password:string http_only:Bool = ProxyType; proxyTypeMtproto secret:string = ProxyType; -//@description Contains information about a proxy server +//@description Contains information about a proxy server added to the list of proxies //@id Unique identifier of the proxy -//@server Proxy server domain or IP address -//@port Proxy server port //@last_used_date Point in time (Unix timestamp) when the proxy was last used; 0 if never //@is_enabled True, if the proxy is enabled now -//@type Type of the proxy -proxy id:int32 server:string port:int32 last_used_date:int32 is_enabled:Bool type:ProxyType = Proxy; +//@proxy The proxy +addedProxy id:int32 last_used_date:int32 is_enabled:Bool proxy:proxy = AddedProxy; -//@description Represents a list of proxy servers @proxies List of proxy servers -proxies proxies:vector = Proxies; +//@description Represents a list of added proxy servers @proxies List of proxy servers +addedProxies proxies:vector = AddedProxies; //@description A sticker to be added to a sticker set @@ -9137,7 +9383,7 @@ chatRevenueTransactionTypeUnsupported = ChatRevenueTransactionType; //@end_date Point in time (Unix timestamp) when the earnings ended chatRevenueTransactionTypeSponsoredMessageEarnings start_date:int32 end_date:int32 = ChatRevenueTransactionType; -//@description Describes earnings from a published suggested post @user_id Identifier of the user that paid for the suggested post +//@description Describes earnings from a published suggested post @user_id Identifier of the user who paid for the suggested post chatRevenueTransactionTypeSuggestedPostEarnings user_id:int53 = ChatRevenueTransactionType; //@description Describes a withdrawal of earnings through Fragment @@ -9164,9 +9410,9 @@ chatRevenueTransactions ton_amount:int53 transactions:vector = Ok; //@are_enabled Pass true to enable notifications about new gifts owned by the channel chat; pass false to disable the notifications toggleChatGiftNotifications chat_id:int53 are_enabled:Bool = Ok; -//@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift -getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview; +//@description Returns examples of possible upgraded gifts for a regular gift @regular_gift_id Identifier of the regular gift +getGiftUpgradePreview regular_gift_id:int64 = GiftUpgradePreview; -//@description Returns all possible variants of upgraded gifts for a regular gift @gift_id Identifier of the gift -getGiftUpgradeVariants gift_id:int64 = GiftUpgradeVariants; +//@description Returns all possible variants of upgraded gifts for a regular gift +//@regular_gift_id Identifier of the regular gift +//@return_upgrade_models Pass true to get models that can be obtained by upgrading a regular gift +//@return_craft_models Pass true to get models that can be obtained by crafting a gift from upgraded gifts +getUpgradedGiftVariants regular_gift_id:int64 return_upgrade_models:Bool return_craft_models:Bool = GiftUpgradeVariants; //@description Upgrades a regular gift //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@received_gift_id Identifier of the gift //@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift -//@star_count The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count +//@star_count The Telegram Star amount required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count upgradeGift business_connection_id:string received_gift_id:string keep_original_details:Bool star_count:int53 = UpgradeGiftResult; //@description Pays for upgrade of a regular gift that is owned by another user or channel chat //@owner_id Identifier of the user or the channel chat that owns the gift //@prepaid_upgrade_hash Prepaid upgrade hash as received along with the gift -//@star_count The amount of Telegram Stars the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count +//@star_count The Telegram Star amount the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count buyGiftUpgrade owner_id:MessageSender prepaid_upgrade_hash:string star_count:int53 = Ok; +//@description Crafts a new gift from other gifts that will be permanently lost +//@received_gift_ids Identifier of the gifts to use for crafting +craftGift received_gift_ids:vector = CraftGiftResult; + //@description Sends an upgraded gift to another user or channel chat //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@received_gift_id Identifier of the gift //@new_owner_id Identifier of the user or the channel chat that will receive the gift -//@star_count The amount of Telegram Stars required to pay for the transfer +//@star_count The Telegram Star amount required to pay for the transfer transferGift business_connection_id:string received_gift_id:string new_owner_id:MessageSender star_count:int53 = Ok; //@description Drops original details for an upgraded gift //@received_gift_id Identifier of the gift -//@star_count The amount of Telegram Stars required to pay for the operation +//@star_count The Telegram Star amount required to pay for the operation dropGiftOriginalDetails received_gift_id:string star_count:int53 = Ok; //@description Sends an upgraded gift that is available for resale to another user or channel chat; gifts already owned by the current user @@ -13830,6 +14090,12 @@ getReceivedGifts business_connection_id:string owner_id:MessageSender collection //@description Returns information about a received gift @received_gift_id Identifier of the gift getReceivedGift received_gift_id:string = ReceivedGift; +//@description Returns upgraded gifts of the current user who can be used to craft another gifts +//@regular_gift_id Identifier of the regular gift that will be used for crafting +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of gifts 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 +getGiftsForCrafting regular_gift_id:int64 offset:string limit:int32 = GiftsForCrafting; + //@description Returns information about an upgraded gift by its name @name Unique name of the upgraded gift getUpgradedGift name:string = UpgradedGift; @@ -13854,11 +14120,12 @@ setGiftResalePrice received_gift_id:string price:GiftResalePrice = Ok; //@description Returns upgraded gifts that can be bought from other owners using sendResoldGift //@gift_id Identifier of the regular gift that was upgraded to a unique gift //@order Order in which the results will be sorted +//@for_crafting Pass true to get only gifts suitable for crafting //@attributes Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. //-If none attributes of specific type are specified, then all values for this attribute type are allowed //@offset Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results //@limit The maximum number of gifts to return -searchGiftsForResale gift_id:int64 order:GiftForResaleOrder attributes:vector offset:string limit:int32 = GiftsForResale; +searchGiftsForResale gift_id:int64 order:GiftForResaleOrder for_crafting:Bool attributes:vector offset:string limit:int32 = GiftsForResale; //@description Returns collections of gifts owned by the given user or chat @@ -13914,12 +14181,12 @@ reorderGiftCollectionGifts owner_id:MessageSender collection_id:int32 received_g createInvoiceLink business_connection_id:string invoice:InputMessageContent = HttpUrl; //@description Refunds a previously done payment in Telegram Stars; for bots only -//@user_id Identifier of the user that did the payment +//@user_id Identifier of the user who did the payment //@telegram_payment_charge_id Telegram payment identifier refundStarPayment user_id:int53 telegram_payment_charge_id:string = Ok; -//@description Returns a user that can be contacted to get support +//@description Returns a user who can be contacted to get support getSupportUser = User; @@ -14025,7 +14292,7 @@ getPaidMessageRevenue user_id:int53 = StarCount; //@refund_payments Pass true to refund the user previously paid messages allowUnpaidMessagesFromUser user_id:int53 refund_payments:Bool = Ok; -//@description Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages +//@description Changes the Telegram Star amount that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages //@chat_id Identifier of the supergroup chat //@paid_message_star_count The new number of Telegram Stars that must be paid for each message that is sent to the supergroup chat unless the sender is an administrator of the chat; 0-getOption("paid_message_star_count_max"). //-The supergroup will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending @@ -14233,7 +14500,7 @@ setPassportElement element:InputPassportElement password:string = PassportElemen //@description Deletes a Telegram Passport element @type Element type deletePassportElement type:PassportElementType = Ok; -//@description Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed @user_id User identifier @errors The errors +//@description Informs the user who some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed @user_id User identifier @errors The errors setPassportElementErrors user_id:int53 errors:vector = Ok; @@ -14423,7 +14690,7 @@ getGiveawayInfo chat_id:int53 message_id:int53 = GiveawayInfo; //@description Returns available options for Telegram Stars purchase getStarPaymentOptions = StarPaymentOptions; -//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user +//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user who will receive Telegram Stars; pass 0 to get options for an unspecified user getStarGiftPaymentOptions user_id:int53 = StarPaymentOptions; //@description Returns available options for Telegram Star giveaway creation @@ -14492,7 +14759,7 @@ connectAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAff //@url The referral link of the affiliate program disconnectAffiliateProgram affiliate:AffiliateType url:string = ConnectedAffiliateProgram; -//@description Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program +//@description Returns an affiliate program that was connected to the given affiliate by identifier of the bot that created the program //@affiliate The affiliate to which the affiliate program will be connected //@bot_user_id Identifier of the bot that created the program getConnectedAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram; @@ -14566,19 +14833,15 @@ getApplicationDownloadLink = HttpUrl; //@description Adds a proxy server for network requests. Can be called before authorization -//@server Proxy server domain or IP address -//@port Proxy server port +//@proxy The proxy to add //@enable Pass true to immediately enable the proxy -//@type Proxy type -addProxy server:string port:int32 enable:Bool type:ProxyType = Proxy; +addProxy proxy:proxy enable:Bool = AddedProxy; //@description Edits an existing proxy server for network requests. Can be called before authorization //@proxy_id Proxy identifier -//@server Proxy server domain or IP address -//@port Proxy server port +//@proxy The new information about the proxy //@enable Pass true to immediately enable the proxy -//@type Proxy type -editProxy proxy_id:int32 server:string port:int32 enable:Bool type:ProxyType = Proxy; +editProxy proxy_id:int32 proxy:proxy enable:Bool = AddedProxy; //@description Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization @proxy_id Proxy identifier enableProxy proxy_id:int32 = Ok; @@ -14590,13 +14853,11 @@ disableProxy = Ok; removeProxy proxy_id:int32 = Ok; //@description Returns the list of proxies that are currently set up. Can be called before authorization -getProxies = Proxies; +getProxies = AddedProxies; -//@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier -getProxyLink proxy_id:int32 = HttpUrl; - -//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @proxy_id Proxy identifier. Use 0 to ping a Telegram server without a proxy -pingProxy proxy_id:int32 = Seconds; +//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization +//@proxy The proxy to test; pass null to ping a Telegram server without a proxy +pingProxy proxy:proxy = Seconds; //@description Sets new log stream for internal logging of TDLib. Can be called synchronously @log_stream New log stream @@ -14668,12 +14929,10 @@ testSquareInt x:int32 = TestInt; testNetwork = Ok; //@description Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization -//@server Proxy server domain or IP address -//@port Proxy server port -//@type Proxy type +//@proxy The proxy to test //@dc_id Identifier of a datacenter with which to test connection //@timeout The maximum overall timeout for the request -testProxy server:string port:int32 type:ProxyType dc_id:int32 timeout:double = Ok; +testProxy proxy:proxy dc_id:int32 timeout:double = Ok; //@description Forces an updates.getDifference call to the Telegram servers; for testing only testGetDifference = Ok;