From c1bd67f199f9065376b4a3ebb9a6183e2bfa311b Mon Sep 17 00:00:00 2001 From: c0re100 Date: Thu, 8 Jan 2026 03:52:10 +0800 Subject: [PATCH] Update to TDLib 1.8.60 --- client/function.go | 1093 +++++++++++++++++- client/type.go | 2557 ++++++++++++++++++++++++++++++++++++++--- client/unmarshaler.go | 935 ++++++++++++++- data/td_api.tl | 825 ++++++++++--- 4 files changed, 5037 insertions(+), 373 deletions(-) diff --git a/client/function.go b/client/function.go index a349ca6..9599474 100755 --- a/client/function.go +++ b/client/function.go @@ -355,6 +355,63 @@ func (client *Client) RequestQrCodeAuthentication(req *RequestQrCodeAuthenticati return UnmarshalOk(result.Data) } +// Returns parameters for authentication using a passkey as JSON-serialized string +func (client *Client) GetAuthenticationPasskeyParameters() (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAuthenticationPasskeyParameters", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type CheckAuthenticationPasskeyRequest struct { + // Base64url-encoded identifier of the credential + CredentialId string `json:"credential_id"` + // JSON-encoded client data + ClientData string `json:"client_data"` + // Authenticator data of the application that created the credential + AuthenticatorData []byte `json:"authenticator_data"` + // Cryptographic signature of the credential + Signature []byte `json:"signature"` + // User handle of the passkey + UserHandle []byte `json:"user_handle"` +} + +// Checks a passkey to log in to the corresponding account. Call getAuthenticationPasskeyParameters to get parameters for the passkey. Works only when the current authorization state is authorizationStateWaitPhoneNumber or authorizationStateWaitOtherDeviceConfirmation, or if there is no pending authentication query and the current authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +func (client *Client) CheckAuthenticationPasskey(req *CheckAuthenticationPasskeyRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkAuthenticationPasskey", + }, + Data: map[string]interface{}{ + "credential_id": req.CredentialId, + "client_data": req.ClientData, + "authenticator_data": req.AuthenticatorData, + "signature": req.Signature, + "user_handle": req.UserHandle, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type RegisterUserRequest struct { // The first name of the user; 1-64 characters FirstName string `json:"first_name"` @@ -772,12 +829,31 @@ func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, erro return UnmarshalPasswordState(result.Data) } +// Checks whether the current user is required to set login email address +func (client *Client) IsLoginEmailAddressRequired() (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "isLoginEmailAddressRequired", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetLoginEmailAddressRequest struct { // New login email address NewLoginEmailAddress string `json:"new_login_email_address"` } -// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly +// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty, or the user received suggestedActionSetLoginEmailAddress and isLoginEmailAddressRequired succeeds. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -1429,7 +1505,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4484,7 +4560,7 @@ type TranslateMessageTextRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" + // Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values ToLanguageCode string `json:"to_language_code"` } @@ -4511,6 +4587,38 @@ func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*F return UnmarshalFormattedText(result.Data) } +type SummarizeMessageRequest struct { + // Identifier of the chat to which the message belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Pass a language code to which the summary will be translated; may be empty if translation isn't needed. See translateText.to_language_code for the list of supported values + TranslateToLanguageCode string `json:"translate_to_language_code"` +} + +// Summarizes content of the message with non-empty summary_language_code +func (client *Client) SummarizeMessage(req *SummarizeMessageRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "summarizeMessage", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "translate_to_language_code": req.TranslateToLanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + type RecognizeSpeechRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -6218,7 +6326,7 @@ type TransferBusinessAccountStarsRequest struct { StarCount int64 `json:"star_count"` } -// Transfer Telegram Stars from the business account to the business bot; for bots only +// Transfers Telegram Stars from the business account to the business bot; for bots only func (client *Client) TransferBusinessAccountStars(req *TransferBusinessAccountStarsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7088,6 +7196,99 @@ func (client *Client) UnpinAllForumTopicMessages(req *UnpinAllForumTopicMessages return UnmarshalOk(result.Data) } +// Returns parameters for creating of a new passkey as JSON-serialized string +func (client *Client) GetPasskeyParameters() (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPasskeyParameters", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type AddLoginPasskeyRequest struct { + // JSON-encoded client data + ClientData string `json:"client_data"` + // Passkey attestation object + AttestationObject []byte `json:"attestation_object"` +} + +// Adds a passkey allowed to be used for the login by the current user and returns the added passkey. Call getPasskeyParameters to get parameters for creating of the passkey +func (client *Client) AddLoginPasskey(req *AddLoginPasskeyRequest) (*Passkey, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addLoginPasskey", + }, + Data: map[string]interface{}{ + "client_data": req.ClientData, + "attestation_object": req.AttestationObject, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPasskey(result.Data) +} + +// Returns the list of passkeys allowed to be used for the login by the current user +func (client *Client) GetLoginPasskeys() (*Passkeys, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLoginPasskeys", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPasskeys(result.Data) +} + +type RemoveLoginPasskeyRequest struct { + // Unique identifier of the passkey to remove + PasskeyId string `json:"passkey_id"` +} + +// Removes a passkey from the list of passkeys allowed to be used for the login by the current user +func (client *Client) RemoveLoginPasskey(req *RemoveLoginPasskeyRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removeLoginPasskey", + }, + Data: map[string]interface{}{ + "passkey_id": req.PasskeyId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetEmojiReactionRequest struct { // Text representation of the reaction Emoji string `json:"emoji"` @@ -9548,6 +9749,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(result.Data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(result.Data) @@ -9566,6 +9770,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(result.Data) + + case TypeInternalLinkTypeLoginEmailSettings: + return UnmarshalInternalLinkTypeLoginEmailSettings(result.Data) + case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(result.Data) @@ -9584,9 +9794,15 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte 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) @@ -11835,6 +12051,25 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) ( return UnmarshalOk(result.Data) } +// Returns the current state of stake dice +func (client *Client) GetStakeDiceState() (*StakeDiceState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStakeDiceState", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStakeDiceState(result.Data) +} + type GetSavedNotificationSoundRequest struct { // Identifier of the notification sound NotificationSoundId JsonInt64 `json:"notification_sound_id"` @@ -12127,7 +12362,7 @@ type ReadChatListRequest struct { ChatList ChatList `json:"chat_list"` } -// Traverse all chats in a chat list and marks all messages in the chats as read +// Traverses all chats in a chat list and marks all messages in the chats as read func (client *Client) ReadChatList(req *ReadChatListRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12267,6 +12502,9 @@ func (client *Client) CanPostStory(req *CanPostStoryRequest) (CanPostStoryResult case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(result.Data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(result.Data) + default: return nil, errors.New("invalid type") } @@ -12283,7 +12521,7 @@ type PostStoryRequest struct { Caption *FormattedText `json:"caption"` // The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats PrivacySettings StoryPrivacySettings `json:"privacy_settings"` - // Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_story_count_max") + // Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_size_max") stories AlbumIds []int32 `json:"album_ids"` // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise ActivePeriod int32 `json:"active_period"` @@ -12325,6 +12563,56 @@ func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { return UnmarshalStory(result.Data) } +type StartLiveStoryRequest struct { + // Identifier of the chat that will start the live story. Pass Saved Messages chat identifier when starting a live story on behalf of the current user, or a channel chat identifier + ChatId int64 `json:"chat_id"` + // The privacy settings for the story; ignored for stories posted on behalf of channel chats + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Pass true if the content of the story must be protected from screenshotting + ProtectContent bool `json:"protect_content"` + // Pass true to create an RTMP stream instead of an ordinary group call + IsRtmpStream bool `json:"is_rtmp_stream"` + // Pass true to allow viewers of the story to send messages + EnableMessages bool `json:"enable_messages"` + // The minimum number of Telegram Stars that must be paid by viewers for each sent message to the call; 0-getOption("paid_group_call_message_star_count_max") + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Starts a new live story on behalf of a chat; requires can_post_stories administrator right for channel chats +func (client *Client) StartLiveStory(req *StartLiveStoryRequest) (StartLiveStoryResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "startLiveStory", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "privacy_settings": req.PrivacySettings, + "protect_content": req.ProtectContent, + "is_rtmp_stream": req.IsRtmpStream, + "enable_messages": req.EnableMessages, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(result.Data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type EditStoryRequest struct { // Identifier of the chat that posted the story StoryPosterChatId int64 `json:"story_poster_chat_id"` @@ -12402,7 +12690,7 @@ type SetStoryPrivacySettingsRequest struct { PrivacySettings StoryPrivacySettings `json:"privacy_settings"` } -// Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true +// Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_set_privacy_settings == true func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12773,7 +13061,7 @@ type SetStoryReactionRequest struct { UpdateRecentReactions bool `json:"update_recent_reactions"` } -// Changes chosen reaction on a story that has already been sent +// Changes chosen reaction on a story that has already been sent; not supported for live stories func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -13049,7 +13337,7 @@ type CreateStoryAlbumRequest struct { StoryPosterChatId int64 `json:"story_poster_chat_id"` // Name of the album; 1-12 characters Name string `json:"name"` - // Identifiers of stories to add to the album; 0-getOption("story_album_story_count_max") identifiers + // Identifiers of stories to add to the album; 0-getOption("story_album_size_max") identifiers StoryIds []int32 `json:"story_ids"` } @@ -13171,7 +13459,7 @@ type AddStoryAlbumStoriesRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the story album StoryAlbumId int32 `json:"story_album_id"` - // Identifier of the stories to add to the album; 1-getOption("story_album_story_count_max") identifiers. If after addition the album has more than getOption("story_album_story_count_max") stories, then the last one are removed from the album + // Identifier of the stories to add to the album; 1-getOption("story_album_size_max") identifiers. If after addition the album has more than getOption("story_album_size_max") stories, then the last one are removed from the album StoryIds []int32 `json:"story_ids"` } @@ -13851,7 +14139,7 @@ type PreliminaryUploadFileRequest struct { Priority int32 `json:"priority"` } -// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message +// Preliminarily uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. The upload will not be completed until the file is sent in a message func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -14247,7 +14535,7 @@ type SetApplicationVerificationTokenRequest struct { Token string `json:"token"` } -// Application or reCAPTCHA verification has been completed. Can be called before authorization +// Informs TDLib that application or reCAPTCHA verification has been completed. Can be called before authorization func (client *Client) SetApplicationVerificationToken(req *SetApplicationVerificationTokenRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -14982,7 +15270,7 @@ type AddOfferRequest struct { Options *MessageSendOptions `json:"options"` } -// Sent a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. Returns the sent message +// Sends a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. Returns the sent message func (client *Client) AddOffer(req *AddOfferRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -15258,7 +15546,7 @@ func (client *Client) GetVideoChatAvailableParticipants(req *GetVideoChatAvailab type SetVideoChatDefaultParticipantRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Default group call participant identifier to join the video chats + // Default group call participant identifier to join the video chats in the chat DefaultParticipantId MessageSender `json:"default_participant_id"` } @@ -15397,6 +15685,58 @@ func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlReques return UnmarshalRtmpUrl(result.Data) } +type GetLiveStoryRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns RTMP URL for streaming to a live story; requires can_post_stories administrator right for channel chats +func (client *Client) GetLiveStoryRtmpUrl(req *GetLiveStoryRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + +type ReplaceLiveStoryRtmpUrlRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Replaces the current RTMP URL for streaming to a live story; requires owner privileges for channel chats +func (client *Client) ReplaceLiveStoryRtmpUrl(req *ReplaceLiveStoryRtmpUrlRequest) (*RtmpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "replaceLiveStoryRtmpUrl", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalRtmpUrl(result.Data) +} + type GetGroupCallRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15485,7 +15825,7 @@ type JoinGroupCallRequest struct { JoinParameters *GroupCallJoinParameters `json:"join_parameters"` } -// Joins a group call that is not bound to a chat +// Joins a regular group call that is not bound to a chat func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*GroupCallInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -15510,7 +15850,7 @@ func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*GroupCallInfo, type JoinVideoChatRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only + // Identifier of a group call participant, which will be used to join the call; pass null to join as self ParticipantId MessageSender `json:"participant_id"` // Parameters to join the call JoinParameters *GroupCallJoinParameters `json:"join_parameters"` @@ -15542,6 +15882,35 @@ func (client *Client) JoinVideoChat(req *JoinVideoChatRequest) (*Text, error) { return UnmarshalText(result.Data) } +type JoinLiveStoryRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Parameters to join the call + JoinParameters *GroupCallJoinParameters `json:"join_parameters"` +} + +// Joins a group call of an active live story. Returns join response payload for tgcalls +func (client *Client) JoinLiveStory(req *JoinLiveStoryRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "joinLiveStory", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "join_parameters": req.JoinParameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type StartGroupCallScreenSharingRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -15551,7 +15920,7 @@ type StartGroupCallScreenSharingRequest struct { Payload string `json:"payload"` } -// Starts screen sharing in a joined group call. Returns join response payload for tgcalls +// Starts screen sharing in a joined group call; not supported in live stories. Returns join response payload for tgcalls func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenSharingRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -15581,7 +15950,7 @@ type ToggleGroupCallScreenSharingIsPausedRequest struct { IsPaused bool `json:"is_paused"` } -// Pauses or unpauses screen sharing in a joined group call +// Pauses or unpauses screen sharing in a joined group call; not supported in live stories func (client *Client) ToggleGroupCallScreenSharingIsPaused(req *ToggleGroupCallScreenSharingIsPausedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15608,7 +15977,7 @@ type EndGroupCallScreenSharingRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends screen sharing in a joined group call +// Ends screen sharing in a joined group call; not supported in live stories func (client *Client) EndGroupCallScreenSharing(req *EndGroupCallScreenSharingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15687,22 +16056,103 @@ func (client *Client) ToggleVideoChatMuteNewParticipants(req *ToggleVideoChatMut return UnmarshalOk(result.Data) } -type ToggleGroupCallCanSendMessagesRequest struct { +type ToggleGroupCallAreMessagesAllowedRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // New value of the can_send_messages setting - CanSendMessages bool `json:"can_send_messages"` + // New value of the are_messages_allowed setting + AreMessagesAllowed bool `json:"are_messages_allowed"` } -// Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_can_send_messages right -func (client *Client) ToggleGroupCallCanSendMessages(req *ToggleGroupCallCanSendMessagesRequest) (*Ok, error) { +// Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_are_messages_allowed right +func (client *Client) ToggleGroupCallAreMessagesAllowed(req *ToggleGroupCallAreMessagesAllowedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleGroupCallCanSendMessages", + Type: "toggleGroupCallAreMessagesAllowed", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, - "can_send_messages": req.CanSendMessages, + "are_messages_allowed": req.AreMessagesAllowed, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetLiveStoryStreamerRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns information about the user or the chat that streams to a live story; for live stories that aren't an RTMP stream only +func (client *Client) GetLiveStoryStreamer(req *GetLiveStoryStreamerRequest) (*GroupCallParticipant, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryStreamer", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGroupCallParticipant(result.Data) +} + +type GetLiveStoryAvailableMessageSendersRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Returns the list of message sender identifiers, on whose behalf messages can be sent to a live story +func (client *Client) GetLiveStoryAvailableMessageSenders(req *GetLiveStoryAvailableMessageSendersRequest) (*ChatMessageSenders, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryAvailableMessageSenders", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatMessageSenders(result.Data) +} + +type SetLiveStoryMessageSenderRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // New message sender for the group call + MessageSenderId MessageSender `json:"message_sender_id"` +} + +// Selects a message sender to send messages in a live story call +func (client *Client) SetLiveStoryMessageSender(req *SetLiveStoryMessageSenderRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setLiveStoryMessageSender", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "message_sender_id": req.MessageSenderId, }, }) if err != nil { @@ -15719,8 +16169,10 @@ func (client *Client) ToggleGroupCallCanSendMessages(req *ToggleGroupCallCanSend type SendGroupCallMessageRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // Text of the message to send; 1-getOption("group_call_message_text_length_max") characters + // Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, which depends on paid_message_star_count. Can't contain line feeds for live stories Text *FormattedText `json:"text"` + // The number of Telegram Stars the user agreed to pay to send the message; for live stories only; 0-getOption("paid_group_call_message_star_count_max"). Must be 0 for messages sent to live stories posted by the current user + PaidMessageStarCount int64 `json:"paid_message_star_count"` } // Sends a message to other participants of a group call. Requires groupCall.can_send_messages right @@ -15732,6 +16184,7 @@ func (client *Client) SendGroupCallMessage(req *SendGroupCallMessageRequest) (*O Data: map[string]interface{}{ "group_call_id": req.GroupCallId, "text": req.Text, + "paid_message_star_count": req.PaidMessageStarCount, }, }) if err != nil { @@ -15745,6 +16198,177 @@ func (client *Client) SendGroupCallMessage(req *SendGroupCallMessageRequest) (*O return UnmarshalOk(result.Data) } +type AddPendingLiveStoryReactionRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Number of Telegram Stars to be used for the reaction. The total number of pending paid reactions must not exceed getOption("paid_group_call_message_star_count_max") + StarCount int64 `json:"star_count"` +} + +// Adds pending paid reaction in a live story group call. Can't be used in live stories posted by the current user. Call commitPendingLiveStoryReactions or removePendingLiveStoryReactions to actually send all pending reactions when the undo timer is over or abort the sending +func (client *Client) AddPendingLiveStoryReaction(req *AddPendingLiveStoryReactionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addPendingLiveStoryReaction", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CommitPendingLiveStoryReactionsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Applies all pending paid reactions in a live story group call +func (client *Client) CommitPendingLiveStoryReactions(req *CommitPendingLiveStoryReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "commitPendingLiveStoryReactions", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type RemovePendingLiveStoryReactionsRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` +} + +// Removes all pending paid reactions in a live story group call +func (client *Client) RemovePendingLiveStoryReactions(req *RemovePendingLiveStoryReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "removePendingLiveStoryReactions", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteGroupCallMessagesRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Identifiers of the messages to be deleted + MessageIds []int32 `json:"message_ids"` + // Pass true to report the messages as spam + ReportSpam bool `json:"report_spam"` +} + +// Deletes messages in a group call; for live story calls only. Requires groupCallMessage.can_be_deleted right +func (client *Client) DeleteGroupCallMessages(req *DeleteGroupCallMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGroupCallMessages", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "message_ids": req.MessageIds, + "report_spam": req.ReportSpam, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteGroupCallMessagesBySenderRequest struct { + // Group call identifier + GroupCallId int32 `json:"group_call_id"` + // Identifier of the sender of messages to delete + SenderId MessageSender `json:"sender_id"` + // Pass true to report the messages as spam + ReportSpam bool `json:"report_spam"` +} + +// Deletes all messages sent by the specified message sender in a group call; for live story calls only. Requires groupCall.can_delete_messages right +func (client *Client) DeleteGroupCallMessagesBySender(req *DeleteGroupCallMessagesBySenderRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteGroupCallMessagesBySender", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "sender_id": req.SenderId, + "report_spam": req.ReportSpam, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetLiveStoryTopDonorsRequest struct { + // Group call identifier of the live story + GroupCallId int32 `json:"group_call_id"` +} + +// Returns the list of top live story donors +func (client *Client) GetLiveStoryTopDonors(req *GetLiveStoryTopDonorsRequest) (*LiveStoryDonors, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getLiveStoryTopDonors", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalLiveStoryDonors(result.Data) +} + type InviteGroupCallParticipantRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -16053,6 +16677,35 @@ func (client *Client) ToggleGroupCallIsMyVideoEnabled(req *ToggleGroupCallIsMyVi return UnmarshalOk(result.Data) } +type SetGroupCallPaidMessageStarCountRequest struct { + // Group call identifier; must be an identifier of a live story call + GroupCallId int32 `json:"group_call_id"` + // The new minimum number of Telegram Stars; 0-getOption("paid_group_call_message_star_count_max") + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Changes the minimum number of Telegram Stars that must be paid by general participant for each sent message to a live story call. Requires groupCall.can_be_managed right +func (client *Client) SetGroupCallPaidMessageStarCount(req *SetGroupCallPaidMessageStarCountRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setGroupCallPaidMessageStarCount", + }, + Data: map[string]interface{}{ + "group_call_id": req.GroupCallId, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetGroupCallParticipantIsSpeakingRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` @@ -16103,7 +16756,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { IsMuted bool `json:"is_muted"` } -// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves; not supported for live stories func (client *Client) ToggleGroupCallParticipantIsMuted(req *ToggleGroupCallParticipantIsMutedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16135,7 +16788,7 @@ type SetGroupCallParticipantVolumeLevelRequest struct { VolumeLevel int32 `json:"volume_level"` } -// Changes volume level of a participant of an active group call. If the current user can manage the group call or is the owner of the group call, then the participant's volume level will be changed for all users with the default volume level +// Changes volume level of a participant of an active group call; not supported for live stories. If the current user can manage the group call or is the owner of the group call, then the participant's volume level will be changed for all users with the default volume level func (client *Client) SetGroupCallParticipantVolumeLevel(req *SetGroupCallParticipantVolumeLevelRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16226,7 +16879,7 @@ type LoadGroupCallParticipantsRequest struct { Limit int32 `json:"limit"` } -// Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded +// Loads more participants of a group call; not supported in live stories. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded func (client *Client) LoadGroupCallParticipants(req *LoadGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16279,7 +16932,7 @@ type EndGroupCallRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise +// Ends a group call. Requires groupCall.can_be_managed right for video chats and live stories or groupCall.is_owned otherwise func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16300,16 +16953,16 @@ func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetVideoChatStreamsRequest struct { +type GetGroupCallStreamsRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` } -// Returns information about available video chat streams -func (client *Client) GetVideoChatStreams(req *GetVideoChatStreamsRequest) (*VideoChatStreams, error) { +// Returns information about available streams in a video chat or a live story +func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getVideoChatStreams", + Type: "getGroupCallStreams", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16323,10 +16976,10 @@ func (client *Client) GetVideoChatStreams(req *GetVideoChatStreamsRequest) (*Vid return nil, buildResponseError(result.Data) } - return UnmarshalVideoChatStreams(result.Data) + return UnmarshalGroupCallStreams(result.Data) } -type GetVideoChatStreamSegmentRequest struct { +type GetGroupCallStreamSegmentRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // Point in time when the stream segment begins; Unix timestamp in milliseconds @@ -16339,11 +16992,11 @@ type GetVideoChatStreamSegmentRequest struct { VideoQuality GroupCallVideoQuality `json:"video_quality"` } -// Returns a file with a segment of a video chat stream in a modified OGG format for audio or MPEG-4 format for video -func (client *Client) GetVideoChatStreamSegment(req *GetVideoChatStreamSegmentRequest) (*Data, error) { +// Returns a file with a segment of a video chat or live story in a modified OGG format for audio or MPEG-4 format for video +func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRequest) (*Data, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getVideoChatStreamSegment", + Type: "getGroupCallStreamSegment", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -17203,6 +17856,38 @@ func (client *Client) GetStickerOutline(req *GetStickerOutlineRequest) (*Outline return UnmarshalOutline(result.Data) } +type GetStickerOutlineSvgPathRequest struct { + // File identifier of the sticker + StickerFileId int32 `json:"sticker_file_id"` + // Pass true to get the outline scaled for animated emoji + ForAnimatedEmoji bool `json:"for_animated_emoji"` + // Pass true to get the outline scaled for clicked animated emoji message + ForClickedAnimatedEmojiMessage bool `json:"for_clicked_animated_emoji_message"` +} + +// Returns outline of a sticker as an SVG path. This is an offline method. Returns an empty string if the outline isn't known +func (client *Client) GetStickerOutlineSvgPath(req *GetStickerOutlineSvgPathRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStickerOutlineSvgPath", + }, + Data: map[string]interface{}{ + "sticker_file_id": req.StickerFileId, + "for_animated_emoji": req.ForAnimatedEmoji, + "for_clicked_animated_emoji_message": req.ForClickedAnimatedEmojiMessage, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type GetStickersRequest struct { // Type of the stickers to return StickerType StickerType `json:"sticker_type"` @@ -17947,7 +18632,7 @@ type GetKeywordEmojisRequest struct { InputLanguageCodes []string `json:"input_language_codes"` } -// Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +// Returns emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified func (client *Client) GetKeywordEmojis(req *GetKeywordEmojisRequest) (*Emojis, error) { result, err := client.Send(Request{ meta: meta{ @@ -19002,7 +19687,7 @@ type CheckPhoneNumberCodeRequest struct { Code string `json:"code"` } -// Check the authentication code and completes the request for which the code was sent if appropriate +// Checks the authentication code and completes the request for which the code was sent if appropriate func (client *Client) CheckPhoneNumberCode(req *CheckPhoneNumberCodeRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19764,7 +20449,7 @@ type DeleteBotMediaPreviewsRequest struct { FileIds []int32 `json:"file_ids"` } -// Delete media previews from the list of media previews of a bot +// Deletes media previews from the list of media previews of a bot func (client *Client) DeleteBotMediaPreviews(req *DeleteBotMediaPreviewsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -21369,6 +22054,177 @@ func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetGiftAuctionStateRequest struct { + // Unique identifier of the auction + AuctionId string `json:"auction_id"` +} + +// Returns auction state for a gift +func (client *Client) GetGiftAuctionState(req *GetGiftAuctionStateRequest) (*GiftAuctionState, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftAuctionState", + }, + Data: map[string]interface{}{ + "auction_id": req.AuctionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftAuctionState(result.Data) +} + +type GetGiftAuctionAcquiredGiftsRequest struct { + // Identifier of the auctioned gift + GiftId JsonInt64 `json:"gift_id"` +} + +// Returns the gifts that were acquired by the current user on a gift auction +func (client *Client) GetGiftAuctionAcquiredGifts(req *GetGiftAuctionAcquiredGiftsRequest) (*GiftAuctionAcquiredGifts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftAuctionAcquiredGifts", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftAuctionAcquiredGifts(result.Data) +} + +type OpenGiftAuctionRequest struct { + // Identifier of the gift, which auction was opened + GiftId JsonInt64 `json:"gift_id"` +} + +// Informs TDLib that a gift auction was opened by the user +func (client *Client) OpenGiftAuction(req *OpenGiftAuctionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openGiftAuction", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CloseGiftAuctionRequest struct { + // Identifier of the gift, which auction was closed + GiftId JsonInt64 `json:"gift_id"` +} + +// Informs TDLib that a gift auction was closed by the user +func (client *Client) CloseGiftAuction(req *CloseGiftAuctionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeGiftAuction", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type PlaceGiftAuctionBidRequest struct { + // Identifier of the gift to place the bid on + 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 + 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"` + // Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` +} + +// Places a bid on an auction gift +func (client *Client) PlaceGiftAuctionBid(req *PlaceGiftAuctionBidRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "placeGiftAuctionBid", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + "star_count": req.StarCount, + "user_id": req.UserId, + "text": req.Text, + "is_private": req.IsPrivate, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type IncreaseGiftAuctionBidRequest struct { + // Identifier of the gift to put the bid on + GiftId JsonInt64 `json:"gift_id"` + // The number of Telegram Stars to put in the bid + StarCount int64 `json:"star_count"` +} + +// Increases a bid for an auction gift without changing gift text and receiver +func (client *Client) IncreaseGiftAuctionBid(req *IncreaseGiftAuctionBidRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "increaseGiftAuctionBid", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + "star_count": req.StarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SellGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -21511,6 +22367,32 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( return UnmarshalGiftUpgradePreview(result.Data) } +type GetGiftUpgradeVariantsRequest struct { + // Identifier of the gift + GiftId JsonInt64 `json:"gift_id"` +} + +// Returns all possible variants of upgraded gifts for a regular gift +func (client *Client) GetGiftUpgradeVariants(req *GetGiftUpgradeVariantsRequest) (*GiftUpgradeVariants, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getGiftUpgradeVariants", + }, + Data: map[string]interface{}{ + "gift_id": req.GiftId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalGiftUpgradeVariants(result.Data) +} + type UpgradeGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -21683,6 +22565,73 @@ func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (GiftResaleResu } } +type SendGiftPurchaseOfferRequest struct { + // Identifier of the user or the channel chat that currently owns the gift and will receive the offer + OwnerId MessageSender `json:"owner_id"` + // Name of the upgraded gift + GiftName string `json:"gift_name"` + // The price that the user agreed to pay for the gift + Price GiftResalePrice `json:"price"` + // Duration of the offer, in seconds; must be one of 21600, 43200, 86400, 129600, 172800, or 259200. Can also be 120 if Telegram test environment is used + Duration int32 `json:"duration"` + // The number of Telegram Stars the user agreed to pay additionally for sending of the offer message to the current gift owner; pass userFullInfo.outgoing_paid_message_star_count for users and 0 otherwise + PaidMessageStarCount int64 `json:"paid_message_star_count"` +} + +// Sends an offer to purchase an upgraded gift +func (client *Client) SendGiftPurchaseOffer(req *SendGiftPurchaseOfferRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendGiftPurchaseOffer", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "gift_name": req.GiftName, + "price": req.Price, + "duration": req.Duration, + "paid_message_star_count": req.PaidMessageStarCount, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ProcessGiftPurchaseOfferRequest struct { + // Identifier of the message with the gift purchase offer + MessageId int64 `json:"message_id"` + // Pass true to accept the request; pass false to reject it + Accept bool `json:"accept"` +} + +// Handles a pending gift purchase offer +func (client *Client) ProcessGiftPurchaseOffer(req *ProcessGiftPurchaseOfferRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processGiftPurchaseOffer", + }, + Data: map[string]interface{}{ + "message_id": req.MessageId, + "accept": req.Accept, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetReceivedGiftsRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -21855,6 +22804,25 @@ func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawa return UnmarshalHttpUrl(result.Data) } +// Returns promotional anumation for upgraded gifts +func (client *Client) GetUpgradedGiftsPromotionalAnimation() (*Animation, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUpgradedGiftsPromotionalAnimation", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalAnimation(result.Data) +} + type SetGiftResalePriceRequest struct { // Identifier of the unique gift ReceivedGiftId string `json:"received_gift_id"` @@ -21953,7 +22921,7 @@ type CreateGiftCollectionRequest struct { OwnerId MessageSender `json:"owner_id"` // Name of the collection; 1-12 characters Name string `json:"name"` - // Identifier of the gifts to add to the collection; 0-getOption("gift_collection_gift_count_max") identifiers + // Identifier of the gifts to add to the collection; 0-getOption("gift_collection_size_max") identifiers ReceivedGiftIds []string `json:"received_gift_ids"` } @@ -22075,7 +23043,7 @@ type AddGiftCollectionGiftsRequest struct { OwnerId MessageSender `json:"owner_id"` // Identifier of the gift collection CollectionId int32 `json:"collection_id"` - // Identifier of the gifts to add to the collection; 1-getOption("gift_collection_gift_count_max") identifiers. If after addition the collection has more than getOption("gift_collection_gift_count_max") gifts, then the last one are removed from the collection + // Identifier of the gifts to add to the collection; 1-getOption("gift_collection_size_max") identifiers. If after addition the collection has more than getOption("gift_collection_size_max") gifts, then the last one are removed from the collection ReceivedGiftIds []string `json:"received_gift_ids"` } @@ -23018,7 +23986,7 @@ type CanSendMessageToUserRequest struct { OnlyLocal bool `json:"only_local"` } -// Check whether the current user can message another user or try to create a chat with them +// Checks whether the current user can message another user or try to create a chat with them func (client *Client) CanSendMessageToUser(req *CanSendMessageToUserRequest) (CanSendMessageToUserResult, error) { result, err := client.Send(Request{ meta: meta{ @@ -25377,7 +26345,7 @@ type CheckPremiumGiftCodeRequest struct { Code string `json:"code"` } -// Return information about a Telegram Premium gift code +// Returns information about a Telegram Premium gift code func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -27541,12 +28509,30 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(result.Data) - case TypeUpdateGroupCallNewMessage: - return UnmarshalUpdateGroupCallNewMessage(result.Data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(result.Data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(result.Data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(result.Data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(result.Data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(result.Data) case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(result.Data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(result.Data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(result.Data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(result.Data) @@ -27577,6 +28563,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(result.Data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) @@ -27673,9 +28662,15 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(result.Data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(result.Data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(result.Data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(result.Data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(result.Data) diff --git a/client/type.go b/client/type.go index 4ac8374..3f150f6 100755 --- a/client/type.go +++ b/client/type.go @@ -25,6 +25,7 @@ const ( ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" ClassGiftResalePrice = "GiftResalePrice" + ClassGiftPurchaseOfferState = "GiftPurchaseOfferState" ClassSuggestedPostPrice = "SuggestedPostPrice" ClassSuggestedPostState = "SuggestedPostState" ClassSuggestedPostRefundReason = "SuggestedPostRefundReason" @@ -37,9 +38,11 @@ const ( ClassGiftForResaleOrder = "GiftForResaleOrder" ClassGiftResaleResult = "GiftResaleResult" ClassSentGift = "SentGift" + ClassAuctionState = "AuctionState" ClassTransactionDirection = "TransactionDirection" ClassStarTransactionType = "StarTransactionType" ClassTonTransactionType = "TonTransactionType" + ClassActiveStoryState = "ActiveStoryState" ClassGiveawayParticipantStatus = "GiveawayParticipantStatus" ClassGiveawayInfo = "GiveawayInfo" ClassGiveawayPrize = "GiveawayPrize" @@ -151,6 +154,7 @@ const ( ClassChatTheme = "ChatTheme" ClassInputChatTheme = "InputChatTheme" ClassCanPostStoryResult = "CanPostStoryResult" + ClassStartLiveStoryResult = "StartLiveStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -199,6 +203,8 @@ const ( ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" ClassTermsOfService = "TermsOfService" + ClassPasskey = "Passkey" + ClassPasskeys = "Passkeys" ClassPasswordState = "PasswordState" ClassRecoveryEmailAddress = "RecoveryEmailAddress" ClassTemporaryPasswordState = "TemporaryPasswordState" @@ -230,6 +236,7 @@ const ( ClassLocation = "Location" ClassVenue = "Venue" ClassGame = "Game" + ClassStakeDiceState = "StakeDiceState" ClassWebApp = "WebApp" ClassPoll = "Poll" ClassAlternativeVideo = "AlternativeVideo" @@ -297,6 +304,8 @@ const ( ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions" ClassAcceptedGiftTypes = "AcceptedGiftTypes" ClassGiftSettings = "GiftSettings" + ClassGiftAuction = "GiftAuction" + ClassGiftBackground = "GiftBackground" ClassGiftPurchaseLimits = "GiftPurchaseLimits" ClassGiftResaleParameters = "GiftResaleParameters" ClassGiftCollection = "GiftCollection" @@ -322,6 +331,13 @@ const ( ClassReceivedGift = "ReceivedGift" ClassReceivedGifts = "ReceivedGifts" ClassGiftUpgradePreview = "GiftUpgradePreview" + ClassGiftUpgradeVariants = "GiftUpgradeVariants" + ClassAuctionBid = "AuctionBid" + ClassUserAuctionBid = "UserAuctionBid" + ClassAuctionRound = "AuctionRound" + ClassGiftAuctionState = "GiftAuctionState" + ClassGiftAuctionAcquiredGift = "GiftAuctionAcquiredGift" + ClassGiftAuctionAcquiredGifts = "GiftAuctionAcquiredGifts" ClassStarTransaction = "StarTransaction" ClassStarTransactions = "StarTransactions" ClassTonTransaction = "TonTransaction" @@ -368,6 +384,7 @@ const ( ClassMessageViewers = "MessageViewers" ClassForwardSource = "ForwardSource" ClassPaidReactor = "PaidReactor" + ClassLiveStoryDonors = "LiveStoryDonors" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" @@ -539,8 +556,8 @@ const ( ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" ClassGroupCallJoinParameters = "GroupCallJoinParameters" - ClassVideoChatStream = "VideoChatStream" - ClassVideoChatStreams = "VideoChatStreams" + ClassGroupCallStream = "GroupCallStream" + ClassGroupCallStreams = "GroupCallStreams" ClassRtmpUrl = "RtmpUrl" ClassGroupCallRecentSpeaker = "GroupCallRecentSpeaker" ClassGroupCall = "GroupCall" @@ -549,6 +566,8 @@ const ( ClassGroupCallParticipant = "GroupCallParticipant" ClassGroupCallParticipants = "GroupCallParticipants" ClassGroupCallInfo = "GroupCallInfo" + ClassGroupCallMessage = "GroupCallMessage" + ClassGroupCallMessageLevel = "GroupCallMessageLevel" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" ClassAddedReaction = "AddedReaction" @@ -693,6 +712,8 @@ const ( TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" TypeTermsOfService = "termsOfService" + TypePasskey = "passkey" + TypePasskeys = "passkeys" TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitPremiumPurchase = "authorizationStateWaitPremiumPurchase" @@ -765,6 +786,7 @@ const ( TypeLocation = "location" TypeVenue = "venue" TypeGame = "game" + TypeStakeDiceState = "stakeDiceState" TypeWebApp = "webApp" TypePoll = "poll" TypeAlternativeVideo = "alternativeVideo" @@ -827,6 +849,9 @@ const ( TypeChatAdministratorRights = "chatAdministratorRights" TypeGiftResalePriceStar = "giftResalePriceStar" TypeGiftResalePriceTon = "giftResalePriceTon" + TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" + TypeGiftPurchaseOfferStateAccepted = "giftPurchaseOfferStateAccepted" + TypeGiftPurchaseOfferStateRejected = "giftPurchaseOfferStateRejected" TypeSuggestedPostPriceStar = "suggestedPostPriceStar" TypeSuggestedPostPriceTon = "suggestedPostPriceTon" TypeSuggestedPostStatePending = "suggestedPostStatePending" @@ -870,6 +895,8 @@ const ( TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions" TypeAcceptedGiftTypes = "acceptedGiftTypes" TypeGiftSettings = "giftSettings" + TypeGiftAuction = "giftAuction" + TypeGiftBackground = "giftBackground" TypeGiftPurchaseLimits = "giftPurchaseLimits" TypeGiftResaleParameters = "giftResaleParameters" TypeGiftCollection = "giftCollection" @@ -881,6 +908,7 @@ const ( TypeUpgradedGiftOriginResale = "upgradedGiftOriginResale" TypeUpgradedGiftOriginBlockchain = "upgradedGiftOriginBlockchain" TypeUpgradedGiftOriginPrepaidUpgrade = "upgradedGiftOriginPrepaidUpgrade" + TypeUpgradedGiftOriginOffer = "upgradedGiftOriginOffer" TypeUpgradedGiftModel = "upgradedGiftModel" TypeUpgradedGiftSymbol = "upgradedGiftSymbol" TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors" @@ -912,6 +940,15 @@ const ( TypeReceivedGift = "receivedGift" TypeReceivedGifts = "receivedGifts" TypeGiftUpgradePreview = "giftUpgradePreview" + TypeGiftUpgradeVariants = "giftUpgradeVariants" + TypeAuctionBid = "auctionBid" + TypeUserAuctionBid = "userAuctionBid" + TypeAuctionRound = "auctionRound" + TypeAuctionStateActive = "auctionStateActive" + TypeAuctionStateFinished = "auctionStateFinished" + TypeGiftAuctionState = "giftAuctionState" + TypeGiftAuctionAcquiredGift = "giftAuctionAcquiredGift" + TypeGiftAuctionAcquiredGifts = "giftAuctionAcquiredGifts" TypeTransactionDirectionIncoming = "transactionDirectionIncoming" TypeTransactionDirectionOutgoing = "transactionDirectionOutgoing" TypeStarTransactionTypePremiumBotDeposit = "starTransactionTypePremiumBotDeposit" @@ -933,7 +970,9 @@ const ( TypeStarTransactionTypeBotSubscriptionSale = "starTransactionTypeBotSubscriptionSale" TypeStarTransactionTypeChannelSubscriptionPurchase = "starTransactionTypeChannelSubscriptionPurchase" TypeStarTransactionTypeChannelSubscriptionSale = "starTransactionTypeChannelSubscriptionSale" + TypeStarTransactionTypeGiftAuctionBid = "starTransactionTypeGiftAuctionBid" TypeStarTransactionTypeGiftPurchase = "starTransactionTypeGiftPurchase" + TypeStarTransactionTypeGiftPurchaseOffer = "starTransactionTypeGiftPurchaseOffer" TypeStarTransactionTypeGiftTransfer = "starTransactionTypeGiftTransfer" TypeStarTransactionTypeGiftOriginalDetailsDrop = "starTransactionTypeGiftOriginalDetailsDrop" TypeStarTransactionTypeGiftSale = "starTransactionTypeGiftSale" @@ -946,6 +985,10 @@ const ( TypeStarTransactionTypeAffiliateProgramCommission = "starTransactionTypeAffiliateProgramCommission" TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend" TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive" + TypeStarTransactionTypePaidGroupCallMessageSend = "starTransactionTypePaidGroupCallMessageSend" + TypeStarTransactionTypePaidGroupCallMessageReceive = "starTransactionTypePaidGroupCallMessageReceive" + TypeStarTransactionTypePaidGroupCallReactionSend = "starTransactionTypePaidGroupCallReactionSend" + TypeStarTransactionTypePaidGroupCallReactionReceive = "starTransactionTypePaidGroupCallReactionReceive" TypeStarTransactionTypeSuggestedPostPaymentSend = "starTransactionTypeSuggestedPostPaymentSend" TypeStarTransactionTypeSuggestedPostPaymentReceive = "starTransactionTypeSuggestedPostPaymentReceive" TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase" @@ -956,12 +999,17 @@ const ( TypeStarTransaction = "starTransaction" TypeStarTransactions = "starTransactions" TypeTonTransactionTypeFragmentDeposit = "tonTransactionTypeFragmentDeposit" + TypeTonTransactionTypeFragmentWithdrawal = "tonTransactionTypeFragmentWithdrawal" TypeTonTransactionTypeSuggestedPostPayment = "tonTransactionTypeSuggestedPostPayment" + TypeTonTransactionTypeGiftPurchaseOffer = "tonTransactionTypeGiftPurchaseOffer" TypeTonTransactionTypeUpgradedGiftPurchase = "tonTransactionTypeUpgradedGiftPurchase" TypeTonTransactionTypeUpgradedGiftSale = "tonTransactionTypeUpgradedGiftSale" TypeTonTransactionTypeUnsupported = "tonTransactionTypeUnsupported" TypeTonTransaction = "tonTransaction" TypeTonTransactions = "tonTransactions" + TypeActiveStoryStateLive = "activeStoryStateLive" + TypeActiveStoryStateUnread = "activeStoryStateUnread" + TypeActiveStoryStateRead = "activeStoryStateRead" TypeGiveawayParticipantStatusEligible = "giveawayParticipantStatusEligible" TypeGiveawayParticipantStatusParticipating = "giveawayParticipantStatusParticipating" TypeGiveawayParticipantStatusAlreadyWasMember = "giveawayParticipantStatusAlreadyWasMember" @@ -1059,6 +1107,7 @@ const ( TypePaidReactionTypeAnonymous = "paidReactionTypeAnonymous" TypePaidReactionTypeChat = "paidReactionTypeChat" TypePaidReactor = "paidReactor" + TypeLiveStoryDonors = "liveStoryDonors" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageImportInfo = "messageImportInfo" TypeMessageReplyInfo = "messageReplyInfo" @@ -1298,9 +1347,11 @@ const ( TypeLinkPreviewTypeEmbeddedVideoPlayer = "linkPreviewTypeEmbeddedVideoPlayer" TypeLinkPreviewTypeExternalAudio = "linkPreviewTypeExternalAudio" TypeLinkPreviewTypeExternalVideo = "linkPreviewTypeExternalVideo" + TypeLinkPreviewTypeGiftAuction = "linkPreviewTypeGiftAuction" TypeLinkPreviewTypeGiftCollection = "linkPreviewTypeGiftCollection" TypeLinkPreviewTypeGroupCall = "linkPreviewTypeGroupCall" TypeLinkPreviewTypeInvoice = "linkPreviewTypeInvoice" + TypeLinkPreviewTypeLiveStory = "linkPreviewTypeLiveStory" TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" @@ -1454,6 +1505,7 @@ const ( TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" + TypeMessageStakeDice = "messageStakeDice" TypeMessageStory = "messageStory" TypeMessageChecklist = "messageChecklist" TypeMessageInvoice = "messageInvoice" @@ -1503,6 +1555,8 @@ const ( TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" + TypeMessageUpgradedGiftPurchaseOffer = "messageUpgradedGiftPurchaseOffer" + TypeMessageUpgradedGiftPurchaseOfferRejected = "messageUpgradedGiftPurchaseOfferRejected" TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded" TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged" TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged" @@ -1573,6 +1627,7 @@ const ( TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageStakeDice = "inputMessageStakeDice" TypeInputMessageStory = "inputMessageStory" TypeInputMessageChecklist = "inputMessageChecklist" TypeInputMessageForwarded = "inputMessageForwarded" @@ -1657,6 +1712,7 @@ const ( TypeStoryVideo = "storyVideo" TypeStoryContentPhoto = "storyContentPhoto" TypeStoryContentVideo = "storyContentVideo" + TypeStoryContentLive = "storyContentLive" TypeStoryContentUnsupported = "storyContentUnsupported" TypeInputStoryContentPhoto = "inputStoryContentPhoto" TypeInputStoryContentVideo = "inputStoryContentVideo" @@ -1723,8 +1779,8 @@ const ( TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" - TypeVideoChatStream = "videoChatStream" - TypeVideoChatStreams = "videoChatStreams" + TypeGroupCallStream = "groupCallStream" + TypeGroupCallStreams = "groupCallStreams" TypeRtmpUrl = "rtmpUrl" TypeGroupCallRecentSpeaker = "groupCallRecentSpeaker" TypeGroupCall = "groupCall" @@ -1733,6 +1789,8 @@ const ( TypeGroupCallParticipant = "groupCallParticipant" TypeGroupCallParticipants = "groupCallParticipants" TypeGroupCallInfo = "groupCallInfo" + TypeGroupCallMessage = "groupCallMessage" + TypeGroupCallMessageLevel = "groupCallMessageLevel" TypeInviteGroupCallParticipantResultUserPrivacyRestricted = "inviteGroupCallParticipantResultUserPrivacyRestricted" TypeInviteGroupCallParticipantResultUserAlreadyParticipant = "inviteGroupCallParticipantResultUserAlreadyParticipant" TypeInviteGroupCallParticipantResultUserWasBanned = "inviteGroupCallParticipantResultUserWasBanned" @@ -1926,6 +1984,7 @@ const ( TypePremiumFeatureBusiness = "premiumFeatureBusiness" TypePremiumFeatureMessageEffects = "premiumFeatureMessageEffects" TypePremiumFeatureChecklists = "premiumFeatureChecklists" + TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -2011,6 +2070,9 @@ const ( TypeCanPostStoryResultActiveStoryLimitExceeded = "canPostStoryResultActiveStoryLimitExceeded" TypeCanPostStoryResultWeeklyLimitExceeded = "canPostStoryResultWeeklyLimitExceeded" TypeCanPostStoryResultMonthlyLimitExceeded = "canPostStoryResultMonthlyLimitExceeded" + TypeCanPostStoryResultLiveStoryIsActive = "canPostStoryResultLiveStoryIsActive" + TypeStartLiveStoryResultOk = "startLiveStoryResultOk" + TypeStartLiveStoryResultFail = "startLiveStoryResultFail" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" @@ -2120,6 +2182,7 @@ const ( TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" + TypeUserPrivacySettingShowProfileAudio = "userPrivacySettingShowProfileAudio" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -2193,19 +2256,24 @@ const ( TypeInternalLinkTypeDirectMessagesChat = "internalLinkTypeDirectMessagesChat" TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" + TypeInternalLinkTypeGiftAuction = "internalLinkTypeGiftAuction" TypeInternalLinkTypeGiftCollection = "internalLinkTypeGiftCollection" TypeInternalLinkTypeGroupCall = "internalLinkTypeGroupCall" TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeLiveStory = "internalLinkTypeLiveStory" + TypeInternalLinkTypeLoginEmailSettings = "internalLinkTypeLoginEmailSettings" TypeInternalLinkTypeMainWebApp = "internalLinkTypeMainWebApp" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" TypeInternalLinkTypeMyStars = "internalLinkTypeMyStars" TypeInternalLinkTypeMyToncoins = "internalLinkTypeMyToncoins" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" + TypeInternalLinkTypePasswordSettings = "internalLinkTypePasswordSettings" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" + TypeInternalLinkTypePhoneNumberPrivacySettings = "internalLinkTypePhoneNumberPrivacySettings" TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" @@ -2315,6 +2383,8 @@ const ( TypeSuggestedActionExtendPremium = "suggestedActionExtendPremium" TypeSuggestedActionExtendStarSubscriptions = "suggestedActionExtendStarSubscriptions" TypeSuggestedActionCustom = "suggestedActionCustom" + TypeSuggestedActionSetLoginEmailAddress = "suggestedActionSetLoginEmailAddress" + TypeSuggestedActionAddLoginPasskey = "suggestedActionAddLoginPasskey" TypeCount = "count" TypeText = "text" TypeData = "data" @@ -2467,8 +2537,14 @@ const ( TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" TypeUpdateGroupCallParticipants = "updateGroupCallParticipants" TypeUpdateGroupCallVerificationState = "updateGroupCallVerificationState" - TypeUpdateGroupCallNewMessage = "updateGroupCallNewMessage" + TypeUpdateNewGroupCallMessage = "updateNewGroupCallMessage" + TypeUpdateNewGroupCallPaidReaction = "updateNewGroupCallPaidReaction" + TypeUpdateGroupCallMessageSendFailed = "updateGroupCallMessageSendFailed" + TypeUpdateGroupCallMessagesDeleted = "updateGroupCallMessagesDeleted" + TypeUpdateLiveStoryTopDonors = "updateLiveStoryTopDonors" TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" + TypeUpdateGiftAuctionState = "updateGiftAuctionState" + TypeUpdateActiveGiftAuctions = "updateActiveGiftAuctions" TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" @@ -2479,6 +2555,7 @@ const ( TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateStoryStealthMode = "updateStoryStealthMode" + TypeUpdateTrustedMiniAppBots = "updateTrustedMiniAppBots" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -2511,7 +2588,9 @@ const ( TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" TypeUpdateTonRevenueStatus = "updateTonRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" + TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" + TypeUpdateStakeDiceState = "updateStakeDiceState" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" @@ -2645,6 +2724,11 @@ type GiftResalePrice interface { GiftResalePriceType() string } +// Describes state of a gift purchase offer +type GiftPurchaseOfferState interface { + GiftPurchaseOfferStateType() string +} + // Describes price of a suggested post type SuggestedPostPrice interface { SuggestedPostPriceType() string @@ -2705,6 +2789,11 @@ type SentGift interface { SentGiftType() string } +// Describes state of an auction +type AuctionState interface { + AuctionStateType() string +} + // Describes direction of transactions in a transaction list type TransactionDirection interface { TransactionDirectionType() string @@ -2720,6 +2809,11 @@ type TonTransactionType interface { TonTransactionTypeType() string } +// Describes state of active stories posted by a chat +type ActiveStoryState interface { + ActiveStoryStateType() string +} + // Contains information about status of a user in a giveaway type GiveawayParticipantStatus interface { GiveawayParticipantStatusType() string @@ -3275,6 +3369,11 @@ type CanPostStoryResult interface { CanPostStoryResultType() string } +// Represents result of starting a live story +type StartLiveStoryResult interface { + StartLiveStoryResultType() string +} + // Represents result of checking whether the current session can be used to transfer a chat ownership to another user type CanTransferOwnershipResult interface { CanTransferOwnershipResultType() string @@ -4157,6 +4256,60 @@ func (*TermsOfService) GetType() string { return TypeTermsOfService } +// Describes a passkey +type Passkey struct { + meta + // Unique identifier of the passkey + Id string `json:"id"` + // Name of the passkey + Name string `json:"name"` + // Point in time (Unix timestamp) when the passkey was added + AdditionDate int32 `json:"addition_date"` + // Point in time (Unix timestamp) when the passkey was used last time; 0 if never + LastUsageDate int32 `json:"last_usage_date"` + // Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown + SoftwareIconCustomEmojiId JsonInt64 `json:"software_icon_custom_emoji_id"` +} + +func (entity *Passkey) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Passkey + + return json.Marshal((*stub)(entity)) +} + +func (*Passkey) GetClass() string { + return ClassPasskey +} + +func (*Passkey) GetType() string { + return TypePasskey +} + +// Contains a list of passkeys +type Passkeys struct { + meta + // List of passkeys + Passkeys []*Passkey `json:"passkeys"` +} + +func (entity *Passkeys) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Passkeys + + return json.Marshal((*stub)(entity)) +} + +func (*Passkeys) GetClass() string { + return ClassPasskeys +} + +func (*Passkeys) GetType() string { + return TypePasskeys +} + // Initialization parameters are needed. Call setTdlibParameters to provide them type AuthorizationStateWaitTdlibParameters struct{ meta @@ -4182,7 +4335,7 @@ func (*AuthorizationStateWaitTdlibParameters) AuthorizationStateType() string { return TypeAuthorizationStateWaitTdlibParameters } -// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options +// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct{ meta } @@ -5715,8 +5868,8 @@ type ChecklistTask struct { Id int32 `json:"id"` // Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities Text *FormattedText `json:"text"` - // Identifier of the user that completed the task; 0 if the task isn't completed - CompletedByUserId int64 `json:"completed_by_user_id"` + // Identifier of the user or chat that completed the task; may be null if the task isn't completed yet + CompletedBy MessageSender `json:"completed_by"` // Point in time (Unix timestamp) when the task was completed; 0 if the task isn't completed CompletionDate int32 `json:"completion_date"` } @@ -5737,6 +5890,29 @@ func (*ChecklistTask) GetType() string { return TypeChecklistTask } +func (checklistTask *ChecklistTask) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Text *FormattedText `json:"text"` + CompletedBy json.RawMessage `json:"completed_by"` + CompletionDate int32 `json:"completion_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + checklistTask.Id = tmp.Id + checklistTask.Text = tmp.Text + checklistTask.CompletionDate = tmp.CompletionDate + + fieldCompletedBy, _ := UnmarshalMessageSender(tmp.CompletedBy) + checklistTask.CompletedBy = fieldCompletedBy + + return nil +} + // Describes a task in a checklist to be sent type InputChecklistTask struct { meta @@ -5996,7 +6172,7 @@ type Sticker struct { Width int32 `json:"width"` // Sticker height; as defined by the sender Height int32 `json:"height"` - // Emoji corresponding to the sticker + // Emoji corresponding to the sticker; may be empty if unknown Emoji string `json:"emoji"` // Sticker format Format StickerFormat `json:"format"` @@ -6377,6 +6553,39 @@ func (*Game) GetType() string { return TypeGame } +// Describes state of the stake dice +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 + 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"` + // The number of rolled sixes towards the streak; 0-2 + CurrentStreak int32 `json:"current_streak"` + // 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 + PrizePerMille []int32 `json:"prize_per_mille"` + // The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 6 three times in a row with the same stake + StreakPrizePerMille int32 `json:"streak_prize_per_mille"` +} + +func (entity *StakeDiceState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StakeDiceState + + return json.Marshal((*stub)(entity)) +} + +func (*StakeDiceState) GetClass() string { + return ClassStakeDiceState +} + +func (*StakeDiceState) GetType() string { + return TypeStakeDiceState +} + // Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App type WebApp struct { meta @@ -6495,7 +6704,7 @@ type AlternativeVideo struct { Width int32 `json:"width"` // Video height Height int32 `json:"height"` - // Codec used for video file encoding, for example, "h264", "h265", or "av1" + // Codec used for video file encoding, for example, "h264", "h265", "av1", or "av01" Codec string `json:"codec"` // HLS file describing the video HlsFile *File `json:"hls_file"` @@ -8240,7 +8449,7 @@ type ChatAdministratorRights struct { CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels + // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can pin messages; applicable to basic groups and supergroups only CanPinMessages bool `json:"can_pin_messages"` @@ -8281,7 +8490,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 range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale + // 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 StarCount int64 `json:"star_count"` } @@ -8308,7 +8517,7 @@ func (*GiftResalePriceStar) GiftResalePriceType() string { // Describes price of a resold gift in Toncoins type GiftResalePriceTon struct { meta - // The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") + // The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in the range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") ToncoinCentCount int64 `json:"toncoin_cent_count"` } @@ -8332,6 +8541,81 @@ func (*GiftResalePriceTon) GiftResalePriceType() string { return TypeGiftResalePriceTon } +// The offer must be accepted or rejected +type GiftPurchaseOfferStatePending struct{ + meta +} + +func (entity *GiftPurchaseOfferStatePending) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStatePending + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStatePending) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStatePending) GetType() string { + return TypeGiftPurchaseOfferStatePending +} + +func (*GiftPurchaseOfferStatePending) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStatePending +} + +// The offer was accepted +type GiftPurchaseOfferStateAccepted struct{ + meta +} + +func (entity *GiftPurchaseOfferStateAccepted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStateAccepted + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStateAccepted) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStateAccepted) GetType() string { + return TypeGiftPurchaseOfferStateAccepted +} + +func (*GiftPurchaseOfferStateAccepted) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStateAccepted +} + +// The offer was rejected +type GiftPurchaseOfferStateRejected struct{ + meta +} + +func (entity *GiftPurchaseOfferStateRejected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftPurchaseOfferStateRejected + + return json.Marshal((*stub)(entity)) +} + +func (*GiftPurchaseOfferStateRejected) GetClass() string { + return ClassGiftPurchaseOfferState +} + +func (*GiftPurchaseOfferStateRejected) GetType() string { + return TypeGiftPurchaseOfferStateRejected +} + +func (*GiftPurchaseOfferStateRejected) GiftPurchaseOfferStateType() string { + return TypeGiftPurchaseOfferStateRejected +} + // Describes price of a suggested post in Telegram Stars type SuggestedPostPriceStar struct { meta @@ -9119,7 +9403,7 @@ type ConnectedAffiliateProgram struct { // The number of users that used the affiliate program UserCount JsonInt64 `json:"user_count"` // The number of Telegram Stars that were earned by the affiliate program - RevenueStarCount JsonInt64 `json:"revenue_star_count"` + RevenueStarCount int64 `json:"revenue_star_count"` } func (entity *ConnectedAffiliateProgram) MarshalJSON() ([]byte, error) { @@ -9404,10 +9688,12 @@ type PremiumGiftCodeInfo struct { CreationDate int32 `json:"creation_date"` // True, if the gift code was created for a giveaway IsFromGiveaway bool `json:"is_from_giveaway"` - // Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message + // Identifier of the corresponding giveaway message in the creator_id chat; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` - // Number of months the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active after code activation + DayCount int32 `json:"day_count"` // Identifier of a user for which the code was created; 0 if none UserId int64 `json:"user_id"` // Point in time (Unix timestamp) when the code was activated; 0 if none @@ -9437,6 +9723,7 @@ func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error IsFromGiveaway bool `json:"is_from_giveaway"` GiveawayMessageId int64 `json:"giveaway_message_id"` MonthCount int32 `json:"month_count"` + DayCount int32 `json:"day_count"` UserId int64 `json:"user_id"` UseDate int32 `json:"use_date"` } @@ -9450,6 +9737,7 @@ func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId premiumGiftCodeInfo.MonthCount = tmp.MonthCount + premiumGiftCodeInfo.DayCount = tmp.DayCount premiumGiftCodeInfo.UserId = tmp.UserId premiumGiftCodeInfo.UseDate = tmp.UseDate @@ -9609,6 +9897,8 @@ type AcceptedGiftTypes struct { LimitedGifts bool `json:"limited_gifts"` // True, if upgraded gifts and regular gifts that can be upgraded for free are accepted UpgradedGifts bool `json:"upgraded_gifts"` + // True, if gifts from channels are accepted subject to other restrictions + GiftsFromChannels bool `json:"gifts_from_channels"` // True, if Telegram Premium subscription is accepted PremiumSubscription bool `json:"premium_subscription"` } @@ -9654,6 +9944,60 @@ func (*GiftSettings) GetType() string { return TypeGiftSettings } +// Describes an auction on which a gift can be purchased +type GiftAuction struct { + meta + // Identifier of the auction + Id string `json:"id"` + // Number of gifts distributed in each round + GiftsPerRound int32 `json:"gifts_per_round"` + // Point in time (Unix timestamp) when the auction will start + StartDate int32 `json:"start_date"` +} + +func (entity *GiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuction) GetClass() string { + return ClassGiftAuction +} + +func (*GiftAuction) GetType() string { + return TypeGiftAuction +} + +// Describes background of a gift +type GiftBackground struct { + meta + // Center color in RGB format + CenterColor int32 `json:"center_color"` + // Edge color in RGB format + EdgeColor int32 `json:"edge_color"` + // Text color in RGB format + TextColor int32 `json:"text_color"` +} + +func (entity *GiftBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftBackground + + return json.Marshal((*stub)(entity)) +} + +func (*GiftBackground) GetClass() string { + return ClassGiftBackground +} + +func (*GiftBackground) GetType() string { + return TypeGiftBackground +} + // Describes the maximum number of times that a specific gift can be purchased type GiftPurchaseLimits struct { meta @@ -9813,7 +10157,7 @@ func (*CanSendGiftResultFail) CanSendGiftResultType() string { // The gift was obtained by upgrading of a previously received gift type UpgradedGiftOriginUpgrade struct { meta - // Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message + // Identifier of the message with the regular gift that was upgraded; may be 0 or an identifier of a deleted message GiftMessageId int64 `json:"gift_message_id"` } @@ -9865,7 +10209,7 @@ func (*UpgradedGiftOriginTransfer) UpgradedGiftOriginType() string { // The gift was bought from another user type UpgradedGiftOriginResale struct { meta - // Price paid by the sender for the gift + // Price paid for the gift Price GiftResalePrice `json:"price"` } @@ -9955,6 +10299,49 @@ func (*UpgradedGiftOriginPrepaidUpgrade) UpgradedGiftOriginType() string { return TypeUpgradedGiftOriginPrepaidUpgrade } +// The gift was bought through an offer +type UpgradedGiftOriginOffer struct { + meta + // Price paid for the gift + Price GiftResalePrice `json:"price"` +} + +func (entity *UpgradedGiftOriginOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpgradedGiftOriginOffer + + return json.Marshal((*stub)(entity)) +} + +func (*UpgradedGiftOriginOffer) GetClass() string { + return ClassUpgradedGiftOrigin +} + +func (*UpgradedGiftOriginOffer) GetType() string { + return TypeUpgradedGiftOriginOffer +} + +func (*UpgradedGiftOriginOffer) UpgradedGiftOriginType() string { + return TypeUpgradedGiftOriginOffer +} + +func (upgradedGiftOriginOffer *UpgradedGiftOriginOffer) UnmarshalJSON(data []byte) error { + var tmp struct { + Price json.RawMessage `json:"price"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + upgradedGiftOriginOffer.Price = fieldPrice + + return nil +} + // Describes a model of an upgraded gift type UpgradedGiftModel struct { meta @@ -10171,18 +10558,24 @@ type Gift struct { DefaultSellStarCount int64 `json:"default_sell_star_count"` // Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible UpgradeStarCount int64 `json:"upgrade_star_count"` + // Number of unique gift variants that are available for the upgraded gift; 0 if unknown + UpgradeVariantCount int32 `json:"upgrade_variant_count"` // True, if the gift can be used to customize the user's name, and backgrounds of profile photo, reply header, and link preview HasColors bool `json:"has_colors"` // True, if the gift is a birthday gift IsForBirthday bool `json:"is_for_birthday"` // True, if the gift can be bought only by Telegram Premium subscribers IsPremium bool `json:"is_premium"` - // Point in time (Unix timestamp) when the gift can be sent next time by the current user; can be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can't be sent now + // Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly + AuctionInfo *GiftAuction `json:"auction_info"` + // Point in time (Unix timestamp) when the gift can be sent next time by the current user; may be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can't be sent now NextSendDate int32 `json:"next_send_date"` // Number of times the gift can be purchased by the current user; may be null if not limited UserLimits *GiftPurchaseLimits `json:"user_limits"` // Number of times the gift can be purchased all users; may be null if not limited OverallLimits *GiftPurchaseLimits `json:"overall_limits"` + // Background of the gift + Background *GiftBackground `json:"background"` // Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only FirstSendDate int32 `json:"first_send_date"` // Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only @@ -10252,10 +10645,14 @@ type UpgradedGift struct { 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"` // 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 ValueAmount int64 `json:"value_amount"` + // Estimated value of the gift in USD; in USD cents; 0 if unavailable + ValueUsdAmount int64 `json:"value_usd_amount"` } func (entity *UpgradedGift) MarshalJSON() ([]byte, error) { @@ -10298,8 +10695,10 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` Colors *UpgradedGiftColors `json:"colors"` ResaleParameters *GiftResaleParameters `json:"resale_parameters"` + CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` ValueCurrency string `json:"value_currency"` ValueAmount int64 `json:"value_amount"` + ValueUsdAmount int64 `json:"value_usd_amount"` } err := json.Unmarshal(data, &tmp) @@ -10327,8 +10726,10 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.OriginalDetails = tmp.OriginalDetails upgradedGift.Colors = tmp.Colors upgradedGift.ResaleParameters = tmp.ResaleParameters + upgradedGift.CanSendPurchaseOffer = tmp.CanSendPurchaseOffer upgradedGift.ValueCurrency = tmp.ValueCurrency upgradedGift.ValueAmount = tmp.ValueAmount + upgradedGift.ValueUsdAmount = tmp.ValueUsdAmount fieldHostId, _ := UnmarshalMessageSender(tmp.HostId) upgradedGift.HostId = fieldHostId @@ -10924,6 +11325,8 @@ type ReceivedGift struct { SenderId MessageSender `json:"sender_id"` // Message added to the gift Text *FormattedText `json:"text"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them IsPrivate bool `json:"is_private"` // True, if the gift is displayed on the chat's profile page; only for the receiver of the gift @@ -10983,6 +11386,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { ReceivedGiftId string `json:"received_gift_id"` SenderId json.RawMessage `json:"sender_id"` Text *FormattedText `json:"text"` + UniqueGiftNumber int32 `json:"unique_gift_number"` IsPrivate bool `json:"is_private"` IsSaved bool `json:"is_saved"` IsPinned bool `json:"is_pinned"` @@ -11010,6 +11414,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.ReceivedGiftId = tmp.ReceivedGiftId receivedGift.Text = tmp.Text + receivedGift.UniqueGiftNumber = tmp.UniqueGiftNumber receivedGift.IsPrivate = tmp.IsPrivate receivedGift.IsSaved = tmp.IsSaved receivedGift.IsPinned = tmp.IsPinned @@ -11097,6 +11502,370 @@ func (*GiftUpgradePreview) GetType() string { return TypeGiftUpgradePreview } +// Contains all possible variants of upgraded gifts for the given regular gift +type GiftUpgradeVariants struct { + meta + // Models that can be chosen for the gift after upgrade + Models []*UpgradedGiftModel `json:"models"` + // Symbols that can be chosen for the gift after upgrade + Symbols []*UpgradedGiftSymbol `json:"symbols"` + // Backdrops that can be chosen for the gift after upgrade + Backdrops []*UpgradedGiftBackdrop `json:"backdrops"` +} + +func (entity *GiftUpgradeVariants) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftUpgradeVariants + + return json.Marshal((*stub)(entity)) +} + +func (*GiftUpgradeVariants) GetClass() string { + return ClassGiftUpgradeVariants +} + +func (*GiftUpgradeVariants) GetType() string { + return TypeGiftUpgradeVariants +} + +// Describes a bid in an auction +type AuctionBid struct { + meta + // The number of Telegram Stars that were put in the bid + StarCount int64 `json:"star_count"` + // Point in time (Unix timestamp) when the bid was made + BidDate int32 `json:"bid_date"` + // Position of the bid in the list of all bids + Position int32 `json:"position"` +} + +func (entity *AuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionBid) GetClass() string { + return ClassAuctionBid +} + +func (*AuctionBid) GetType() string { + return TypeAuctionBid +} + +// Describes a bid of the current user in an auction +type UserAuctionBid struct { + meta + // The number of Telegram Stars that were put in the bid + StarCount int64 `json:"star_count"` + // Point in time (Unix timestamp) when the bid was made + BidDate int32 `json:"bid_date"` + // The minimum number of Telegram Stars that can be put for the next bid + NextBidStarCount int64 `json:"next_bid_star_count"` + // Identifier of the user or the chat that will receive the auctioned item. If the auction is opened in context of another user or chat, then a warning is supposed to be shown to the current user + OwnerId MessageSender `json:"owner_id"` + // True, if the bid was returned to the user, because it was outbid and can't win anymore + WasReturned bool `json:"was_returned"` +} + +func (entity *UserAuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserAuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*UserAuctionBid) GetClass() string { + return ClassUserAuctionBid +} + +func (*UserAuctionBid) GetType() string { + return TypeUserAuctionBid +} + +func (userAuctionBid *UserAuctionBid) UnmarshalJSON(data []byte) error { + var tmp struct { + StarCount int64 `json:"star_count"` + BidDate int32 `json:"bid_date"` + NextBidStarCount int64 `json:"next_bid_star_count"` + OwnerId json.RawMessage `json:"owner_id"` + WasReturned bool `json:"was_returned"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + userAuctionBid.StarCount = tmp.StarCount + userAuctionBid.BidDate = tmp.BidDate + userAuctionBid.NextBidStarCount = tmp.NextBidStarCount + userAuctionBid.WasReturned = tmp.WasReturned + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + userAuctionBid.OwnerId = fieldOwnerId + + return nil +} + +// Describes a round of an auction +type AuctionRound struct { + meta + // 1-based number of the round + Number int32 `json:"number"` + // Duration of the round, in seconds + Duration int32 `json:"duration"` + // The number of seconds for which the round will be extended if there are changes in the top winners + ExtendTime int32 `json:"extend_time"` + // The number of top winners who trigger round extension if changed + TopWinnerCount int32 `json:"top_winner_count"` +} + +func (entity *AuctionRound) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionRound + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionRound) GetClass() string { + return ClassAuctionRound +} + +func (*AuctionRound) GetType() string { + return TypeAuctionRound +} + +// Contains information about an ongoing or scheduled auction +type AuctionStateActive struct { + meta + // Point in time (Unix timestamp) when the auction started or will start + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the auction will be ended + EndDate int32 `json:"end_date"` + // The minimum possible bid in the auction in Telegram Stars + MinBid int64 `json:"min_bid"` + // A sparse list of bids that were made in the auction + BidLevels []*AuctionBid `json:"bid_levels"` + // User identifiers of at most 3 users with the biggest bids + TopBidderUserIds []int64 `json:"top_bidder_user_ids"` + // Rounds of the auction in which their duration or extension rules are changed + Rounds []*AuctionRound `json:"rounds"` + // Point in time (Unix timestamp) when the current round will end + CurrentRoundEndDate int32 `json:"current_round_end_date"` + // 1-based number of the current round + CurrentRoundNumber int32 `json:"current_round_number"` + // The total number of rounds + TotalRoundCount int32 `json:"total_round_count"` + // The number of items that were purchased on the auction by all users + DistributedItemCount int32 `json:"distributed_item_count"` + // The number of items that have to be distributed on the auction + LeftItemCount int32 `json:"left_item_count"` + // The number of items that were purchased by the current user on the auction + AcquiredItemCount int32 `json:"acquired_item_count"` + // Bid of the current user in the auction; may be null if none + UserBid *UserAuctionBid `json:"user_bid"` +} + +func (entity *AuctionStateActive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionStateActive + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionStateActive) GetClass() string { + return ClassAuctionState +} + +func (*AuctionStateActive) GetType() string { + return TypeAuctionStateActive +} + +func (*AuctionStateActive) AuctionStateType() string { + return TypeAuctionStateActive +} + +// Contains information about a finished auction +type AuctionStateFinished struct { + meta + // Point in time (Unix timestamp) when the auction started + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the auction will be ended + EndDate int32 `json:"end_date"` + // Average price of bought items in Telegram Stars + AveragePrice int64 `json:"average_price"` + // The number of items that were purchased by the current user on the auction + AcquiredItemCount int32 `json:"acquired_item_count"` + // Number of items from the auction being resold on Telegram + TelegramListedItemCount int32 `json:"telegram_listed_item_count"` + // Number of items from the auction being resold on Fragment + FragmentListedItemCount int32 `json:"fragment_listed_item_count"` + // The HTTPS link to the Fragment for the resold items; may be empty if there are no such items being sold on Fragment + FragmentUrl string `json:"fragment_url"` +} + +func (entity *AuctionStateFinished) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AuctionStateFinished + + return json.Marshal((*stub)(entity)) +} + +func (*AuctionStateFinished) GetClass() string { + return ClassAuctionState +} + +func (*AuctionStateFinished) GetType() string { + return TypeAuctionStateFinished +} + +func (*AuctionStateFinished) AuctionStateType() string { + return TypeAuctionStateFinished +} + +// Represent auction state of a gift +type GiftAuctionState struct { + meta + // The gift + Gift *Gift `json:"gift"` + // Auction state of the gift + State AuctionState `json:"state"` +} + +func (entity *GiftAuctionState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionState + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionState) GetClass() string { + return ClassGiftAuctionState +} + +func (*GiftAuctionState) GetType() string { + return TypeGiftAuctionState +} + +func (giftAuctionState *GiftAuctionState) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *Gift `json:"gift"` + State json.RawMessage `json:"state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + giftAuctionState.Gift = tmp.Gift + + fieldState, _ := UnmarshalAuctionState(tmp.State) + giftAuctionState.State = fieldState + + return nil +} + +// Represents a gift that was acquired by the current user on an auction +type GiftAuctionAcquiredGift struct { + meta + // Receiver of the gift + ReceiverId MessageSender `json:"receiver_id"` + // Point in time (Unix timestamp) when the gift was acquired + Date int32 `json:"date"` + // The number of Telegram Stars that were paid for the gift + StarCount int64 `json:"star_count"` + // Identifier of the auction round in which the gift was acquired + AuctionRoundNumber int32 `json:"auction_round_number"` + // Position of the user in the round among all auction participants + AuctionRoundPosition int32 `json:"auction_round_position"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` + // Message added to the gift + Text *FormattedText `json:"text"` + // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them + IsPrivate bool `json:"is_private"` +} + +func (entity *GiftAuctionAcquiredGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionAcquiredGift + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionAcquiredGift) GetClass() string { + return ClassGiftAuctionAcquiredGift +} + +func (*GiftAuctionAcquiredGift) GetType() string { + return TypeGiftAuctionAcquiredGift +} + +func (giftAuctionAcquiredGift *GiftAuctionAcquiredGift) UnmarshalJSON(data []byte) error { + var tmp struct { + ReceiverId json.RawMessage `json:"receiver_id"` + Date int32 `json:"date"` + StarCount int64 `json:"star_count"` + AuctionRoundNumber int32 `json:"auction_round_number"` + AuctionRoundPosition int32 `json:"auction_round_position"` + UniqueGiftNumber int32 `json:"unique_gift_number"` + Text *FormattedText `json:"text"` + IsPrivate bool `json:"is_private"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + giftAuctionAcquiredGift.Date = tmp.Date + giftAuctionAcquiredGift.StarCount = tmp.StarCount + giftAuctionAcquiredGift.AuctionRoundNumber = tmp.AuctionRoundNumber + giftAuctionAcquiredGift.AuctionRoundPosition = tmp.AuctionRoundPosition + giftAuctionAcquiredGift.UniqueGiftNumber = tmp.UniqueGiftNumber + giftAuctionAcquiredGift.Text = tmp.Text + giftAuctionAcquiredGift.IsPrivate = tmp.IsPrivate + + fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) + giftAuctionAcquiredGift.ReceiverId = fieldReceiverId + + return nil +} + +// Represents a list of gifts that were acquired by the current user on an auction +type GiftAuctionAcquiredGifts struct { + meta + // The list of acquired gifts + Gifts []*GiftAuctionAcquiredGift `json:"gifts"` +} + +func (entity *GiftAuctionAcquiredGifts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GiftAuctionAcquiredGifts + + return json.Marshal((*stub)(entity)) +} + +func (*GiftAuctionAcquiredGifts) GetClass() string { + return ClassGiftAuctionAcquiredGifts +} + +func (*GiftAuctionAcquiredGifts) GetType() string { + return TypeGiftAuctionAcquiredGifts +} + // The transaction is incoming and increases the amount of owned currency type TransactionDirectionIncoming struct{ meta @@ -11147,7 +11916,7 @@ func (*TransactionDirectionOutgoing) TransactionDirectionType() string { return TypeTransactionDirectionOutgoing } -// The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only +// The transaction is a deposit of Telegram Stars from the Premium bot; relevant for regular users only type StarTransactionTypePremiumBotDeposit struct{ meta } @@ -11172,7 +11941,7 @@ func (*StarTransactionTypePremiumBotDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumBotDeposit } -// The transaction is a deposit of Telegram Stars from App Store; for regular users only +// The transaction is a deposit of Telegram Stars from App Store; relevant for regular users only type StarTransactionTypeAppStoreDeposit struct{ meta } @@ -11197,7 +11966,7 @@ func (*StarTransactionTypeAppStoreDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeAppStoreDeposit } -// The transaction is a deposit of Telegram Stars from Google Play; for regular users only +// The transaction is a deposit of Telegram Stars from Google Play; relevant for regular users only type StarTransactionTypeGooglePlayDeposit struct{ meta } @@ -11222,7 +11991,7 @@ func (*StarTransactionTypeGooglePlayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGooglePlayDeposit } -// The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only +// The transaction is a deposit of Telegram Stars from Fragment; relevant for regular users and bots only type StarTransactionTypeFragmentDeposit struct{ meta } @@ -11247,7 +12016,7 @@ func (*StarTransactionTypeFragmentDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeFragmentDeposit } -// The transaction is a deposit of Telegram Stars by another user; for regular users only +// 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 @@ -11276,12 +12045,12 @@ func (*StarTransactionTypeUserDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeUserDeposit } -// The transaction is a deposit of Telegram Stars from a giveaway; for regular users only +// The transaction is a deposit of Telegram Stars from a giveaway; relevant for regular users only type StarTransactionTypeGiveawayDeposit struct { meta // Identifier of a supergroup or a channel chat that created the giveaway ChatId int64 `json:"chat_id"` - // Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message + // Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` } @@ -11305,7 +12074,7 @@ func (*StarTransactionTypeGiveawayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGiveawayDeposit } -// The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Fragment; relevant for regular users, bots, supergroup and channel chats only type StarTransactionTypeFragmentWithdrawal struct { meta // State of the withdrawal; may be null for refunds from Fragment @@ -11348,7 +12117,7 @@ func (starTransactionTypeFragmentWithdrawal *StarTransactionTypeFragmentWithdraw return nil } -// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; relevant for bots and channel chats only type StarTransactionTypeTelegramAdsWithdrawal struct{ meta } @@ -11373,7 +12142,7 @@ func (*StarTransactionTypeTelegramAdsWithdrawal) StarTransactionTypeType() strin return TypeStarTransactionTypeTelegramAdsWithdrawal } -// The transaction is a payment for Telegram API usage; for bots only +// The transaction is a payment for Telegram API usage; relevant for bots only type StarTransactionTypeTelegramApiUsage struct { meta // The number of billed requests @@ -11400,7 +12169,7 @@ func (*StarTransactionTypeTelegramApiUsage) StarTransactionTypeType() string { return TypeStarTransactionTypeTelegramApiUsage } -// The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only +// 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 @@ -11448,7 +12217,7 @@ func (starTransactionTypeBotPaidMediaPurchase *StarTransactionTypeBotPaidMediaPu return nil } -// The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only +// 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 @@ -11504,12 +12273,12 @@ func (starTransactionTypeBotPaidMediaSale *StarTransactionTypeBotPaidMediaSale) return nil } -// The transaction is a purchase of paid media from a channel by the current user; for regular users only +// The transaction is a purchase of paid media from a channel by the current user; relevant for regular users only type StarTransactionTypeChannelPaidMediaPurchase struct { meta // Identifier of the channel chat that sent the paid media ChatId int64 `json:"chat_id"` - // Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` // The bought media if the transaction wasn't refunded Media []PaidMedia `json:"media"` @@ -11556,12 +12325,12 @@ func (starTransactionTypeChannelPaidMediaPurchase *StarTransactionTypeChannelPai return nil } -// The transaction is a sale of paid media by the channel chat; for channel chats only +// 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 UserId int64 `json:"user_id"` - // Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` // The bought media Media []PaidMedia `json:"media"` @@ -11608,7 +12377,7 @@ func (starTransactionTypeChannelPaidMediaSale *StarTransactionTypeChannelPaidMed return nil } -// The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only +// 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 @@ -11637,7 +12406,7 @@ func (*StarTransactionTypeBotInvoicePurchase) StarTransactionTypeType() string { return TypeStarTransactionTypeBotInvoicePurchase } -// The transaction is a sale of a product by the bot; for bots only +// 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 @@ -11670,7 +12439,7 @@ func (*StarTransactionTypeBotInvoiceSale) StarTransactionTypeType() string { return TypeStarTransactionTypeBotInvoiceSale } -// The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only +// 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 @@ -11701,7 +12470,7 @@ func (*StarTransactionTypeBotSubscriptionPurchase) StarTransactionTypeType() str return TypeStarTransactionTypeBotSubscriptionPurchase } -// The transaction is a sale of a subscription by the bot; for bots only +// 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 @@ -11736,7 +12505,7 @@ func (*StarTransactionTypeBotSubscriptionSale) StarTransactionTypeType() string return TypeStarTransactionTypeBotSubscriptionSale } -// The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only +// The transaction is a purchase of a subscription to a channel chat by the current user; relevant for regular users only type StarTransactionTypeChannelSubscriptionPurchase struct { meta // Identifier of the channel chat that created the subscription @@ -11765,7 +12534,7 @@ func (*StarTransactionTypeChannelSubscriptionPurchase) StarTransactionTypeType() return TypeStarTransactionTypeChannelSubscriptionPurchase } -// The transaction is a sale of a subscription by the channel chat; for channel chats only +// 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 @@ -11794,7 +12563,55 @@ func (*StarTransactionTypeChannelSubscriptionSale) StarTransactionTypeType() str return TypeStarTransactionTypeChannelSubscriptionSale } -// The transaction is a purchase of a regular gift; for regular users and bots only +// 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 + OwnerId MessageSender `json:"owner_id"` + // The gift + Gift *Gift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftAuctionBid) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftAuctionBid + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftAuctionBid) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftAuctionBid) GetType() string { + return TypeStarTransactionTypeGiftAuctionBid +} + +func (*StarTransactionTypeGiftAuctionBid) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftAuctionBid +} + +func (starTransactionTypeGiftAuctionBid *StarTransactionTypeGiftAuctionBid) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Gift *Gift `json:"gift"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypeGiftAuctionBid.Gift = tmp.Gift + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + starTransactionTypeGiftAuctionBid.OwnerId = fieldOwnerId + + return nil +} + +// The transaction is a purchase of a regular gift; relevant for regular users and bots only type StarTransactionTypeGiftPurchase struct { meta // Identifier of the user or the channel that received the gift @@ -11842,7 +12659,34 @@ func (starTransactionTypeGiftPurchase *StarTransactionTypeGiftPurchase) Unmarsha return nil } -// The transaction is a transfer of an upgraded gift; for regular users only +// The transaction is an offer of gift purchase; relevant for regular users only +type StarTransactionTypeGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *StarTransactionTypeGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypeGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypeGiftPurchaseOffer) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypeGiftPurchaseOffer) GetType() string { + return TypeStarTransactionTypeGiftPurchaseOffer +} + +func (*StarTransactionTypeGiftPurchaseOffer) StarTransactionTypeType() string { + return TypeStarTransactionTypeGiftPurchaseOffer +} + +// The transaction is a transfer of an upgraded gift; relevant for regular users only type StarTransactionTypeGiftTransfer struct { meta // Identifier of the user or the channel that received the gift @@ -11890,7 +12734,7 @@ func (starTransactionTypeGiftTransfer *StarTransactionTypeGiftTransfer) Unmarsha return nil } -// The transaction is a drop of original details of an upgraded gift; for regular users only +// The transaction is a drop of original details of an upgraded gift; relevant for regular users only type StarTransactionTypeGiftOriginalDetailsDrop struct { meta // Identifier of the user or the channel that owns the gift @@ -11938,7 +12782,7 @@ func (starTransactionTypeGiftOriginalDetailsDrop *StarTransactionTypeGiftOrigina return nil } -// The transaction is a sale of a received gift; for regular users and channel chats only +// 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 @@ -11967,7 +12811,7 @@ func (*StarTransactionTypeGiftSale) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftSale } -// The transaction is an upgrade of a gift; for regular users only +// 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 @@ -11996,7 +12840,7 @@ func (*StarTransactionTypeGiftUpgrade) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftUpgrade } -// The transaction is a purchase of an upgrade of a gift owned by another user or channel; for regular users only +// The transaction is a purchase of an upgrade of a gift owned by another user or channel; relevant for regular users only type StarTransactionTypeGiftUpgradePurchase struct { meta // Owner of the upgraded gift @@ -12044,7 +12888,7 @@ func (starTransactionTypeGiftUpgradePurchase *StarTransactionTypeGiftUpgradePurc return nil } -// The transaction is a purchase of an upgraded gift for some user or channel; for regular users only +// 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 @@ -12073,7 +12917,7 @@ func (*StarTransactionTypeUpgradedGiftPurchase) StarTransactionTypeType() string return TypeStarTransactionTypeUpgradedGiftPurchase } -// The transaction is a sale of an upgraded gift; for regular users only +// 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 @@ -12084,6 +12928,8 @@ type StarTransactionTypeUpgradedGiftSale struct { CommissionPerMille int32 `json:"commission_per_mille"` // The amount of Telegram Stars that were 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"` } func (entity *StarTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { @@ -12106,12 +12952,12 @@ func (*StarTransactionTypeUpgradedGiftSale) StarTransactionTypeType() string { return TypeStarTransactionTypeUpgradedGiftSale } -// The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only +// The transaction is a sending of a paid reaction to a message in a channel chat by the current user; relevant for regular users only type StarTransactionTypeChannelPaidReactionSend struct { meta // Identifier of the channel chat ChatId int64 `json:"chat_id"` - // Identifier of the reacted message; can be 0 or an identifier of a deleted message + // Identifier of the reacted message; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -12135,12 +12981,12 @@ func (*StarTransactionTypeChannelPaidReactionSend) StarTransactionTypeType() str return TypeStarTransactionTypeChannelPaidReactionSend } -// The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only +// 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 UserId int64 `json:"user_id"` - // Identifier of the reacted message; can be 0 or an identifier of a deleted message + // Identifier of the reacted message; may be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -12164,7 +13010,7 @@ func (*StarTransactionTypeChannelPaidReactionReceive) StarTransactionTypeType() return TypeStarTransactionTypeChannelPaidReactionReceive } -// The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only +// The transaction is a receiving of a commission from an affiliate program; relevant for regular users, bots and channel chats only type StarTransactionTypeAffiliateProgramCommission struct { meta // Identifier of the chat that created the affiliate program @@ -12193,7 +13039,7 @@ func (*StarTransactionTypeAffiliateProgramCommission) StarTransactionTypeType() return TypeStarTransactionTypeAffiliateProgramCommission } -// The transaction is a sending of a paid message; for regular users only +// The transaction is a sending of a paid message; relevant for regular users only type StarTransactionTypePaidMessageSend struct { meta // Identifier of the chat that received the payment @@ -12222,7 +13068,7 @@ func (*StarTransactionTypePaidMessageSend) StarTransactionTypeType() string { return TypeStarTransactionTypePaidMessageSend } -// The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only +// The transaction is a receiving of a paid message; relevant for regular users, supergroup and channel chats only type StarTransactionTypePaidMessageReceive struct { meta // Identifier of the sender of the message @@ -12278,7 +13124,165 @@ func (starTransactionTypePaidMessageReceive *StarTransactionTypePaidMessageRecei return nil } -// The transaction is a payment for a suggested post; for regular users only +// The transaction is a sending of a paid group call message; relevant for regular users only +type StarTransactionTypePaidGroupCallMessageSend struct { + meta + // Identifier of the chat that received the payment + ChatId int64 `json:"chat_id"` +} + +func (entity *StarTransactionTypePaidGroupCallMessageSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallMessageSend + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallMessageSend) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallMessageSend) GetType() string { + return TypeStarTransactionTypePaidGroupCallMessageSend +} + +func (*StarTransactionTypePaidGroupCallMessageSend) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallMessageSend +} + +// The transaction is a receiving of a paid group call message; relevant for regular users and channel chats only +type StarTransactionTypePaidGroupCallMessageReceive struct { + meta + // Identifier of the sender of the message + 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 + CommissionStarAmount *StarAmount `json:"commission_star_amount"` +} + +func (entity *StarTransactionTypePaidGroupCallMessageReceive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallMessageReceive + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) GetType() string { + return TypeStarTransactionTypePaidGroupCallMessageReceive +} + +func (*StarTransactionTypePaidGroupCallMessageReceive) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallMessageReceive +} + +func (starTransactionTypePaidGroupCallMessageReceive *StarTransactionTypePaidGroupCallMessageReceive) UnmarshalJSON(data []byte) error { + var tmp struct { + SenderId json.RawMessage `json:"sender_id"` + CommissionPerMille int32 `json:"commission_per_mille"` + CommissionStarAmount *StarAmount `json:"commission_star_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypePaidGroupCallMessageReceive.CommissionPerMille = tmp.CommissionPerMille + starTransactionTypePaidGroupCallMessageReceive.CommissionStarAmount = tmp.CommissionStarAmount + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + starTransactionTypePaidGroupCallMessageReceive.SenderId = fieldSenderId + + return nil +} + +// The transaction is a sending of a paid group reaction; relevant for regular users only +type StarTransactionTypePaidGroupCallReactionSend struct { + meta + // Identifier of the chat that received the payment + ChatId int64 `json:"chat_id"` +} + +func (entity *StarTransactionTypePaidGroupCallReactionSend) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallReactionSend + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallReactionSend) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallReactionSend) GetType() string { + return TypeStarTransactionTypePaidGroupCallReactionSend +} + +func (*StarTransactionTypePaidGroupCallReactionSend) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallReactionSend +} + +// The transaction is a receiving of a paid group call reaction; relevant for regular users and channel chats only +type StarTransactionTypePaidGroupCallReactionReceive struct { + meta + // Identifier of the sender of the reaction + 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 + CommissionStarAmount *StarAmount `json:"commission_star_amount"` +} + +func (entity *StarTransactionTypePaidGroupCallReactionReceive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionTypePaidGroupCallReactionReceive + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) GetClass() string { + return ClassStarTransactionType +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) GetType() string { + return TypeStarTransactionTypePaidGroupCallReactionReceive +} + +func (*StarTransactionTypePaidGroupCallReactionReceive) StarTransactionTypeType() string { + return TypeStarTransactionTypePaidGroupCallReactionReceive +} + +func (starTransactionTypePaidGroupCallReactionReceive *StarTransactionTypePaidGroupCallReactionReceive) UnmarshalJSON(data []byte) error { + var tmp struct { + SenderId json.RawMessage `json:"sender_id"` + CommissionPerMille int32 `json:"commission_per_mille"` + CommissionStarAmount *StarAmount `json:"commission_star_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starTransactionTypePaidGroupCallReactionReceive.CommissionPerMille = tmp.CommissionPerMille + starTransactionTypePaidGroupCallReactionReceive.CommissionStarAmount = tmp.CommissionStarAmount + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + starTransactionTypePaidGroupCallReactionReceive.SenderId = fieldSenderId + + return nil +} + +// The transaction is a payment for a suggested post; relevant for regular users only type StarTransactionTypeSuggestedPostPaymentSend struct { meta // Identifier of the channel chat that posted the post @@ -12305,7 +13309,7 @@ func (*StarTransactionTypeSuggestedPostPaymentSend) StarTransactionTypeType() st return TypeStarTransactionTypeSuggestedPostPaymentSend } -// The transaction is a receiving of a payment for a suggested post by the channel chat; for channel chats only +// 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 @@ -12332,7 +13336,7 @@ func (*StarTransactionTypeSuggestedPostPaymentReceive) StarTransactionTypeType() return TypeStarTransactionTypeSuggestedPostPaymentReceive } -// The transaction is a purchase of Telegram Premium subscription; for regular users and bots only +// 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 @@ -12363,7 +13367,7 @@ func (*StarTransactionTypePremiumPurchase) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumPurchase } -// The transaction is a transfer of Telegram Stars to a business bot; for regular users only +// The transaction is a transfer of Telegram Stars to a business bot; relevant for regular users only type StarTransactionTypeBusinessBotTransferSend struct { meta // Identifier of the bot that received Telegram Stars @@ -12390,7 +13394,7 @@ func (*StarTransactionTypeBusinessBotTransferSend) StarTransactionTypeType() str return TypeStarTransactionTypeBusinessBotTransferSend } -// The transaction is a transfer of Telegram Stars from a business account; for bots only +// 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 @@ -12417,7 +13421,7 @@ func (*StarTransactionTypeBusinessBotTransferReceive) StarTransactionTypeType() return TypeStarTransactionTypeBusinessBotTransferReceive } -// The transaction is a payment for search of posts in public Telegram channels; for regular users only +// The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only type StarTransactionTypePublicPostSearch struct{ meta } @@ -12579,6 +13583,49 @@ func (*TonTransactionTypeFragmentDeposit) TonTransactionTypeType() string { return TypeTonTransactionTypeFragmentDeposit } +// The transaction is a withdrawal of earned Toncoins to Fragment +type TonTransactionTypeFragmentWithdrawal struct { + meta + // State of the withdrawal; may be null for refunds from Fragment + WithdrawalState RevenueWithdrawalState `json:"withdrawal_state"` +} + +func (entity *TonTransactionTypeFragmentWithdrawal) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeFragmentWithdrawal + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeFragmentWithdrawal) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeFragmentWithdrawal) GetType() string { + return TypeTonTransactionTypeFragmentWithdrawal +} + +func (*TonTransactionTypeFragmentWithdrawal) TonTransactionTypeType() string { + return TypeTonTransactionTypeFragmentWithdrawal +} + +func (tonTransactionTypeFragmentWithdrawal *TonTransactionTypeFragmentWithdrawal) UnmarshalJSON(data []byte) error { + var tmp struct { + WithdrawalState json.RawMessage `json:"withdrawal_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldWithdrawalState, _ := UnmarshalRevenueWithdrawalState(tmp.WithdrawalState) + tonTransactionTypeFragmentWithdrawal.WithdrawalState = fieldWithdrawalState + + return nil +} + // The transaction is a payment for a suggested post type TonTransactionTypeSuggestedPostPayment struct { meta @@ -12606,7 +13653,34 @@ func (*TonTransactionTypeSuggestedPostPayment) TonTransactionTypeType() string { return TypeTonTransactionTypeSuggestedPostPayment } -// The transaction is a purchase of an upgraded gift for some user or channel; for regular users only +// The transaction is an offer of gift purchase +type TonTransactionTypeGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` +} + +func (entity *TonTransactionTypeGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TonTransactionTypeGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*TonTransactionTypeGiftPurchaseOffer) GetClass() string { + return ClassTonTransactionType +} + +func (*TonTransactionTypeGiftPurchaseOffer) GetType() string { + return TypeTonTransactionTypeGiftPurchaseOffer +} + +func (*TonTransactionTypeGiftPurchaseOffer) TonTransactionTypeType() string { + return TypeTonTransactionTypeGiftPurchaseOffer +} + +// 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 @@ -12635,7 +13709,7 @@ func (*TonTransactionTypeUpgradedGiftPurchase) TonTransactionTypeType() string { return TypeTonTransactionTypeUpgradedGiftPurchase } -// The transaction is a sale of an upgraded gift; for regular users only +// The transaction is a sale of an upgraded gift type TonTransactionTypeUpgradedGiftSale struct { meta // Identifier of the user that bought the gift @@ -12646,6 +13720,8 @@ type TonTransactionTypeUpgradedGiftSale struct { CommissionPerMille int32 `json:"commission_per_mille"` // The amount of Toncoins that were 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"` } func (entity *TonTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { @@ -12776,6 +13852,83 @@ func (*TonTransactions) GetType() string { return TypeTonTransactions } +// The chat has an active live story +type ActiveStoryStateLive struct { + meta + // Identifier of the active live story + StoryId int32 `json:"story_id"` +} + +func (entity *ActiveStoryStateLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateLive + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateLive) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateLive) GetType() string { + return TypeActiveStoryStateLive +} + +func (*ActiveStoryStateLive) ActiveStoryStateType() string { + return TypeActiveStoryStateLive +} + +// The chat has some unread active stories +type ActiveStoryStateUnread struct{ + meta +} + +func (entity *ActiveStoryStateUnread) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateUnread + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateUnread) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateUnread) GetType() string { + return TypeActiveStoryStateUnread +} + +func (*ActiveStoryStateUnread) ActiveStoryStateType() string { + return TypeActiveStoryStateUnread +} + +// The chat has active stories, all of which were read +type ActiveStoryStateRead struct{ + meta +} + +func (entity *ActiveStoryStateRead) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ActiveStoryStateRead + + return json.Marshal((*stub)(entity)) +} + +func (*ActiveStoryStateRead) GetClass() string { + return ClassActiveStoryState +} + +func (*ActiveStoryStateRead) GetType() string { + return TypeActiveStoryStateRead +} + +func (*ActiveStoryStateRead) ActiveStoryStateType() string { + return TypeActiveStoryStateRead +} + // The user is eligible for the giveaway type GiveawayParticipantStatusEligible struct{ meta @@ -13360,8 +14513,10 @@ type Usernames struct { ActiveUsernames []string `json:"active_usernames"` // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive DisabledUsernames []string `json:"disabled_usernames"` - // Active or disabled username, which may be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo + // Active or disabled username, which may be changed with setUsername or setSupergroupUsername EditableUsername string `json:"editable_username"` + // Collectible usernames that were purchased at https://fragment.com and can be passed to getCollectibleItemInfo for more details + CollectibleUsernames []string `json:"collectible_usernames"` } func (entity *Usernames) MarshalJSON() ([]byte, error) { @@ -13425,10 +14580,8 @@ type User struct { IsSupport bool `json:"is_support"` // Information about restrictions that must be applied to the corresponding private chat; may be null if none RestrictionInfo *RestrictionInfo `json:"restriction_info"` - // True, if the user has non-expired stories available to the current user - HasActiveStories bool `json:"has_active_stories"` - // True, if the user has unread non-expired stories available to the current user - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // State of active stories of the user; may be null if the user has no active stories + ActiveStoryState ActiveStoryState `json:"active_story_state"` // True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them RestrictsNewChats bool `json:"restricts_new_chats"` // Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay @@ -13482,8 +14635,7 @@ func (user *User) UnmarshalJSON(data []byte) error { IsPremium bool `json:"is_premium"` IsSupport bool `json:"is_support"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + ActiveStoryState json.RawMessage `json:"active_story_state"` RestrictsNewChats bool `json:"restricts_new_chats"` PaidMessageStarCount int64 `json:"paid_message_star_count"` HaveAccess bool `json:"have_access"` @@ -13517,8 +14669,6 @@ func (user *User) UnmarshalJSON(data []byte) error { user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport user.RestrictionInfo = tmp.RestrictionInfo - user.HasActiveStories = tmp.HasActiveStories - user.HasUnreadActiveStories = tmp.HasUnreadActiveStories user.RestrictsNewChats = tmp.RestrictsNewChats user.PaidMessageStarCount = tmp.PaidMessageStarCount user.HaveAccess = tmp.HaveAccess @@ -13528,6 +14678,9 @@ func (user *User) UnmarshalJSON(data []byte) error { fieldStatus, _ := UnmarshalUserStatus(tmp.Status) user.Status = fieldStatus + fieldActiveStoryState, _ := UnmarshalActiveStoryState(tmp.ActiveStoryState) + user.ActiveStoryState = fieldActiveStoryState + fieldType, _ := UnmarshalUserType(tmp.Type) user.Type = fieldType @@ -15164,7 +16317,7 @@ type Supergroup struct { ShowMessageSender bool `json:"show_message_sender"` // True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups JoinToSendMessages bool `json:"join_to_send_messages"` - // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Can be true only for non-broadcast supergroups with username, location, or a linked chat + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. May be true only for non-broadcast supergroups with username, location, or a linked chat JoinByRequest bool `json:"join_by_request"` // True, if the slow mode is enabled in the supergroup IsSlowModeEnabled bool `json:"is_slow_mode_enabled"` @@ -15188,10 +16341,8 @@ type Supergroup struct { RestrictionInfo *RestrictionInfo `json:"restriction_info"` // Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message PaidMessageStarCount int64 `json:"paid_message_star_count"` - // True, if the supergroup or channel has non-expired stories available to the current user - HasActiveStories bool `json:"has_active_stories"` - // True, if the supergroup or channel has unread non-expired stories available to the current user - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + // State of active stories of the supergroup or channel; may be null if there are no active stories + ActiveStoryState ActiveStoryState `json:"active_story_state"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -15237,8 +16388,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { HasForumTabs bool `json:"has_forum_tabs"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` PaidMessageStarCount int64 `json:"paid_message_star_count"` - HasActiveStories bool `json:"has_active_stories"` - HasUnreadActiveStories bool `json:"has_unread_active_stories"` + ActiveStoryState json.RawMessage `json:"active_story_state"` } err := json.Unmarshal(data, &tmp) @@ -15270,12 +16420,13 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.HasForumTabs = tmp.HasForumTabs supergroup.RestrictionInfo = tmp.RestrictionInfo supergroup.PaidMessageStarCount = tmp.PaidMessageStarCount - supergroup.HasActiveStories = tmp.HasActiveStories - supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) supergroup.Status = fieldStatus + fieldActiveStoryState, _ := UnmarshalActiveStoryState(tmp.ActiveStoryState) + supergroup.ActiveStoryState = fieldActiveStoryState + return nil } @@ -15620,7 +16771,7 @@ type PublicPostSearchLimits struct { // Amount of time till the next free query can be sent; 0 if it can be sent now NextFreeQueryIn int32 `json:"next_free_query_in"` // Number of Telegram Stars that must be paid for each non-free query - StarCount JsonInt64 `json:"star_count"` + StarCount int64 `json:"star_count"` // True, if the search for the specified query isn't charged IsCurrentQueryFree bool `json:"is_current_query_free"` } @@ -16317,7 +17468,7 @@ type PaidReactor struct { // Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user SenderId MessageSender `json:"sender_id"` // Number of Telegram Stars added - StarCount int32 `json:"star_count"` + StarCount int64 `json:"star_count"` // True, if the reactor is one of the most active reactors; may be false if the reactor is the current user IsTop bool `json:"is_top"` // True, if the paid reaction was added by the current user @@ -16345,7 +17496,7 @@ func (*PaidReactor) GetType() string { func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { var tmp struct { SenderId json.RawMessage `json:"sender_id"` - StarCount int32 `json:"star_count"` + StarCount int64 `json:"star_count"` IsTop bool `json:"is_top"` IsMe bool `json:"is_me"` IsAnonymous bool `json:"is_anonymous"` @@ -16367,6 +17518,31 @@ func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { return nil } +// Contains a list of users and chats that spend most money on paid messages and reactions in a live story +type LiveStoryDonors struct { + meta + // Total amount of spend Telegram Stars + TotalStarCount int64 `json:"total_star_count"` + // List of top donors in the live story + TopDonors []*PaidReactor `json:"top_donors"` +} + +func (entity *LiveStoryDonors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LiveStoryDonors + + return json.Marshal((*stub)(entity)) +} + +func (*LiveStoryDonors) GetClass() string { + return ClassLiveStoryDonors +} + +func (*LiveStoryDonors) GetType() string { + return TypeLiveStoryDonors +} + // Contains information about a forwarded message type MessageForwardInfo struct { meta @@ -17021,7 +18197,7 @@ type MessageReplyToMessage struct { Origin MessageOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat OriginSendDate int32 `json:"origin_send_date"` - // Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote + // Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote Content MessageContent `json:"content"` } @@ -17272,7 +18448,7 @@ type Message struct { SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info"` // Information about the message or the story this message is replying to; may be null if none ReplyTo MessageReplyTo `json:"reply_to"` - // Identifier of the topic within the chat to which the message belongs; may be null if none + // Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back TopicId MessageTopic `json:"topic_id"` // The message's self-destruct type; may be null if none SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` @@ -17296,6 +18472,8 @@ type Message struct { EffectId JsonInt64 `json:"effect_id"` // Information about the restrictions that must be applied to the message content; may be null if none RestrictionInfo *RestrictionInfo `json:"restriction_info"` + // IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message + SummaryLanguageCode string `json:"summary_language_code"` // Content of the message Content MessageContent `json:"content"` // Reply markup for the message; may be null if none @@ -17355,6 +18533,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { MediaAlbumId JsonInt64 `json:"media_album_id"` EffectId JsonInt64 `json:"effect_id"` RestrictionInfo *RestrictionInfo `json:"restriction_info"` + SummaryLanguageCode string `json:"summary_language_code"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` } @@ -17393,6 +18572,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.MediaAlbumId = tmp.MediaAlbumId message.EffectId = tmp.EffectId message.RestrictionInfo = tmp.RestrictionInfo + message.SummaryLanguageCode = tmp.SummaryLanguageCode fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId @@ -24841,6 +26021,35 @@ func (*LinkPreviewTypeExternalVideo) LinkPreviewTypeType() string { return TypeLinkPreviewTypeExternalVideo } +// The link is a link to a gift auction +type LinkPreviewTypeGiftAuction struct { + meta + // The gift + Gift *Gift `json:"gift"` + // Point in time (Unix timestamp) when the auction will be ended + AuctionEndDate int32 `json:"auction_end_date"` +} + +func (entity *LinkPreviewTypeGiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeGiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeGiftAuction) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeGiftAuction) GetType() string { + return TypeLinkPreviewTypeGiftAuction +} + +func (*LinkPreviewTypeGiftAuction) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeGiftAuction +} + // The link is a link to a gift collection type LinkPreviewTypeGiftCollection struct { meta @@ -24918,6 +26127,35 @@ func (*LinkPreviewTypeInvoice) LinkPreviewTypeType() string { return TypeLinkPreviewTypeInvoice } +// The link is a link to a live story group call +type LinkPreviewTypeLiveStory struct { + meta + // The identifier of the chat that posted the story + StoryPosterChatId int64 `json:"story_poster_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *LinkPreviewTypeLiveStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeLiveStory + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeLiveStory) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeLiveStory) GetType() string { + return TypeLinkPreviewTypeLiveStory +} + +func (*LinkPreviewTypeLiveStory) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeLiveStory +} + // The link is a link to a text or a poll Telegram message type LinkPreviewTypeMessage struct{ meta @@ -29484,7 +30722,7 @@ type MessageDice struct { FinalState DiceStickers `json:"final_state"` // Emoji on which the dice throw animation is based Emoji string `json:"emoji"` - // The dice value. If the value is 0, the dice don't have final state yet + // The dice value. If the value is 0, then the dice don't have final state yet Value int32 `json:"value"` // Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded SuccessAnimationFrameNumber int32 `json:"success_animation_frame_number"` @@ -29591,6 +30829,68 @@ func (*MessagePoll) MessageContentType() string { return TypeMessagePoll } +// A stake dice message. The dice value is randomly generated by the server +type MessageStakeDice struct { + meta + // The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known + InitialState DiceStickers `json:"initial_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 + 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 + 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 + PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` +} + +func (entity *MessageStakeDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStakeDice + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStakeDice) GetClass() string { + return ClassMessageContent +} + +func (*MessageStakeDice) GetType() string { + return TypeMessageStakeDice +} + +func (*MessageStakeDice) MessageContentType() string { + return TypeMessageStakeDice +} + +func (messageStakeDice *MessageStakeDice) UnmarshalJSON(data []byte) error { + var tmp struct { + InitialState json.RawMessage `json:"initial_state"` + FinalState json.RawMessage `json:"final_state"` + Value int32 `json:"value"` + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + PrizeToncoinAmount int64 `json:"prize_toncoin_amount"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageStakeDice.Value = tmp.Value + messageStakeDice.StakeToncoinAmount = tmp.StakeToncoinAmount + messageStakeDice.PrizeToncoinAmount = tmp.PrizeToncoinAmount + + fieldInitialState, _ := UnmarshalDiceStickers(tmp.InitialState) + messageStakeDice.InitialState = fieldInitialState + + fieldFinalState, _ := UnmarshalDiceStickers(tmp.FinalState) + messageStakeDice.FinalState = fieldFinalState + + return nil +} + // A message with a forwarded story type MessageStory struct { meta @@ -30659,7 +31959,7 @@ type MessagePaymentSuccessful struct { meta // Identifier of the chat, containing the corresponding invoice message InvoiceChatId int64 `json:"invoice_chat_id"` - // Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message + // Identifier of the message with the corresponding invoice; may be 0 or an identifier of a deleted message InvoiceMessageId int64 `json:"invoice_message_id"` // Currency for the price of the product Currency string `json:"currency"` @@ -30821,8 +32121,10 @@ type MessageGiftedPremium struct { Cryptocurrency string `json:"cryptocurrency"` // The paid amount, in the smallest units of the cryptocurrency; 0 if none CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` - // Number of months the Telegram Premium subscription will be active + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active + DayCount int32 `json:"day_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` } @@ -30866,8 +32168,10 @@ type MessagePremiumGiftCode struct { Cryptocurrency string `json:"cryptocurrency"` // The paid amount, in the smallest units of the cryptocurrency; 0 if unknown CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` - // Number of months the Telegram Premium subscription will be active after code activation + // Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer MonthCount int32 `json:"month_count"` + // Number of days the Telegram Premium subscription will be active after code activation + DayCount int32 `json:"day_count"` // A sticker to be shown in the message; may be null if unknown Sticker *Sticker `json:"sticker"` // The gift code @@ -30905,6 +32209,7 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) Cryptocurrency string `json:"cryptocurrency"` CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` MonthCount int32 `json:"month_count"` + DayCount int32 `json:"day_count"` Sticker *Sticker `json:"sticker"` Code string `json:"code"` } @@ -30922,6 +32227,7 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) messagePremiumGiftCode.Cryptocurrency = tmp.Cryptocurrency messagePremiumGiftCode.CryptocurrencyAmount = tmp.CryptocurrencyAmount messagePremiumGiftCode.MonthCount = tmp.MonthCount + messagePremiumGiftCode.DayCount = tmp.DayCount messagePremiumGiftCode.Sticker = tmp.Sticker messagePremiumGiftCode.Code = tmp.Code @@ -31017,7 +32323,7 @@ func (messageGiveaway *MessageGiveaway) UnmarshalJSON(data []byte) error { // A giveaway without public winners has been completed for the chat type MessageGiveawayCompleted struct { meta - // Identifier of the message with the giveaway; can be 0 if the message was deleted + // Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` // Number of winners in the giveaway WinnerCount int32 `json:"winner_count"` @@ -31218,7 +32524,7 @@ type MessageGiveawayPrizeStars struct { TransactionId string `json:"transaction_id"` // Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway BoostedChatId int64 `json:"boosted_chat_id"` - // Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted + // Identifier of the message with the giveaway in the boosted chat; may be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` // True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat IsUnclaimed bool `json:"is_unclaimed"` @@ -31259,12 +32565,16 @@ type MessageGift struct { ReceivedGiftId string `json:"received_gift_id"` // Message added to the gift Text *FormattedText `json:"text"` + // Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned + UniqueGiftNumber int32 `json:"unique_gift_number"` // Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver SellStarCount int64 `json:"sell_star_count"` // Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` // True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost IsUpgradeSeparate bool `json:"is_upgrade_separate"` + // True, if the message is a notification about a gift won on an auction + IsFromAuction bool `json:"is_from_auction"` // True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them IsPrivate bool `json:"is_private"` // True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift @@ -31312,9 +32622,11 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { ReceiverId json.RawMessage `json:"receiver_id"` ReceivedGiftId string `json:"received_gift_id"` Text *FormattedText `json:"text"` + UniqueGiftNumber int32 `json:"unique_gift_number"` SellStarCount int64 `json:"sell_star_count"` PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` IsUpgradeSeparate bool `json:"is_upgrade_separate"` + IsFromAuction bool `json:"is_from_auction"` IsPrivate bool `json:"is_private"` IsSaved bool `json:"is_saved"` IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` @@ -31334,9 +32646,11 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { messageGift.Gift = tmp.Gift messageGift.ReceivedGiftId = tmp.ReceivedGiftId messageGift.Text = tmp.Text + messageGift.UniqueGiftNumber = tmp.UniqueGiftNumber messageGift.SellStarCount = tmp.SellStarCount messageGift.PrepaidUpgradeStarCount = tmp.PrepaidUpgradeStarCount messageGift.IsUpgradeSeparate = tmp.IsUpgradeSeparate + messageGift.IsFromAuction = tmp.IsFromAuction messageGift.IsPrivate = tmp.IsPrivate messageGift.IsSaved = tmp.IsSaved messageGift.IsPrepaidUpgrade = tmp.IsPrepaidUpgrade @@ -31512,6 +32826,120 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da return nil } +// An offer to purchase an upgraded gift was sent or received +type MessageUpgradedGiftPurchaseOffer struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` + // State of the offer + State GiftPurchaseOfferState `json:"state"` + // The proposed price + Price GiftResalePrice `json:"price"` + // Point in time (Unix timestamp) when the offer will expire or has expired + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *MessageUpgradedGiftPurchaseOffer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUpgradedGiftPurchaseOffer + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUpgradedGiftPurchaseOffer) GetClass() string { + return ClassMessageContent +} + +func (*MessageUpgradedGiftPurchaseOffer) GetType() string { + return TypeMessageUpgradedGiftPurchaseOffer +} + +func (*MessageUpgradedGiftPurchaseOffer) MessageContentType() string { + return TypeMessageUpgradedGiftPurchaseOffer +} + +func (messageUpgradedGiftPurchaseOffer *MessageUpgradedGiftPurchaseOffer) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *UpgradedGift `json:"gift"` + State json.RawMessage `json:"state"` + Price json.RawMessage `json:"price"` + ExpirationDate int32 `json:"expiration_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageUpgradedGiftPurchaseOffer.Gift = tmp.Gift + messageUpgradedGiftPurchaseOffer.ExpirationDate = tmp.ExpirationDate + + fieldState, _ := UnmarshalGiftPurchaseOfferState(tmp.State) + messageUpgradedGiftPurchaseOffer.State = fieldState + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + messageUpgradedGiftPurchaseOffer.Price = fieldPrice + + return nil +} + +// An offer to purchase a gift was rejected or expired +type MessageUpgradedGiftPurchaseOfferRejected struct { + meta + // The gift + Gift *UpgradedGift `json:"gift"` + // The proposed price + Price GiftResalePrice `json:"price"` + // Identifier of the message with purchase offer which was rejected or expired; may be 0 or an identifier of a deleted message + OfferMessageId int64 `json:"offer_message_id"` + // True, if the offer has expired; otherwise, the offer was explicitly rejected + WasExpired bool `json:"was_expired"` +} + +func (entity *MessageUpgradedGiftPurchaseOfferRejected) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageUpgradedGiftPurchaseOfferRejected + + return json.Marshal((*stub)(entity)) +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) GetClass() string { + return ClassMessageContent +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) GetType() string { + return TypeMessageUpgradedGiftPurchaseOfferRejected +} + +func (*MessageUpgradedGiftPurchaseOfferRejected) MessageContentType() string { + return TypeMessageUpgradedGiftPurchaseOfferRejected +} + +func (messageUpgradedGiftPurchaseOfferRejected *MessageUpgradedGiftPurchaseOfferRejected) UnmarshalJSON(data []byte) error { + var tmp struct { + Gift *UpgradedGift `json:"gift"` + Price json.RawMessage `json:"price"` + OfferMessageId int64 `json:"offer_message_id"` + WasExpired bool `json:"was_expired"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageUpgradedGiftPurchaseOfferRejected.Gift = tmp.Gift + messageUpgradedGiftPurchaseOfferRejected.OfferMessageId = tmp.OfferMessageId + messageUpgradedGiftPurchaseOfferRejected.WasExpired = tmp.WasExpired + + fieldPrice, _ := UnmarshalGiftResalePrice(tmp.Price) + messageUpgradedGiftPurchaseOfferRejected.Price = fieldPrice + + return nil +} + // Paid messages were refunded type MessagePaidMessagesRefunded struct { meta @@ -31600,7 +33028,7 @@ func (*MessageDirectMessagePriceChanged) MessageContentType() string { // Some tasks from a checklist were marked as done or not done type MessageChecklistTasksDone struct { meta - // Identifier of the message with the checklist; can be 0 if the message was deleted + // Identifier of the message with the checklist; may be 0 or an identifier of a deleted message ChecklistMessageId int64 `json:"checklist_message_id"` // Identifiers of tasks that were marked as done MarkedAsDoneTaskIds []int32 `json:"marked_as_done_task_ids"` @@ -31631,7 +33059,7 @@ func (*MessageChecklistTasksDone) MessageContentType() string { // Some tasks were added to a checklist type MessageChecklistTasksAdded struct { meta - // Identifier of the message with the checklist; can be 0 if the message was deleted + // Identifier of the message with the checklist; may be 0 or an identifier of a deleted message ChecklistMessageId int64 `json:"checklist_message_id"` // List of tasks added to the checklist Tasks []*ChecklistTask `json:"tasks"` @@ -31660,7 +33088,7 @@ func (*MessageChecklistTasksAdded) MessageContentType() string { // Approval of suggested post has failed, because the user which proposed the post had no enough funds type MessageSuggestedPostApprovalFailed struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Price of the suggested post Price SuggestedPostPrice `json:"price"` @@ -31708,7 +33136,7 @@ func (messageSuggestedPostApprovalFailed *MessageSuggestedPostApprovalFailed) Un // A suggested post was approved type MessageSuggestedPostApproved struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Price of the suggested post; may be null if the post is non-paid Price SuggestedPostPrice `json:"price"` @@ -31760,7 +33188,7 @@ func (messageSuggestedPostApproved *MessageSuggestedPostApproved) UnmarshalJSON( // A suggested post was declined type MessageSuggestedPostDeclined struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Comment added by administrator of the channel when the post was declined Comment string `json:"comment"` @@ -31789,7 +33217,7 @@ func (*MessageSuggestedPostDeclined) MessageContentType() string { // A suggested post was published for getOption("suggested_post_lifetime_min") seconds and payment for the post was received type MessageSuggestedPostPaid struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // The amount of received Telegram Stars StarAmount *StarAmount `json:"star_amount"` @@ -31820,7 +33248,7 @@ func (*MessageSuggestedPostPaid) MessageContentType() string { // A suggested post was refunded type MessageSuggestedPostRefunded struct { meta - // Identifier of the message with the suggested post; can be 0 if the message was deleted + // Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message SuggestedPostMessageId int64 `json:"suggested_post_message_id"` // Reason of the refund Reason SuggestedPostRefundReason `json:"reason"` @@ -32954,6 +34382,8 @@ type MessageSchedulingStateSendAtDate struct { meta // Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future SendDate int32 `json:"send_date"` + // Period after which the message will be sent again; in seconds; 0 if never; for Telegram Premium users only; may be non-zero only in sendMessage and forwardMessages with one message requests; must be one of 0, 86400, 7 * 86400, 14 * 86400, 30 * 86400, 91 * 86400, 182 * 86400, 365 * 86400, or additionally 60, or 300 in the Test DC + RepeatPeriod int32 `json:"repeat_period"` } func (entity *MessageSchedulingStateSendAtDate) MarshalJSON() ([]byte, error) { @@ -33099,7 +34529,7 @@ type MessageSendOptions struct { UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, live location messages and self-destructing messages can't be scheduled SchedulingState MessageSchedulingState `json:"scheduling_state"` - // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats + // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage, sendMessageAlbum in private chats and forwardMessages with one message to private chats EffectId JsonInt64 `json:"effect_id"` // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates SendingId int32 `json:"sending_id"` @@ -33196,7 +34626,7 @@ type InputMessageText struct { Text *FormattedText `json:"text"` // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` - // True, if a chat message draft must be deleted + // True, if the chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -34073,6 +35503,37 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { return nil } +// A stake dice message +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") + StakeToncoinAmount int64 `json:"stake_toncoin_amount"` + // True, if the chat message draft must be deleted + ClearDraft bool `json:"clear_draft"` +} + +func (entity *InputMessageStakeDice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageStakeDice + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageStakeDice) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageStakeDice) GetType() string { + return TypeInputMessageStakeDice +} + +func (*InputMessageStakeDice) InputMessageContentType() string { + return TypeInputMessageStakeDice +} + // A message with a forwarded story. Stories can't be forwarded to secret chats. A story can be forwarded only if story.can_be_forwarded type InputMessageStory struct { meta @@ -36614,6 +38075,35 @@ func (*StoryContentVideo) StoryContentType() string { return TypeStoryContentVideo } +// A live story +type StoryContentLive struct { + meta + // Identifier of the corresponding group call. The group call can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` + // True, if the call is an RTMP stream instead of an ordinary group call + IsRtmpStream bool `json:"is_rtmp_stream"` +} + +func (entity *StoryContentLive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentLive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentLive) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentLive) GetType() string { + return TypeStoryContentLive +} + +func (*StoryContentLive) StoryContentType() string { + return TypeStoryContentLive +} + // A story content that is not supported in the current TDLib version type StoryContentUnsupported struct{ meta @@ -36947,7 +38437,7 @@ type Story struct { IsPostedToChatPage bool `json:"is_posted_to_chat_page"` // True, if the story is visible only for the current user IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` - // True, if the story can be added to an album + // True, if the story can be added to an album using createStoryAlbum and addStoryAlbumStories CanBeAddedToAlbum bool `json:"can_be_added_to_album"` // True, if the story can be deleted CanBeDeleted bool `json:"can_be_deleted"` @@ -36957,6 +38447,8 @@ type Story struct { CanBeForwarded bool `json:"can_be_forwarded"` // True, if the story can be replied in the chat with the user that 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"` // True, if the story's is_posted_to_chat_page value can be changed CanToggleIsPostedToChatPage bool `json:"can_toggle_is_posted_to_chat_page"` // True, if the story statistics are available through getStoryStatistics @@ -37015,6 +38507,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` CanBeReplied bool `json:"can_be_replied"` + CanSetPrivacySettings bool `json:"can_set_privacy_settings"` CanToggleIsPostedToChatPage bool `json:"can_toggle_is_posted_to_chat_page"` CanGetStatistics bool `json:"can_get_statistics"` CanGetInteractions bool `json:"can_get_interactions"` @@ -37047,6 +38540,7 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.CanBeEdited = tmp.CanBeEdited story.CanBeForwarded = tmp.CanBeForwarded story.CanBeReplied = tmp.CanBeReplied + story.CanSetPrivacySettings = tmp.CanSetPrivacySettings story.CanToggleIsPostedToChatPage = tmp.CanToggleIsPostedToChatPage story.CanGetStatistics = tmp.CanGetStatistics story.CanGetInteractions = tmp.CanGetInteractions @@ -37212,6 +38706,8 @@ type StoryInfo struct { Date int32 `json:"date"` // True, if the story is available only to close friends IsForCloseFriends bool `json:"is_for_close_friends"` + // True, if the story is a live story + IsLive bool `json:"is_live"` } func (entity *StoryInfo) MarshalJSON() ([]byte, error) { @@ -37705,7 +39201,7 @@ type BotMediaPreview struct { meta // Point in time (Unix timestamp) when the preview was added or changed last time Date int32 `json:"date"` - // Content of the preview + // Content of the preview; may only be of the types storyContentPhoto, storyContentVideo, or storyContentUnsupported Content StoryContent `json:"content"` } @@ -38915,8 +40411,8 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } -// Describes an available stream in a video chat -type VideoChatStream struct { +// Describes an available stream in a video chat or a live story +type GroupCallStream struct { meta // Identifier of an audio/video channel ChannelId int32 `json:"channel_id"` @@ -38926,43 +40422,43 @@ type VideoChatStream struct { TimeOffset int64 `json:"time_offset"` } -func (entity *VideoChatStream) MarshalJSON() ([]byte, error) { +func (entity *GroupCallStream) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub VideoChatStream + type stub GroupCallStream return json.Marshal((*stub)(entity)) } -func (*VideoChatStream) GetClass() string { - return ClassVideoChatStream +func (*GroupCallStream) GetClass() string { + return ClassGroupCallStream } -func (*VideoChatStream) GetType() string { - return TypeVideoChatStream +func (*GroupCallStream) GetType() string { + return TypeGroupCallStream } -// Represents a list of video chat streams -type VideoChatStreams struct { +// Represents a list of group call streams +type GroupCallStreams struct { meta - // A list of video chat streams - Streams []*VideoChatStream `json:"streams"` + // A list of group call streams + Streams []*GroupCallStream `json:"streams"` } -func (entity *VideoChatStreams) MarshalJSON() ([]byte, error) { +func (entity *GroupCallStreams) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub VideoChatStreams + type stub GroupCallStreams return json.Marshal((*stub)(entity)) } -func (*VideoChatStreams) GetClass() string { - return ClassVideoChatStreams +func (*GroupCallStreams) GetClass() string { + return ClassGroupCallStreams } -func (*VideoChatStreams) GetType() string { - return TypeVideoChatStreams +func (*GroupCallStreams) GetType() string { + return TypeGroupCallStreams } // Represents an RTMP URL @@ -39041,8 +40537,10 @@ type GroupCall struct { Id int32 `json:"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 + // 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 InviteLink string `json:"invite_link"` + // The minimum number of Telegram Stars that must be paid by general participant for each sent message to the call; for live stories only + PaidMessageStarCount int64 `json:"paid_message_star_count"` // Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended; for video chats only ScheduledStartDate int32 `json:"scheduled_start_date"` // True, if the group call is scheduled and the current user will receive a notification when the group call starts; for video chats only @@ -39051,7 +40549,9 @@ type GroupCall struct { IsActive bool `json:"is_active"` // True, if the call is bound to a chat IsVideoChat bool `json:"is_video_chat"` - // True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only + // True, if the call is a live story of a chat + IsLiveStory bool `json:"is_live_story"` + // True, if the call is an RTMP stream instead of an ordinary video chat; for video chats and live stories only IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` @@ -39059,7 +40559,7 @@ type GroupCall struct { NeedRejoin bool `json:"need_rejoin"` // True, if the user is the owner of the call and can end the call, change volume level of other users, or ban users there; for group calls that aren't bound to a chat IsOwned bool `json:"is_owned"` - // True, if the current user can manage the group call; for video chats only + // True, if the current user can manage the group call; for video chats and live stories only CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` @@ -39067,6 +40567,8 @@ type GroupCall struct { HasHiddenListeners bool `json:"has_hidden_listeners"` // True, if all group call participants are loaded LoadedAllParticipants bool `json:"loaded_all_participants"` + // Message sender chosen to send messages to the group call; for live stories only; may be null if the call isn't a live story + MessageSenderId MessageSender `json:"message_sender_id"` // At most 3 recently speaking users in the group call RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` // True, if the current user's video is enabled @@ -39079,10 +40581,14 @@ type GroupCall struct { MuteNewParticipants bool `json:"mute_new_participants"` // True, if the current user can enable or disable mute_new_participants setting; for video chats only CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` - // True, if users can send messages to the group call + // True, if the current user can send messages to the group call CanSendMessages bool `json:"can_send_messages"` - // True, if the current user can enable or disable sending messages in the group call - CanToggleCanSendMessages bool `json:"can_toggle_can_send_messages"` + // True, if sending of messages is allowed in the group call + AreMessagesAllowed bool `json:"are_messages_allowed"` + // True, if the current user can enable or disable sending of messages in the group call + CanToggleAreMessagesAllowed bool `json:"can_toggle_are_messages_allowed"` + // True, if the user can delete messages in the group call + CanDeleteMessages bool `json:"can_delete_messages"` // 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 RecordDuration int32 `json:"record_duration"` // True, if a video file is being recorded for the call @@ -39107,6 +40613,83 @@ func (*GroupCall) GetType() string { return TypeGroupCall } +func (groupCall *GroupCall) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Title string `json:"title"` + InviteLink string `json:"invite_link"` + PaidMessageStarCount int64 `json:"paid_message_star_count"` + ScheduledStartDate int32 `json:"scheduled_start_date"` + EnabledStartNotification bool `json:"enabled_start_notification"` + IsActive bool `json:"is_active"` + IsVideoChat bool `json:"is_video_chat"` + IsLiveStory bool `json:"is_live_story"` + IsRtmpStream bool `json:"is_rtmp_stream"` + IsJoined bool `json:"is_joined"` + NeedRejoin bool `json:"need_rejoin"` + IsOwned bool `json:"is_owned"` + CanBeManaged bool `json:"can_be_managed"` + ParticipantCount int32 `json:"participant_count"` + HasHiddenListeners bool `json:"has_hidden_listeners"` + LoadedAllParticipants bool `json:"loaded_all_participants"` + MessageSenderId json.RawMessage `json:"message_sender_id"` + RecentSpeakers []*GroupCallRecentSpeaker `json:"recent_speakers"` + IsMyVideoEnabled bool `json:"is_my_video_enabled"` + IsMyVideoPaused bool `json:"is_my_video_paused"` + CanEnableVideo bool `json:"can_enable_video"` + MuteNewParticipants bool `json:"mute_new_participants"` + CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` + CanSendMessages bool `json:"can_send_messages"` + AreMessagesAllowed bool `json:"are_messages_allowed"` + CanToggleAreMessagesAllowed bool `json:"can_toggle_are_messages_allowed"` + CanDeleteMessages bool `json:"can_delete_messages"` + RecordDuration int32 `json:"record_duration"` + IsVideoRecorded bool `json:"is_video_recorded"` + Duration int32 `json:"duration"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCall.Id = tmp.Id + groupCall.Title = tmp.Title + groupCall.InviteLink = tmp.InviteLink + groupCall.PaidMessageStarCount = tmp.PaidMessageStarCount + groupCall.ScheduledStartDate = tmp.ScheduledStartDate + groupCall.EnabledStartNotification = tmp.EnabledStartNotification + groupCall.IsActive = tmp.IsActive + groupCall.IsVideoChat = tmp.IsVideoChat + groupCall.IsLiveStory = tmp.IsLiveStory + groupCall.IsRtmpStream = tmp.IsRtmpStream + groupCall.IsJoined = tmp.IsJoined + groupCall.NeedRejoin = tmp.NeedRejoin + groupCall.IsOwned = tmp.IsOwned + groupCall.CanBeManaged = tmp.CanBeManaged + groupCall.ParticipantCount = tmp.ParticipantCount + groupCall.HasHiddenListeners = tmp.HasHiddenListeners + groupCall.LoadedAllParticipants = tmp.LoadedAllParticipants + groupCall.RecentSpeakers = tmp.RecentSpeakers + groupCall.IsMyVideoEnabled = tmp.IsMyVideoEnabled + groupCall.IsMyVideoPaused = tmp.IsMyVideoPaused + groupCall.CanEnableVideo = tmp.CanEnableVideo + groupCall.MuteNewParticipants = tmp.MuteNewParticipants + groupCall.CanToggleMuteNewParticipants = tmp.CanToggleMuteNewParticipants + groupCall.CanSendMessages = tmp.CanSendMessages + groupCall.AreMessagesAllowed = tmp.AreMessagesAllowed + groupCall.CanToggleAreMessagesAllowed = tmp.CanToggleAreMessagesAllowed + groupCall.CanDeleteMessages = tmp.CanDeleteMessages + groupCall.RecordDuration = tmp.RecordDuration + groupCall.IsVideoRecorded = tmp.IsVideoRecorded + groupCall.Duration = tmp.Duration + + fieldMessageSenderId, _ := UnmarshalMessageSender(tmp.MessageSenderId) + groupCall.MessageSenderId = fieldMessageSenderId + + return nil +} + // Describes a group of video synchronization source identifiers type GroupCallVideoSourceGroup struct { meta @@ -39336,6 +40919,105 @@ func (*GroupCallInfo) GetType() string { return TypeGroupCallInfo } +// Represents a message sent in a group call +type GroupCallMessage struct { + meta + // Unique message identifier within the group call + MessageId int32 `json:"message_id"` + // Identifier of the sender of the message + SenderId MessageSender `json:"sender_id"` + // Point in time (Unix timestamp) when the message was sent + Date int32 `json:"date"` + // Text of the message. If empty, then the message is a paid reaction in a live story + Text *FormattedText `json:"text"` + // The number of Telegram Stars that were paid to send the message; for live stories only + PaidMessageStarCount int64 `json:"paid_message_star_count"` + // True, if the message is sent by the owner of the call and must be treated as a message of the maximum level; for live stories only + IsFromOwner bool `json:"is_from_owner"` + // True, if the message can be deleted by the current user; for live stories only + CanBeDeleted bool `json:"can_be_deleted"` +} + +func (entity *GroupCallMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallMessage + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallMessage) GetClass() string { + return ClassGroupCallMessage +} + +func (*GroupCallMessage) GetType() string { + return TypeGroupCallMessage +} + +func (groupCallMessage *GroupCallMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + MessageId int32 `json:"message_id"` + SenderId json.RawMessage `json:"sender_id"` + Date int32 `json:"date"` + Text *FormattedText `json:"text"` + PaidMessageStarCount int64 `json:"paid_message_star_count"` + IsFromOwner bool `json:"is_from_owner"` + CanBeDeleted bool `json:"can_be_deleted"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + groupCallMessage.MessageId = tmp.MessageId + groupCallMessage.Date = tmp.Date + groupCallMessage.Text = tmp.Text + groupCallMessage.PaidMessageStarCount = tmp.PaidMessageStarCount + groupCallMessage.IsFromOwner = tmp.IsFromOwner + groupCallMessage.CanBeDeleted = tmp.CanBeDeleted + + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + groupCallMessage.SenderId = fieldSenderId + + return nil +} + +// Represents a level of features for a message sent in a live story group call +type GroupCallMessageLevel struct { + meta + // The minimum number of Telegram Stars required to get features of the level + MinStarCount int64 `json:"min_star_count"` + // The amount of time the message of this level will be pinned, in seconds + PinDuration int32 `json:"pin_duration"` + // The maximum allowed length of the message text + MaxTextLength int32 `json:"max_text_length"` + // The maximum allowed number of custom emoji in the message text + MaxCustomEmojiCount int32 `json:"max_custom_emoji_count"` + // The first color used to show the message text in the RGB format + FirstColor int32 `json:"first_color"` + // The second color used to show the message text in the RGB format + SecondColor int32 `json:"second_color"` + // Background color for the message the RGB format + BackgroundColor int32 `json:"background_color"` +} + +func (entity *GroupCallMessageLevel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub GroupCallMessageLevel + + return json.Marshal((*stub)(entity)) +} + +func (*GroupCallMessageLevel) GetClass() string { + return ClassGroupCallMessageLevel +} + +func (*GroupCallMessageLevel) GetType() string { + return TypeGroupCallMessageLevel +} + // The user can't be invited due to their privacy settings type InviteGroupCallParticipantResultUserPrivacyRestricted struct{ meta @@ -45608,6 +47290,31 @@ func (*PremiumFeatureChecklists) PremiumFeatureType() string { return TypePremiumFeatureChecklists } +// The ability to require a payment for incoming messages in new chats +type PremiumFeaturePaidMessages struct{ + meta +} + +func (entity *PremiumFeaturePaidMessages) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeaturePaidMessages + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeaturePaidMessages) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeaturePaidMessages) GetType() string { + return TypePremiumFeaturePaidMessages +} + +func (*PremiumFeaturePaidMessages) PremiumFeatureType() string { + return TypePremiumFeaturePaidMessages +} + // The ability to set location type BusinessFeatureLocation struct{ meta @@ -48172,6 +49879,103 @@ func (*CanPostStoryResultMonthlyLimitExceeded) CanPostStoryResultType() string { return TypeCanPostStoryResultMonthlyLimitExceeded } +// The user or the chat has an active live story. The live story must be deleted first +type CanPostStoryResultLiveStoryIsActive struct { + meta + // Identifier of the active live story + StoryId int32 `json:"story_id"` +} + +func (entity *CanPostStoryResultLiveStoryIsActive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanPostStoryResultLiveStoryIsActive + + return json.Marshal((*stub)(entity)) +} + +func (*CanPostStoryResultLiveStoryIsActive) GetClass() string { + return ClassCanPostStoryResult +} + +func (*CanPostStoryResultLiveStoryIsActive) GetType() string { + return TypeCanPostStoryResultLiveStoryIsActive +} + +func (*CanPostStoryResultLiveStoryIsActive) CanPostStoryResultType() string { + return TypeCanPostStoryResultLiveStoryIsActive +} + +// The live story was successfully posted +type StartLiveStoryResultOk struct { + meta + // The live story + Story *Story `json:"story"` +} + +func (entity *StartLiveStoryResultOk) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StartLiveStoryResultOk + + return json.Marshal((*stub)(entity)) +} + +func (*StartLiveStoryResultOk) GetClass() string { + return ClassStartLiveStoryResult +} + +func (*StartLiveStoryResultOk) GetType() string { + return TypeStartLiveStoryResultOk +} + +func (*StartLiveStoryResultOk) StartLiveStoryResultType() string { + return TypeStartLiveStoryResultOk +} + +// The live story failed to post with an error to be handled +type StartLiveStoryResultFail struct { + meta + // Type of the error; other error types may be returned as regular errors + ErrorType CanPostStoryResult `json:"error_type"` +} + +func (entity *StartLiveStoryResultFail) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StartLiveStoryResultFail + + return json.Marshal((*stub)(entity)) +} + +func (*StartLiveStoryResultFail) GetClass() string { + return ClassStartLiveStoryResult +} + +func (*StartLiveStoryResultFail) GetType() string { + return TypeStartLiveStoryResultFail +} + +func (*StartLiveStoryResultFail) StartLiveStoryResultType() string { + return TypeStartLiveStoryResultFail +} + +func (startLiveStoryResultFail *StartLiveStoryResultFail) UnmarshalJSON(data []byte) error { + var tmp struct { + ErrorType json.RawMessage `json:"error_type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldErrorType, _ := UnmarshalCanPostStoryResult(tmp.ErrorType) + startLiveStoryResultFail.ErrorType = fieldErrorType + + return nil +} + // The session can be used type CanTransferOwnershipResultOk struct{ meta @@ -51264,6 +53068,31 @@ func (*UserPrivacySettingShowBirthdate) UserPrivacySettingType() string { return TypeUserPrivacySettingShowBirthdate } +// A privacy setting for managing whether the user's profile audio files are visible +type UserPrivacySettingShowProfileAudio struct{ + meta +} + +func (entity *UserPrivacySettingShowProfileAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowProfileAudio + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowProfileAudio) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowProfileAudio) GetType() string { + return TypeUserPrivacySettingShowProfileAudio +} + +func (*UserPrivacySettingShowProfileAudio) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowProfileAudio +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct{ meta @@ -53269,6 +55098,33 @@ func (*InternalLinkTypeGame) InternalLinkTypeType() string { return TypeInternalLinkTypeGame } +// The link is a link to a gift auction. Call getGiftAuctionState with the given auction identifier to process the link +type InternalLinkTypeGiftAuction struct { + meta + // Unique identifier of the auction + AuctionId string `json:"auction_id"` +} + +func (entity *InternalLinkTypeGiftAuction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeGiftAuction + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeGiftAuction) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeGiftAuction) GetType() string { + return TypeInternalLinkTypeGiftAuction +} + +func (*InternalLinkTypeGiftAuction) InternalLinkTypeType() string { + return TypeInternalLinkTypeGiftAuction +} + // The link is a link to a gift collection. Call searchPublicChat with the given username, then call getReceivedGifts with the received gift owner identifier and the given collection identifier, then show the collection if received type InternalLinkTypeGiftCollection struct { meta @@ -53433,6 +55289,58 @@ 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 + // Username of the poster of the story + StoryPosterUsername string `json:"story_poster_username"` +} + +func (entity *InternalLinkTypeLiveStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeLiveStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeLiveStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeLiveStory) GetType() string { + return TypeInternalLinkTypeLiveStory +} + +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 @@ -53626,6 +55534,31 @@ 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 @@ -53655,6 +55588,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 { meta @@ -56696,6 +58654,58 @@ func (*SuggestedActionCustom) SuggestedActionType() string { return TypeSuggestedActionCustom } +// Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address +type SuggestedActionSetLoginEmailAddress struct { + meta + // True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the app without setting up the email address + CanBeHidden bool `json:"can_be_hidden"` +} + +func (entity *SuggestedActionSetLoginEmailAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionSetLoginEmailAddress + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionSetLoginEmailAddress) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionSetLoginEmailAddress) GetType() string { + return TypeSuggestedActionSetLoginEmailAddress +} + +func (*SuggestedActionSetLoginEmailAddress) SuggestedActionType() string { + return TypeSuggestedActionSetLoginEmailAddress +} + +// Suggests the user to add a passkey for login using addLoginPasskey +type SuggestedActionAddLoginPasskey struct{ + meta +} + +func (entity *SuggestedActionAddLoginPasskey) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionAddLoginPasskey + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionAddLoginPasskey) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionAddLoginPasskey) GetType() string { + return TypeSuggestedActionAddLoginPasskey +} + +func (*SuggestedActionAddLoginPasskey) SuggestedActionType() string { + return TypeSuggestedActionAddLoginPasskey +} + // Contains a counter type Count struct { meta @@ -60706,6 +62716,8 @@ type UpdateForumTopic struct { UnreadReactionCount int32 `json:"unread_reaction_count"` // Notification settings for the topic NotificationSettings *ChatNotificationSettings `json:"notification_settings"` + // A draft of a message in the topic; may be null if none + DraftMessage *DraftMessage `json:"draft_message"` } func (entity *UpdateForumTopic) MarshalJSON() ([]byte, error) { @@ -61791,42 +63803,71 @@ func (*UpdateGroupCallVerificationState) UpdateType() string { return TypeUpdateGroupCallVerificationState } -// A new message was received in a group call. It must be shown for at most getOption("group_call_message_show_time_max") seconds after receiving -type UpdateGroupCallNewMessage struct { +// A new message was received in a group call +type UpdateNewGroupCallMessage struct { meta // Identifier of the group call GroupCallId int32 `json:"group_call_id"` - // Identifier of the sender of the message - SenderId MessageSender `json:"sender_id"` - // Text of the message - Text *FormattedText `json:"text"` + // The message + Message *GroupCallMessage `json:"message"` } -func (entity *UpdateGroupCallNewMessage) MarshalJSON() ([]byte, error) { +func (entity *UpdateNewGroupCallMessage) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateGroupCallNewMessage + type stub UpdateNewGroupCallMessage return json.Marshal((*stub)(entity)) } -func (*UpdateGroupCallNewMessage) GetClass() string { +func (*UpdateNewGroupCallMessage) GetClass() string { return ClassUpdate } -func (*UpdateGroupCallNewMessage) GetType() string { - return TypeUpdateGroupCallNewMessage +func (*UpdateNewGroupCallMessage) GetType() string { + return TypeUpdateNewGroupCallMessage } -func (*UpdateGroupCallNewMessage) UpdateType() string { - return TypeUpdateGroupCallNewMessage +func (*UpdateNewGroupCallMessage) UpdateType() string { + return TypeUpdateNewGroupCallMessage } -func (updateGroupCallNewMessage *UpdateGroupCallNewMessage) UnmarshalJSON(data []byte) error { +// A new paid reaction was received in a live story group call +type UpdateNewGroupCallPaidReaction struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Identifier of the sender of the reaction + SenderId MessageSender `json:"sender_id"` + // The number of Telegram Stars that were paid to send the reaction + StarCount int64 `json:"star_count"` +} + +func (entity *UpdateNewGroupCallPaidReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewGroupCallPaidReaction + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewGroupCallPaidReaction) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewGroupCallPaidReaction) GetType() string { + return TypeUpdateNewGroupCallPaidReaction +} + +func (*UpdateNewGroupCallPaidReaction) UpdateType() string { + return TypeUpdateNewGroupCallPaidReaction +} + +func (updateNewGroupCallPaidReaction *UpdateNewGroupCallPaidReaction) UnmarshalJSON(data []byte) error { var tmp struct { GroupCallId int32 `json:"group_call_id"` SenderId json.RawMessage `json:"sender_id"` - Text *FormattedText `json:"text"` + StarCount int64 `json:"star_count"` } err := json.Unmarshal(data, &tmp) @@ -61834,15 +63875,104 @@ func (updateGroupCallNewMessage *UpdateGroupCallNewMessage) UnmarshalJSON(data [ return err } - updateGroupCallNewMessage.GroupCallId = tmp.GroupCallId - updateGroupCallNewMessage.Text = tmp.Text + updateNewGroupCallPaidReaction.GroupCallId = tmp.GroupCallId + updateNewGroupCallPaidReaction.StarCount = tmp.StarCount fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - updateGroupCallNewMessage.SenderId = fieldSenderId + updateNewGroupCallPaidReaction.SenderId = fieldSenderId return nil } +// A group call message failed to send +type UpdateGroupCallMessageSendFailed struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Message identifier + MessageId int32 `json:"message_id"` + // The cause of the message sending failure + Error *Error `json:"error"` +} + +func (entity *UpdateGroupCallMessageSendFailed) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessageSendFailed + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessageSendFailed) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessageSendFailed) GetType() string { + return TypeUpdateGroupCallMessageSendFailed +} + +func (*UpdateGroupCallMessageSendFailed) UpdateType() string { + return TypeUpdateGroupCallMessageSendFailed +} + +// Some group call messages were deleted +type UpdateGroupCallMessagesDeleted struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // Identifiers of the deleted messages + MessageIds []int32 `json:"message_ids"` +} + +func (entity *UpdateGroupCallMessagesDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessagesDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessagesDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessagesDeleted) GetType() string { + return TypeUpdateGroupCallMessagesDeleted +} + +func (*UpdateGroupCallMessagesDeleted) UpdateType() string { + return TypeUpdateGroupCallMessagesDeleted +} + +// The list of top donors in live story group call has changed +type UpdateLiveStoryTopDonors struct { + meta + // Identifier of the group call + GroupCallId int32 `json:"group_call_id"` + // New list of live story donors + Donors *LiveStoryDonors `json:"donors"` +} + +func (entity *UpdateLiveStoryTopDonors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateLiveStoryTopDonors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateLiveStoryTopDonors) GetClass() string { + return ClassUpdate +} + +func (*UpdateLiveStoryTopDonors) GetType() string { + return TypeUpdateLiveStoryTopDonors +} + +func (*UpdateLiveStoryTopDonors) UpdateType() string { + return TypeUpdateLiveStoryTopDonors +} + // New call signaling data arrived type UpdateNewCallSignalingData struct { meta @@ -61872,6 +64002,60 @@ func (*UpdateNewCallSignalingData) UpdateType() string { return TypeUpdateNewCallSignalingData } +// State of a gift auction was updated +type UpdateGiftAuctionState struct { + meta + // New state of the auction + State *GiftAuctionState `json:"state"` +} + +func (entity *UpdateGiftAuctionState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGiftAuctionState + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGiftAuctionState) GetClass() string { + return ClassUpdate +} + +func (*UpdateGiftAuctionState) GetType() string { + return TypeUpdateGiftAuctionState +} + +func (*UpdateGiftAuctionState) UpdateType() string { + return TypeUpdateGiftAuctionState +} + +// The list of auctions in which participate the current user has changed +type UpdateActiveGiftAuctions struct { + meta + // New states of the auctions + States []*GiftAuctionState `json:"states"` +} + +func (entity *UpdateActiveGiftAuctions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateActiveGiftAuctions + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateActiveGiftAuctions) GetClass() string { + return ClassUpdate +} + +func (*UpdateActiveGiftAuctions) GetType() string { + return TypeUpdateActiveGiftAuctions +} + +func (*UpdateActiveGiftAuctions) UpdateType() string { + return TypeUpdateActiveGiftAuctions +} + // Some privacy setting rules have been changed type UpdateUserPrivacySettingRules struct { meta @@ -62277,6 +64461,33 @@ func (*UpdateStoryStealthMode) UpdateType() string { return TypeUpdateStoryStealthMode } +// Lists of bots which Mini Apps must be allowed to read text from clipboard and must be opened without a warning +type UpdateTrustedMiniAppBots struct { + meta + // List of user identifiers of the bots; the corresponding users may not be sent using updateUser updates and may not be accessible + BotUserIds []int64 `json:"bot_user_ids"` +} + +func (entity *UpdateTrustedMiniAppBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTrustedMiniAppBots + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTrustedMiniAppBots) GetClass() string { + return ClassUpdate +} + +func (*UpdateTrustedMiniAppBots) GetType() string { + return TypeUpdateTrustedMiniAppBots +} + +func (*UpdateTrustedMiniAppBots) UpdateType() string { + return TypeUpdateTrustedMiniAppBots +} + // An option changed its value type UpdateOption struct { meta @@ -63305,6 +65516,33 @@ func (*UpdateSpeechRecognitionTrial) UpdateType() string { return TypeUpdateSpeechRecognitionTrial } +// The levels of live story group call messages have changed +type UpdateGroupCallMessageLevels struct { + meta + // New description of the levels in decreasing order of groupCallMessageLevel.min_star_count + Levels []*GroupCallMessageLevel `json:"levels"` +} + +func (entity *UpdateGroupCallMessageLevels) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateGroupCallMessageLevels + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateGroupCallMessageLevels) GetClass() string { + return ClassUpdate +} + +func (*UpdateGroupCallMessageLevels) GetType() string { + return TypeUpdateGroupCallMessageLevels +} + +func (*UpdateGroupCallMessageLevels) UpdateType() string { + return TypeUpdateGroupCallMessageLevels +} + // The list of supported dice emojis has changed type UpdateDiceEmojis struct { meta @@ -63332,6 +65570,33 @@ func (*UpdateDiceEmojis) UpdateType() string { return TypeUpdateDiceEmojis } +// The stake dice state has changed +type UpdateStakeDiceState struct { + meta + // The new state. The state can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState + State *StakeDiceState `json:"state"` +} + +func (entity *UpdateStakeDiceState) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStakeDiceState + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStakeDiceState) GetClass() string { + return ClassUpdate +} + +func (*UpdateStakeDiceState) GetType() string { + return TypeUpdateStakeDiceState +} + +func (*UpdateStakeDiceState) UpdateType() string { + return TypeUpdateStakeDiceState +} + // Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played type UpdateAnimatedEmojiMessageClicked struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 8b2ca9f..60a638b 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -748,6 +748,43 @@ func UnmarshalListOfGiftResalePrice(dataList []json.RawMessage) ([]GiftResalePri return list, nil } +func UnmarshalGiftPurchaseOfferState(data json.RawMessage) (GiftPurchaseOfferState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeGiftPurchaseOfferStatePending: + return UnmarshalGiftPurchaseOfferStatePending(data) + + case TypeGiftPurchaseOfferStateAccepted: + return UnmarshalGiftPurchaseOfferStateAccepted(data) + + case TypeGiftPurchaseOfferStateRejected: + return UnmarshalGiftPurchaseOfferStateRejected(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfGiftPurchaseOfferState(dataList []json.RawMessage) ([]GiftPurchaseOfferState, error) { + list := []GiftPurchaseOfferState{} + + for _, data := range dataList { + entity, err := UnmarshalGiftPurchaseOfferState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalSuggestedPostPrice(data json.RawMessage) (SuggestedPostPrice, error) { var meta meta @@ -1019,6 +1056,9 @@ func UnmarshalUpgradedGiftOrigin(data json.RawMessage) (UpgradedGiftOrigin, erro case TypeUpgradedGiftOriginPrepaidUpgrade: return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) + case TypeUpgradedGiftOriginOffer: + return UnmarshalUpgradedGiftOriginOffer(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -1180,6 +1220,40 @@ func UnmarshalListOfSentGift(dataList []json.RawMessage) ([]SentGift, error) { return list, nil } +func UnmarshalAuctionState(data json.RawMessage) (AuctionState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeAuctionStateActive: + return UnmarshalAuctionStateActive(data) + + case TypeAuctionStateFinished: + return UnmarshalAuctionStateFinished(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfAuctionState(dataList []json.RawMessage) ([]AuctionState, error) { + list := []AuctionState{} + + for _, data := range dataList { + entity, err := UnmarshalAuctionState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalTransactionDirection(data json.RawMessage) (TransactionDirection, error) { var meta meta @@ -1280,9 +1354,15 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypeChannelSubscriptionSale: return UnmarshalStarTransactionTypeChannelSubscriptionSale(data) + case TypeStarTransactionTypeGiftAuctionBid: + return UnmarshalStarTransactionTypeGiftAuctionBid(data) + case TypeStarTransactionTypeGiftPurchase: return UnmarshalStarTransactionTypeGiftPurchase(data) + case TypeStarTransactionTypeGiftPurchaseOffer: + return UnmarshalStarTransactionTypeGiftPurchaseOffer(data) + case TypeStarTransactionTypeGiftTransfer: return UnmarshalStarTransactionTypeGiftTransfer(data) @@ -1319,6 +1399,18 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypePaidMessageReceive: return UnmarshalStarTransactionTypePaidMessageReceive(data) + case TypeStarTransactionTypePaidGroupCallMessageSend: + return UnmarshalStarTransactionTypePaidGroupCallMessageSend(data) + + case TypeStarTransactionTypePaidGroupCallMessageReceive: + return UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data) + + case TypeStarTransactionTypePaidGroupCallReactionSend: + return UnmarshalStarTransactionTypePaidGroupCallReactionSend(data) + + case TypeStarTransactionTypePaidGroupCallReactionReceive: + return UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data) + case TypeStarTransactionTypeSuggestedPostPaymentSend: return UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data) @@ -1371,9 +1463,15 @@ func UnmarshalTonTransactionType(data json.RawMessage) (TonTransactionType, erro case TypeTonTransactionTypeFragmentDeposit: return UnmarshalTonTransactionTypeFragmentDeposit(data) + case TypeTonTransactionTypeFragmentWithdrawal: + return UnmarshalTonTransactionTypeFragmentWithdrawal(data) + case TypeTonTransactionTypeSuggestedPostPayment: return UnmarshalTonTransactionTypeSuggestedPostPayment(data) + case TypeTonTransactionTypeGiftPurchaseOffer: + return UnmarshalTonTransactionTypeGiftPurchaseOffer(data) + case TypeTonTransactionTypeUpgradedGiftPurchase: return UnmarshalTonTransactionTypeUpgradedGiftPurchase(data) @@ -1402,6 +1500,43 @@ func UnmarshalListOfTonTransactionType(dataList []json.RawMessage) ([]TonTransac return list, nil } +func UnmarshalActiveStoryState(data json.RawMessage) (ActiveStoryState, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeActiveStoryStateLive: + return UnmarshalActiveStoryStateLive(data) + + case TypeActiveStoryStateUnread: + return UnmarshalActiveStoryStateUnread(data) + + case TypeActiveStoryStateRead: + return UnmarshalActiveStoryStateRead(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfActiveStoryState(dataList []json.RawMessage) ([]ActiveStoryState, error) { + list := []ActiveStoryState{} + + for _, data := range dataList { + entity, err := UnmarshalActiveStoryState(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalGiveawayParticipantStatus(data json.RawMessage) (GiveawayParticipantStatus, error) { var meta meta @@ -3195,6 +3330,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + case TypeLinkPreviewTypeGiftCollection: return UnmarshalLinkPreviewTypeGiftCollection(data) @@ -3204,6 +3342,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -3919,6 +4060,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStakeDice: + return UnmarshalMessageStakeDice(data) + case TypeMessageStory: return UnmarshalMessageStory(data) @@ -4066,6 +4210,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageRefundedUpgradedGift: return UnmarshalMessageRefundedUpgradedGift(data) + case TypeMessageUpgradedGiftPurchaseOffer: + return UnmarshalMessageUpgradedGiftPurchaseOffer(data) + + case TypeMessageUpgradedGiftPurchaseOfferRejected: + return UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data) + case TypeMessagePaidMessagesRefunded: return UnmarshalMessagePaidMessagesRefunded(data) @@ -4404,6 +4554,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStakeDice: + return UnmarshalInputMessageStakeDice(data) + case TypeInputMessageStory: return UnmarshalInputMessageStory(data) @@ -4857,6 +5010,9 @@ func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) + case TypeStoryContentLive: + return UnmarshalStoryContentLive(data) + case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -6254,6 +6410,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureChecklists: return UnmarshalPremiumFeatureChecklists(data) + case TypePremiumFeaturePaidMessages: + return UnmarshalPremiumFeaturePaidMessages(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6834,6 +6993,9 @@ func UnmarshalCanPostStoryResult(data json.RawMessage) (CanPostStoryResult, erro case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6853,6 +7015,40 @@ func UnmarshalListOfCanPostStoryResult(dataList []json.RawMessage) ([]CanPostSto return list, nil } +func UnmarshalStartLiveStoryResult(data json.RawMessage) (StartLiveStoryResult, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStartLiveStoryResult(dataList []json.RawMessage) ([]StartLiveStoryResult, error) { + list := []StartLiveStoryResult{} + + for _, data := range dataList { + entity, err := UnmarshalStartLiveStoryResult(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCanTransferOwnershipResult(data json.RawMessage) (CanTransferOwnershipResult, error) { var meta meta @@ -7507,6 +7703,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingShowProfileAudio: + return UnmarshalUserPrivacySettingShowProfileAudio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -7867,6 +8066,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(data) @@ -7885,6 +8087,12 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(data) + + case TypeInternalLinkTypeLoginEmailSettings: + return UnmarshalInternalLinkTypeLoginEmailSettings(data) + case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -7903,9 +8111,15 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { 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) @@ -8425,6 +8639,12 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionCustom: return UnmarshalSuggestedActionCustom(data) + case TypeSuggestedActionSetLoginEmailAddress: + return UnmarshalSuggestedActionSetLoginEmailAddress(data) + + case TypeSuggestedActionAddLoginPasskey: + return UnmarshalSuggestedActionAddLoginPasskey(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -9108,12 +9328,30 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(data) - case TypeUpdateGroupCallNewMessage: - return UnmarshalUpdateGroupCallNewMessage(data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(data) case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -9144,6 +9382,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -9240,9 +9481,15 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(data) @@ -9564,6 +9811,22 @@ func UnmarshalTermsOfService(data json.RawMessage) (*TermsOfService, error) { return &resp, err } +func UnmarshalPasskey(data json.RawMessage) (*Passkey, error) { + var resp Passkey + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPasskeys(data json.RawMessage) (*Passkeys, error) { + var resp Passkeys + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalAuthorizationStateWaitTdlibParameters(data json.RawMessage) (*AuthorizationStateWaitTdlibParameters, error) { var resp AuthorizationStateWaitTdlibParameters @@ -10140,6 +10403,14 @@ func UnmarshalGame(data json.RawMessage) (*Game, error) { return &resp, err } +func UnmarshalStakeDiceState(data json.RawMessage) (*StakeDiceState, error) { + var resp StakeDiceState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalWebApp(data json.RawMessage) (*WebApp, error) { var resp WebApp @@ -10636,6 +10907,30 @@ func UnmarshalGiftResalePriceTon(data json.RawMessage) (*GiftResalePriceTon, err return &resp, err } +func UnmarshalGiftPurchaseOfferStatePending(data json.RawMessage) (*GiftPurchaseOfferStatePending, error) { + var resp GiftPurchaseOfferStatePending + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseOfferStateAccepted(data json.RawMessage) (*GiftPurchaseOfferStateAccepted, error) { + var resp GiftPurchaseOfferStateAccepted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftPurchaseOfferStateRejected(data json.RawMessage) (*GiftPurchaseOfferStateRejected, error) { + var resp GiftPurchaseOfferStateRejected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSuggestedPostPriceStar(data json.RawMessage) (*SuggestedPostPriceStar, error) { var resp SuggestedPostPriceStar @@ -10980,6 +11275,22 @@ func UnmarshalGiftSettings(data json.RawMessage) (*GiftSettings, error) { return &resp, err } +func UnmarshalGiftAuction(data json.RawMessage) (*GiftAuction, error) { + var resp GiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftBackground(data json.RawMessage) (*GiftBackground, error) { + var resp GiftBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiftPurchaseLimits(data json.RawMessage) (*GiftPurchaseLimits, error) { var resp GiftPurchaseLimits @@ -11068,6 +11379,14 @@ func UnmarshalUpgradedGiftOriginPrepaidUpgrade(data json.RawMessage) (*UpgradedG return &resp, err } +func UnmarshalUpgradedGiftOriginOffer(data json.RawMessage) (*UpgradedGiftOriginOffer, error) { + var resp UpgradedGiftOriginOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) { var resp UpgradedGiftModel @@ -11316,6 +11635,78 @@ func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, err return &resp, err } +func UnmarshalGiftUpgradeVariants(data json.RawMessage) (*GiftUpgradeVariants, error) { + var resp GiftUpgradeVariants + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionBid(data json.RawMessage) (*AuctionBid, error) { + var resp AuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUserAuctionBid(data json.RawMessage) (*UserAuctionBid, error) { + var resp UserAuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionRound(data json.RawMessage) (*AuctionRound, error) { + var resp AuctionRound + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionStateActive(data json.RawMessage) (*AuctionStateActive, error) { + var resp AuctionStateActive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAuctionStateFinished(data json.RawMessage) (*AuctionStateFinished, error) { + var resp AuctionStateFinished + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionState(data json.RawMessage) (*GiftAuctionState, error) { + var resp GiftAuctionState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionAcquiredGift(data json.RawMessage) (*GiftAuctionAcquiredGift, error) { + var resp GiftAuctionAcquiredGift + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGiftAuctionAcquiredGifts(data json.RawMessage) (*GiftAuctionAcquiredGifts, error) { + var resp GiftAuctionAcquiredGifts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTransactionDirectionIncoming(data json.RawMessage) (*TransactionDirectionIncoming, error) { var resp TransactionDirectionIncoming @@ -11484,6 +11875,14 @@ func UnmarshalStarTransactionTypeChannelSubscriptionSale(data json.RawMessage) ( return &resp, err } +func UnmarshalStarTransactionTypeGiftAuctionBid(data json.RawMessage) (*StarTransactionTypeGiftAuctionBid, error) { + var resp StarTransactionTypeGiftAuctionBid + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeGiftPurchase(data json.RawMessage) (*StarTransactionTypeGiftPurchase, error) { var resp StarTransactionTypeGiftPurchase @@ -11492,6 +11891,14 @@ func UnmarshalStarTransactionTypeGiftPurchase(data json.RawMessage) (*StarTransa return &resp, err } +func UnmarshalStarTransactionTypeGiftPurchaseOffer(data json.RawMessage) (*StarTransactionTypeGiftPurchaseOffer, error) { + var resp StarTransactionTypeGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeGiftTransfer(data json.RawMessage) (*StarTransactionTypeGiftTransfer, error) { var resp StarTransactionTypeGiftTransfer @@ -11588,6 +11995,38 @@ func UnmarshalStarTransactionTypePaidMessageReceive(data json.RawMessage) (*Star return &resp, err } +func UnmarshalStarTransactionTypePaidGroupCallMessageSend(data json.RawMessage) (*StarTransactionTypePaidGroupCallMessageSend, error) { + var resp StarTransactionTypePaidGroupCallMessageSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data json.RawMessage) (*StarTransactionTypePaidGroupCallMessageReceive, error) { + var resp StarTransactionTypePaidGroupCallMessageReceive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallReactionSend(data json.RawMessage) (*StarTransactionTypePaidGroupCallReactionSend, error) { + var resp StarTransactionTypePaidGroupCallReactionSend + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data json.RawMessage) (*StarTransactionTypePaidGroupCallReactionReceive, error) { + var resp StarTransactionTypePaidGroupCallReactionReceive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data json.RawMessage) (*StarTransactionTypeSuggestedPostPaymentSend, error) { var resp StarTransactionTypeSuggestedPostPaymentSend @@ -11668,6 +12107,14 @@ func UnmarshalTonTransactionTypeFragmentDeposit(data json.RawMessage) (*TonTrans return &resp, err } +func UnmarshalTonTransactionTypeFragmentWithdrawal(data json.RawMessage) (*TonTransactionTypeFragmentWithdrawal, error) { + var resp TonTransactionTypeFragmentWithdrawal + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTonTransactionTypeSuggestedPostPayment(data json.RawMessage) (*TonTransactionTypeSuggestedPostPayment, error) { var resp TonTransactionTypeSuggestedPostPayment @@ -11676,6 +12123,14 @@ func UnmarshalTonTransactionTypeSuggestedPostPayment(data json.RawMessage) (*Ton return &resp, err } +func UnmarshalTonTransactionTypeGiftPurchaseOffer(data json.RawMessage) (*TonTransactionTypeGiftPurchaseOffer, error) { + var resp TonTransactionTypeGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTonTransactionTypeUpgradedGiftPurchase(data json.RawMessage) (*TonTransactionTypeUpgradedGiftPurchase, error) { var resp TonTransactionTypeUpgradedGiftPurchase @@ -11716,6 +12171,30 @@ func UnmarshalTonTransactions(data json.RawMessage) (*TonTransactions, error) { return &resp, err } +func UnmarshalActiveStoryStateLive(data json.RawMessage) (*ActiveStoryStateLive, error) { + var resp ActiveStoryStateLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalActiveStoryStateUnread(data json.RawMessage) (*ActiveStoryStateUnread, error) { + var resp ActiveStoryStateUnread + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalActiveStoryStateRead(data json.RawMessage) (*ActiveStoryStateRead, error) { + var resp ActiveStoryStateRead + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalGiveawayParticipantStatusEligible(data json.RawMessage) (*GiveawayParticipantStatusEligible, error) { var resp GiveawayParticipantStatusEligible @@ -12492,6 +12971,14 @@ func UnmarshalPaidReactor(data json.RawMessage) (*PaidReactor, error) { return &resp, err } +func UnmarshalLiveStoryDonors(data json.RawMessage) (*LiveStoryDonors, error) { + var resp LiveStoryDonors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, error) { var resp MessageForwardInfo @@ -14404,6 +14891,14 @@ func UnmarshalLinkPreviewTypeExternalVideo(data json.RawMessage) (*LinkPreviewTy return &resp, err } +func UnmarshalLinkPreviewTypeGiftAuction(data json.RawMessage) (*LinkPreviewTypeGiftAuction, error) { + var resp LinkPreviewTypeGiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeGiftCollection(data json.RawMessage) (*LinkPreviewTypeGiftCollection, error) { var resp LinkPreviewTypeGiftCollection @@ -14428,6 +14923,14 @@ func UnmarshalLinkPreviewTypeInvoice(data json.RawMessage) (*LinkPreviewTypeInvo return &resp, err } +func UnmarshalLinkPreviewTypeLiveStory(data json.RawMessage) (*LinkPreviewTypeLiveStory, error) { + var resp LinkPreviewTypeLiveStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeMessage(data json.RawMessage) (*LinkPreviewTypeMessage, error) { var resp LinkPreviewTypeMessage @@ -15652,6 +16155,14 @@ func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { return &resp, err } +func UnmarshalMessageStakeDice(data json.RawMessage) (*MessageStakeDice, error) { + var resp MessageStakeDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { var resp MessageStory @@ -16044,6 +16555,22 @@ func UnmarshalMessageRefundedUpgradedGift(data json.RawMessage) (*MessageRefunde return &resp, err } +func UnmarshalMessageUpgradedGiftPurchaseOffer(data json.RawMessage) (*MessageUpgradedGiftPurchaseOffer, error) { + var resp MessageUpgradedGiftPurchaseOffer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data json.RawMessage) (*MessageUpgradedGiftPurchaseOfferRejected, error) { + var resp MessageUpgradedGiftPurchaseOfferRejected + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePaidMessagesRefunded(data json.RawMessage) (*MessagePaidMessagesRefunded, error) { var resp MessagePaidMessagesRefunded @@ -16604,6 +17131,14 @@ func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) return &resp, err } +func UnmarshalInputMessageStakeDice(data json.RawMessage) (*InputMessageStakeDice, error) { + var resp InputMessageStakeDice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error) { var resp InputMessageStory @@ -17276,6 +17811,14 @@ func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error return &resp, err } +func UnmarshalStoryContentLive(data json.RawMessage) (*StoryContentLive, error) { + var resp StoryContentLive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) { var resp StoryContentUnsupported @@ -17804,16 +18347,16 @@ func UnmarshalGroupCallVideoQualityFull(data json.RawMessage) (*GroupCallVideoQu return &resp, err } -func UnmarshalVideoChatStream(data json.RawMessage) (*VideoChatStream, error) { - var resp VideoChatStream +func UnmarshalGroupCallStream(data json.RawMessage) (*GroupCallStream, error) { + var resp GroupCallStream err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalVideoChatStreams(data json.RawMessage) (*VideoChatStreams, error) { - var resp VideoChatStreams +func UnmarshalGroupCallStreams(data json.RawMessage) (*GroupCallStreams, error) { + var resp GroupCallStreams err := json.Unmarshal(data, &resp) @@ -17884,6 +18427,22 @@ func UnmarshalGroupCallInfo(data json.RawMessage) (*GroupCallInfo, error) { return &resp, err } +func UnmarshalGroupCallMessage(data json.RawMessage) (*GroupCallMessage, error) { + var resp GroupCallMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalGroupCallMessageLevel(data json.RawMessage) (*GroupCallMessageLevel, error) { + var resp GroupCallMessageLevel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data json.RawMessage) (*InviteGroupCallParticipantResultUserPrivacyRestricted, error) { var resp InviteGroupCallParticipantResultUserPrivacyRestricted @@ -19428,6 +19987,14 @@ func UnmarshalPremiumFeatureChecklists(data json.RawMessage) (*PremiumFeatureChe return &resp, err } +func UnmarshalPremiumFeaturePaidMessages(data json.RawMessage) (*PremiumFeaturePaidMessages, error) { + var resp PremiumFeaturePaidMessages + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { var resp BusinessFeatureLocation @@ -20108,6 +20675,30 @@ func UnmarshalCanPostStoryResultMonthlyLimitExceeded(data json.RawMessage) (*Can return &resp, err } +func UnmarshalCanPostStoryResultLiveStoryIsActive(data json.RawMessage) (*CanPostStoryResultLiveStoryIsActive, error) { + var resp CanPostStoryResultLiveStoryIsActive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStartLiveStoryResultOk(data json.RawMessage) (*StartLiveStoryResultOk, error) { + var resp StartLiveStoryResultOk + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStartLiveStoryResultFail(data json.RawMessage) (*StartLiveStoryResultFail, error) { + var resp StartLiveStoryResultFail + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCanTransferOwnershipResultOk(data json.RawMessage) (*CanTransferOwnershipResultOk, error) { var resp CanTransferOwnershipResultOk @@ -20980,6 +21571,14 @@ func UnmarshalUserPrivacySettingShowBirthdate(data json.RawMessage) (*UserPrivac return &resp, err } +func UnmarshalUserPrivacySettingShowProfileAudio(data json.RawMessage) (*UserPrivacySettingShowProfileAudio, error) { + var resp UserPrivacySettingShowProfileAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -21564,6 +22163,14 @@ func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, return &resp, err } +func UnmarshalInternalLinkTypeGiftAuction(data json.RawMessage) (*InternalLinkTypeGiftAuction, error) { + var resp InternalLinkTypeGiftAuction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeGiftCollection(data json.RawMessage) (*InternalLinkTypeGiftCollection, error) { var resp InternalLinkTypeGiftCollection @@ -21612,6 +22219,22 @@ func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeLiveStory(data json.RawMessage) (*InternalLinkTypeLiveStory, error) { + var resp InternalLinkTypeLiveStory + + err := json.Unmarshal(data, &resp) + + 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 @@ -21660,6 +22283,14 @@ 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 @@ -21668,6 +22299,14 @@ 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 @@ -22540,6 +23179,22 @@ func UnmarshalSuggestedActionCustom(data json.RawMessage) (*SuggestedActionCusto return &resp, err } +func UnmarshalSuggestedActionSetLoginEmailAddress(data json.RawMessage) (*SuggestedActionSetLoginEmailAddress, error) { + var resp SuggestedActionSetLoginEmailAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalSuggestedActionAddLoginPasskey(data json.RawMessage) (*SuggestedActionAddLoginPasskey, error) { + var resp SuggestedActionAddLoginPasskey + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCount(data json.RawMessage) (*Count, error) { var resp Count @@ -23756,8 +24411,40 @@ func UnmarshalUpdateGroupCallVerificationState(data json.RawMessage) (*UpdateGro return &resp, err } -func UnmarshalUpdateGroupCallNewMessage(data json.RawMessage) (*UpdateGroupCallNewMessage, error) { - var resp UpdateGroupCallNewMessage +func UnmarshalUpdateNewGroupCallMessage(data json.RawMessage) (*UpdateNewGroupCallMessage, error) { + var resp UpdateNewGroupCallMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateNewGroupCallPaidReaction(data json.RawMessage) (*UpdateNewGroupCallPaidReaction, error) { + var resp UpdateNewGroupCallPaidReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateGroupCallMessageSendFailed(data json.RawMessage) (*UpdateGroupCallMessageSendFailed, error) { + var resp UpdateGroupCallMessageSendFailed + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateGroupCallMessagesDeleted(data json.RawMessage) (*UpdateGroupCallMessagesDeleted, error) { + var resp UpdateGroupCallMessagesDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateLiveStoryTopDonors(data json.RawMessage) (*UpdateLiveStoryTopDonors, error) { + var resp UpdateLiveStoryTopDonors err := json.Unmarshal(data, &resp) @@ -23772,6 +24459,22 @@ func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSi return &resp, err } +func UnmarshalUpdateGiftAuctionState(data json.RawMessage) (*UpdateGiftAuctionState, error) { + var resp UpdateGiftAuctionState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateActiveGiftAuctions(data json.RawMessage) (*UpdateActiveGiftAuctions, error) { + var resp UpdateActiveGiftAuctions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateUserPrivacySettingRules(data json.RawMessage) (*UpdateUserPrivacySettingRules, error) { var resp UpdateUserPrivacySettingRules @@ -23852,6 +24555,14 @@ func UnmarshalUpdateStoryStealthMode(data json.RawMessage) (*UpdateStoryStealthM return &resp, err } +func UnmarshalUpdateTrustedMiniAppBots(data json.RawMessage) (*UpdateTrustedMiniAppBots, error) { + var resp UpdateTrustedMiniAppBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { var resp UpdateOption @@ -24108,6 +24819,14 @@ func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechR return &resp, err } +func UnmarshalUpdateGroupCallMessageLevels(data json.RawMessage) (*UpdateGroupCallMessageLevels, error) { + var resp UpdateGroupCallMessageLevels + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) { var resp UpdateDiceEmojis @@ -24116,6 +24835,14 @@ func UnmarshalUpdateDiceEmojis(data json.RawMessage) (*UpdateDiceEmojis, error) return &resp, err } +func UnmarshalUpdateStakeDiceState(data json.RawMessage) (*UpdateStakeDiceState, error) { + var resp UpdateStakeDiceState + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateAnimatedEmojiMessageClicked(data json.RawMessage) (*UpdateAnimatedEmojiMessageClicked, error) { var resp UpdateAnimatedEmojiMessageClicked @@ -24522,6 +25249,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTermsOfService: return UnmarshalTermsOfService(data) + case TypePasskey: + return UnmarshalPasskey(data) + + case TypePasskeys: + return UnmarshalPasskeys(data) + case TypeAuthorizationStateWaitTdlibParameters: return UnmarshalAuthorizationStateWaitTdlibParameters(data) @@ -24738,6 +25471,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGame: return UnmarshalGame(data) + case TypeStakeDiceState: + return UnmarshalStakeDiceState(data) + case TypeWebApp: return UnmarshalWebApp(data) @@ -24924,6 +25660,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiftResalePriceTon: return UnmarshalGiftResalePriceTon(data) + case TypeGiftPurchaseOfferStatePending: + return UnmarshalGiftPurchaseOfferStatePending(data) + + case TypeGiftPurchaseOfferStateAccepted: + return UnmarshalGiftPurchaseOfferStateAccepted(data) + + case TypeGiftPurchaseOfferStateRejected: + return UnmarshalGiftPurchaseOfferStateRejected(data) + case TypeSuggestedPostPriceStar: return UnmarshalSuggestedPostPriceStar(data) @@ -25053,6 +25798,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiftSettings: return UnmarshalGiftSettings(data) + case TypeGiftAuction: + return UnmarshalGiftAuction(data) + + case TypeGiftBackground: + return UnmarshalGiftBackground(data) + case TypeGiftPurchaseLimits: return UnmarshalGiftPurchaseLimits(data) @@ -25086,6 +25837,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginPrepaidUpgrade: return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) + case TypeUpgradedGiftOriginOffer: + return UnmarshalUpgradedGiftOriginOffer(data) + case TypeUpgradedGiftModel: return UnmarshalUpgradedGiftModel(data) @@ -25179,6 +25933,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGiftUpgradePreview: return UnmarshalGiftUpgradePreview(data) + case TypeGiftUpgradeVariants: + return UnmarshalGiftUpgradeVariants(data) + + case TypeAuctionBid: + return UnmarshalAuctionBid(data) + + case TypeUserAuctionBid: + return UnmarshalUserAuctionBid(data) + + case TypeAuctionRound: + return UnmarshalAuctionRound(data) + + case TypeAuctionStateActive: + return UnmarshalAuctionStateActive(data) + + case TypeAuctionStateFinished: + return UnmarshalAuctionStateFinished(data) + + case TypeGiftAuctionState: + return UnmarshalGiftAuctionState(data) + + case TypeGiftAuctionAcquiredGift: + return UnmarshalGiftAuctionAcquiredGift(data) + + case TypeGiftAuctionAcquiredGifts: + return UnmarshalGiftAuctionAcquiredGifts(data) + case TypeTransactionDirectionIncoming: return UnmarshalTransactionDirectionIncoming(data) @@ -25242,9 +26023,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypeChannelSubscriptionSale: return UnmarshalStarTransactionTypeChannelSubscriptionSale(data) + case TypeStarTransactionTypeGiftAuctionBid: + return UnmarshalStarTransactionTypeGiftAuctionBid(data) + case TypeStarTransactionTypeGiftPurchase: return UnmarshalStarTransactionTypeGiftPurchase(data) + case TypeStarTransactionTypeGiftPurchaseOffer: + return UnmarshalStarTransactionTypeGiftPurchaseOffer(data) + case TypeStarTransactionTypeGiftTransfer: return UnmarshalStarTransactionTypeGiftTransfer(data) @@ -25281,6 +26068,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypePaidMessageReceive: return UnmarshalStarTransactionTypePaidMessageReceive(data) + case TypeStarTransactionTypePaidGroupCallMessageSend: + return UnmarshalStarTransactionTypePaidGroupCallMessageSend(data) + + case TypeStarTransactionTypePaidGroupCallMessageReceive: + return UnmarshalStarTransactionTypePaidGroupCallMessageReceive(data) + + case TypeStarTransactionTypePaidGroupCallReactionSend: + return UnmarshalStarTransactionTypePaidGroupCallReactionSend(data) + + case TypeStarTransactionTypePaidGroupCallReactionReceive: + return UnmarshalStarTransactionTypePaidGroupCallReactionReceive(data) + case TypeStarTransactionTypeSuggestedPostPaymentSend: return UnmarshalStarTransactionTypeSuggestedPostPaymentSend(data) @@ -25311,9 +26110,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactionTypeFragmentDeposit: return UnmarshalTonTransactionTypeFragmentDeposit(data) + case TypeTonTransactionTypeFragmentWithdrawal: + return UnmarshalTonTransactionTypeFragmentWithdrawal(data) + case TypeTonTransactionTypeSuggestedPostPayment: return UnmarshalTonTransactionTypeSuggestedPostPayment(data) + case TypeTonTransactionTypeGiftPurchaseOffer: + return UnmarshalTonTransactionTypeGiftPurchaseOffer(data) + case TypeTonTransactionTypeUpgradedGiftPurchase: return UnmarshalTonTransactionTypeUpgradedGiftPurchase(data) @@ -25329,6 +26134,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTonTransactions: return UnmarshalTonTransactions(data) + case TypeActiveStoryStateLive: + return UnmarshalActiveStoryStateLive(data) + + case TypeActiveStoryStateUnread: + return UnmarshalActiveStoryStateUnread(data) + + case TypeActiveStoryStateRead: + return UnmarshalActiveStoryStateRead(data) + case TypeGiveawayParticipantStatusEligible: return UnmarshalGiveawayParticipantStatusEligible(data) @@ -25620,6 +26434,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaidReactor: return UnmarshalPaidReactor(data) + case TypeLiveStoryDonors: + return UnmarshalLiveStoryDonors(data) + case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) @@ -26337,6 +27154,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) + case TypeLinkPreviewTypeGiftAuction: + return UnmarshalLinkPreviewTypeGiftAuction(data) + case TypeLinkPreviewTypeGiftCollection: return UnmarshalLinkPreviewTypeGiftCollection(data) @@ -26346,6 +27166,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) + case TypeLinkPreviewTypeLiveStory: + return UnmarshalLinkPreviewTypeLiveStory(data) + case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -26805,6 +27628,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStakeDice: + return UnmarshalMessageStakeDice(data) + case TypeMessageStory: return UnmarshalMessageStory(data) @@ -26952,6 +27778,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageRefundedUpgradedGift: return UnmarshalMessageRefundedUpgradedGift(data) + case TypeMessageUpgradedGiftPurchaseOffer: + return UnmarshalMessageUpgradedGiftPurchaseOffer(data) + + case TypeMessageUpgradedGiftPurchaseOfferRejected: + return UnmarshalMessageUpgradedGiftPurchaseOfferRejected(data) + case TypeMessagePaidMessagesRefunded: return UnmarshalMessagePaidMessagesRefunded(data) @@ -27162,6 +27994,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStakeDice: + return UnmarshalInputMessageStakeDice(data) + case TypeInputMessageStory: return UnmarshalInputMessageStory(data) @@ -27414,6 +28249,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) + case TypeStoryContentLive: + return UnmarshalStoryContentLive(data) + case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -27612,11 +28450,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallVideoQualityFull: return UnmarshalGroupCallVideoQualityFull(data) - case TypeVideoChatStream: - return UnmarshalVideoChatStream(data) + case TypeGroupCallStream: + return UnmarshalGroupCallStream(data) - case TypeVideoChatStreams: - return UnmarshalVideoChatStreams(data) + case TypeGroupCallStreams: + return UnmarshalGroupCallStreams(data) case TypeRtmpUrl: return UnmarshalRtmpUrl(data) @@ -27642,6 +28480,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallInfo: return UnmarshalGroupCallInfo(data) + case TypeGroupCallMessage: + return UnmarshalGroupCallMessage(data) + + case TypeGroupCallMessageLevel: + return UnmarshalGroupCallMessageLevel(data) + case TypeInviteGroupCallParticipantResultUserPrivacyRestricted: return UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data) @@ -28221,6 +29065,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureChecklists: return UnmarshalPremiumFeatureChecklists(data) + case TypePremiumFeaturePaidMessages: + return UnmarshalPremiumFeaturePaidMessages(data) + case TypeBusinessFeatureLocation: return UnmarshalBusinessFeatureLocation(data) @@ -28476,6 +29323,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCanPostStoryResultMonthlyLimitExceeded: return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) + case TypeCanPostStoryResultLiveStoryIsActive: + return UnmarshalCanPostStoryResultLiveStoryIsActive(data) + + case TypeStartLiveStoryResultOk: + return UnmarshalStartLiveStoryResultOk(data) + + case TypeStartLiveStoryResultFail: + return UnmarshalStartLiveStoryResultFail(data) + case TypeCanTransferOwnershipResultOk: return UnmarshalCanTransferOwnershipResultOk(data) @@ -28803,6 +29659,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) + case TypeUserPrivacySettingShowProfileAudio: + return UnmarshalUserPrivacySettingShowProfileAudio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -29022,6 +29881,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) + case TypeInternalLinkTypeGiftAuction: + return UnmarshalInternalLinkTypeGiftAuction(data) + case TypeInternalLinkTypeGiftCollection: return UnmarshalInternalLinkTypeGiftCollection(data) @@ -29040,6 +29902,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeLiveStory: + return UnmarshalInternalLinkTypeLiveStory(data) + + case TypeInternalLinkTypeLoginEmailSettings: + return UnmarshalInternalLinkTypeLoginEmailSettings(data) + case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -29058,9 +29926,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { 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) @@ -29388,6 +30262,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionCustom: return UnmarshalSuggestedActionCustom(data) + case TypeSuggestedActionSetLoginEmailAddress: + return UnmarshalSuggestedActionSetLoginEmailAddress(data) + + case TypeSuggestedActionAddLoginPasskey: + return UnmarshalSuggestedActionAddLoginPasskey(data) + case TypeCount: return UnmarshalCount(data) @@ -29844,12 +30724,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateGroupCallVerificationState: return UnmarshalUpdateGroupCallVerificationState(data) - case TypeUpdateGroupCallNewMessage: - return UnmarshalUpdateGroupCallNewMessage(data) + case TypeUpdateNewGroupCallMessage: + return UnmarshalUpdateNewGroupCallMessage(data) + + case TypeUpdateNewGroupCallPaidReaction: + return UnmarshalUpdateNewGroupCallPaidReaction(data) + + case TypeUpdateGroupCallMessageSendFailed: + return UnmarshalUpdateGroupCallMessageSendFailed(data) + + case TypeUpdateGroupCallMessagesDeleted: + return UnmarshalUpdateGroupCallMessagesDeleted(data) + + case TypeUpdateLiveStoryTopDonors: + return UnmarshalUpdateLiveStoryTopDonors(data) case TypeUpdateNewCallSignalingData: return UnmarshalUpdateNewCallSignalingData(data) + case TypeUpdateGiftAuctionState: + return UnmarshalUpdateGiftAuctionState(data) + + case TypeUpdateActiveGiftAuctions: + return UnmarshalUpdateActiveGiftAuctions(data) + case TypeUpdateUserPrivacySettingRules: return UnmarshalUpdateUserPrivacySettingRules(data) @@ -29880,6 +30778,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) + case TypeUpdateTrustedMiniAppBots: + return UnmarshalUpdateTrustedMiniAppBots(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -29976,9 +30877,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) + case TypeUpdateGroupCallMessageLevels: + return UnmarshalUpdateGroupCallMessageLevels(data) + case TypeUpdateDiceEmojis: return UnmarshalUpdateDiceEmojis(data) + case TypeUpdateStakeDiceState: + return UnmarshalUpdateStakeDiceState(data) + case TypeUpdateAnimatedEmojiMessageClicked: return UnmarshalUpdateAnimatedEmojiMessageClicked(data) diff --git a/data/td_api.tl b/data/td_api.tl index a8b3ca5..c4e58c4 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -120,13 +120,25 @@ formattedText text:string entities:vector = FormattedText; //@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; +//@description Describes a passkey +//@id Unique identifier of the passkey +//@name Name of the passkey +//@addition_date Point in time (Unix timestamp) when the passkey was added +//@last_usage_date Point in time (Unix timestamp) when the passkey was used last time; 0 if never +//@software_icon_custom_emoji_id Identifier of the custom emoji that is used as the icon of the software, which created the passkey; 0 if unknown +passkey id:string name:string addition_date:int32 last_usage_date:int32 software_icon_custom_emoji_id:int64 = Passkey; + +//@description Contains a list of passkeys @passkeys List of passkeys +passkeys passkeys:vector = Passkeys; + //@class AuthorizationState @description Represents the current authorization state of the TDLib client //@description Initialization parameters are needed. Call setTdlibParameters to provide them authorizationStateWaitTdlibParameters = AuthorizationState; -//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options +//@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, +//-or use requestQrCodeAuthentication, getAuthenticationPasskeyParameters, or checkAuthenticationBotToken for other authentication options authorizationStateWaitPhoneNumber = AuthorizationState; //@description The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction @@ -393,9 +405,9 @@ pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType; //@description Describes a task in a checklist //@id Unique identifier of the task //@text Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities -//@completed_by_user_id Identifier of the user that completed the task; 0 if the task isn't completed +//@completed_by Identifier of the user or chat that completed the task; may be null if the task isn't completed yet //@completion_date Point in time (Unix timestamp) when the task was completed; 0 if the task isn't completed -checklistTask id:int32 text:formattedText completed_by_user_id:int53 completion_date:int32 = ChecklistTask; +checklistTask id:int32 text:formattedText completed_by:MessageSender completion_date:int32 = ChecklistTask; //@description Describes a task in a checklist to be sent //@id Unique identifier of the task; must be positive @@ -465,7 +477,7 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Ph //@set_id Identifier of the sticker set to which the sticker belongs; 0 if none //@width Sticker width; as defined by the sender //@height Sticker height; as defined by the sender -//@emoji Emoji corresponding to the sticker +//@emoji Emoji corresponding to the sticker; may be empty if unknown //@format Sticker format //@full_type Sticker's full type //@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @@ -544,6 +556,15 @@ venue location:location title:string address:string provider:string id:string ty //@animation Game animation; may be null game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game; +//@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 +//@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 +//@streak_prize_per_mille The number of Toncoins received by the user for each 1000 Toncoins staked if the dice outcome is 6 three times in a row with the same stake +stakeDiceState state_hash:string stake_toncoin_amount:int53 suggested_stake_toncoin_amounts:vector current_streak:int32 prize_per_mille:vector streak_prize_per_mille:int32 = StakeDiceState; + //@description Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App //@short_name Web App short name //@title Web App title @@ -570,7 +591,7 @@ poll id:int64 question:formattedText options:vector total_voter_coun //@id Unique identifier of the alternative video, which is used in the HLS file //@width Video width //@height Video height -//@codec Codec used for video file encoding, for example, "h264", "h265", or "av1" +//@codec Codec used for video file encoding, for example, "h264", "h265", "av1", or "av01" //@hls_file HLS file describing the video //@video File containing the video alternativeVideo id:int64 width:int32 height:int32 codec:string hls_file:file video:file = AlternativeVideo; @@ -914,7 +935,7 @@ chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_docum //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_manage_topics True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them @@ -930,16 +951,28 @@ 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 range +//@star_count 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 giftResalePriceStar star_count:int53 = GiftResalePrice; //@description Describes price of a resold gift in Toncoins -//@toncoin_cent_count The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in range +//@toncoin_cent_count The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in the range //-getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") giftResalePriceTon toncoin_cent_count:int53 = GiftResalePrice; +//@class GiftPurchaseOfferState @description Describes state of a gift purchase offer + +//@description The offer must be accepted or rejected +giftPurchaseOfferStatePending = GiftPurchaseOfferState; + +//@description The offer was accepted +giftPurchaseOfferStateAccepted = GiftPurchaseOfferState; + +//@description The offer was rejected +giftPurchaseOfferStateRejected = GiftPurchaseOfferState; + + //@class SuggestedPostPrice @description Describes price of a suggested post //@description Describes price of a suggested post in Telegram Stars @@ -1095,7 +1128,7 @@ foundAffiliatePrograms total_count:int32 programs:vector //@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore //@user_count The number of users that used the affiliate program //@revenue_star_count The number of Telegram Stars that were earned by the affiliate program -connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int64 = ConnectedAffiliateProgram; +connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int53 = ConnectedAffiliateProgram; //@description Represents a list of affiliate programs that were connected to an affiliate //@total_count The total number of affiliate programs that were connected to the affiliate @@ -1156,11 +1189,12 @@ premiumGiveawayPaymentOptions options:vector = Pre //@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 //@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; can be 0 or an identifier of a deleted message -//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@giveaway_message_id Identifier of the corresponding giveaway message in the creator_id chat; may be 0 or an identifier of a deleted message +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active after code activation //@user_id Identifier of a user for which the code was created; 0 if none //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none -premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; +premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 day_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; //@description Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments //@currency ISO 4217 currency code for the payment @@ -1198,8 +1232,9 @@ starGiveawayPaymentOptions options:vector = StarGivea //@unlimited_gifts True, if unlimited regular gifts are accepted //@limited_gifts True, if limited regular gifts are accepted //@upgraded_gifts True, if upgraded gifts and regular gifts that can be upgraded for free are accepted +//@gifts_from_channels True, if gifts from channels are accepted subject to other restrictions //@premium_subscription True, if Telegram Premium subscription is accepted -acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool premium_subscription:Bool = AcceptedGiftTypes; +acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool gifts_from_channels:Bool premium_subscription:Bool = AcceptedGiftTypes; //@description Contains settings for gift receiving for a user //@show_gift_button True, if a button for sending a gift to the user or by the user must always be shown in the input field @@ -1207,6 +1242,18 @@ acceptedGiftTypes unlimited_gifts:Bool limited_gifts:Bool upgraded_gifts:Bool pr giftSettings show_gift_button:Bool accepted_gift_types:acceptedGiftTypes = GiftSettings; +//@description Describes an auction on which a gift can be purchased +//@id Identifier of the auction +//@gifts_per_round Number of gifts distributed in each round +//@start_date Point in time (Unix timestamp) when the auction will start +giftAuction id:string gifts_per_round:int32 start_date:int32 = GiftAuction; + +//@description Describes background of a gift +//@center_color Center color in RGB format +//@edge_color Edge color in RGB format +//@text_color Text color in RGB format +giftBackground center_color:int32 edge_color:int32 text_color:int32 = GiftBackground; + //@description Describes the maximum number of times that a specific gift can be purchased //@total_count The maximum number of times the gifts can be purchased //@remaining_count Number of remaining times the gift can be purchased @@ -1241,13 +1288,13 @@ canSendGiftResultFail reason:formattedText = CanSendGiftResult; //@class UpgradedGiftOrigin @description Describes origin from which the upgraded gift was obtained //@description The gift was obtained by upgrading of a previously received gift -//@gift_message_id Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message +//@gift_message_id Identifier of the message with the regular gift that was upgraded; may be 0 or an identifier of a deleted message upgradedGiftOriginUpgrade gift_message_id:int53 = UpgradedGiftOrigin; //@description The gift was transferred from another owner upgradedGiftOriginTransfer = UpgradedGiftOrigin; -//@description The gift was bought from another user @price Price paid by the sender for the gift +//@description The gift was bought from another user @price Price paid for the gift upgradedGiftOriginResale price:GiftResalePrice = UpgradedGiftOrigin; //@description The gift was assigned from blockchain and isn't owned by the current user. The gift can't be transferred, resold or withdrawn to blockchain @@ -1256,6 +1303,9 @@ upgradedGiftOriginBlockchain = UpgradedGiftOrigin; //@description The sender or receiver of the message has paid for upgraid of the gift, which has been completed upgradedGiftOriginPrepaidUpgrade = UpgradedGiftOrigin; +//@description The gift was bought through an offer @price Price paid for the gift +upgradedGiftOriginOffer price:GiftResalePrice = UpgradedGiftOrigin; + //@description Describes a model of an upgraded gift //@name Name of the model @@ -1307,16 +1357,19 @@ upgradedGiftColors id:int64 model_custom_emoji_id:int64 symbol_custom_emoji_id:i //@star_count Number of Telegram Stars that must be paid for the gift //@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed //@upgrade_star_count Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible +//@upgrade_variant_count Number of unique gift variants that are available for the upgraded gift; 0 if unknown //@has_colors True, if the gift can be used to customize the user's name, and backgrounds of profile photo, reply header, and link preview //@is_for_birthday True, if the gift is a birthday gift //@is_premium True, if the gift can be bought only by Telegram Premium subscribers -//@next_send_date Point in time (Unix timestamp) when the gift can be sent next time by the current user; can be 0 or a date in the past. +//@auction_info Information about the auction on which the gift can be purchased; may be null if the gift can be purchased directly +//@next_send_date Point in time (Unix timestamp) when the gift can be sent next time by the current user; may be 0 or a date in the past. //-If the date is in the future, then call canSendGift to get the reason, why the gift can't be sent now //@user_limits Number of times the gift can be purchased by the current user; may be null if not limited //@overall_limits Number of times the gift can be purchased all users; may be null if not limited +//@background Background of the gift //@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only -gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 has_colors:Bool is_for_birthday:Bool is_premium:Bool next_send_date:int32 user_limits:giftPurchaseLimits overall_limits:giftPurchaseLimits first_send_date:int32 last_send_date:int32 = Gift; +gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 upgrade_variant_count:int32 has_colors:Bool is_for_birthday:Bool is_premium:Bool auction_info:giftAuction next_send_date:int32 user_limits:giftPurchaseLimits overall_limits:giftPurchaseLimits background:giftBackground first_send_date:int32 last_send_date:int32 = Gift; //@description Describes an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT //@id Unique identifier of the gift @@ -1341,9 +1394,11 @@ gift id:int64 publisher_chat_id:int53 sticker:sticker star_count:int53 default_s //@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 //@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 //@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 -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 value_currency:string value_amount:int53 = UpgradedGift; +//@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; //@description Contains information about value of an upgraded gift //@currency ISO 4217 currency code of the currency in which the prices are represented @@ -1462,6 +1517,7 @@ sentGiftUpgraded gift:upgradedGift = SentGift; //@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift //@sender_id Identifier of a user or a chat that sent the gift; may be null if unknown //@text Message added to the gift +//@unique_gift_number Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them //@is_saved True, if the gift is displayed on the chat's profile page; only for the receiver of the gift //@is_pinned True, if the gift is pinned to the top of the chat's profile page @@ -1480,7 +1536,7 @@ sentGiftUpgraded gift:upgradedGift = SentGift; //@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 upgraded 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 //@prepaid_upgrade_hash If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade -receivedGift received_gift_id:string sender_id:MessageSender text:formattedText 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 = ReceivedGift; +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 = ReceivedGift; //@description Represents a list of gifts received by a user or a chat //@total_count The total number of received gifts @@ -1497,6 +1553,83 @@ receivedGifts total_count:int32 gifts:vector are_notifications_ena //@next_prices Next changes for the price for gift upgrade with more granularity than in prices giftUpgradePreview models:vector symbols:vector backdrops:vector prices:vector next_prices:vector = GiftUpgradePreview; +//@description Contains all possible variants of upgraded gifts for the given regular gift +//@models Models that can be chosen for the gift after upgrade +//@symbols Symbols that can be chosen for the gift after upgrade +//@backdrops Backdrops that can be chosen for the gift after upgrade +giftUpgradeVariants models:vector symbols:vector backdrops:vector = GiftUpgradeVariants; + + +//@description Describes a bid in an auction +//@star_count The number of Telegram Stars that were put in the bid +//@bid_date Point in time (Unix timestamp) when the bid was made +//@position Position of the bid in the list of all bids +auctionBid star_count:int53 bid_date:int32 position:int32 = AuctionBid; + +//@description Describes a bid of the current user in an auction +//@star_count The number of Telegram Stars that were put in the bid +//@bid_date Point in time (Unix timestamp) when the bid was made +//@next_bid_star_count The minimum number of Telegram Stars that can be put for the next bid +//@owner_id Identifier of the user or the chat that will receive the auctioned item. If the auction is opened in context of another user or chat, then a warning is supposed to be shown to the current user +//@was_returned True, if the bid was returned to the user, because it was outbid and can't win anymore +userAuctionBid star_count:int53 bid_date:int32 next_bid_star_count:int53 owner_id:MessageSender was_returned:Bool = UserAuctionBid; + +//@description Describes a round of an auction +//@number 1-based number of the round +//@duration Duration of the round, in seconds +//@extend_time The number of seconds for which the round will be extended if there are changes in the top winners +//@top_winner_count The number of top winners who trigger round extension if changed +auctionRound number:int32 duration:int32 extend_time:int32 top_winner_count:int32 = AuctionRound; + + +//@class AuctionState @description Describes state of an auction + +//@description Contains information about an ongoing or scheduled auction +//@start_date Point in time (Unix timestamp) when the auction started or will start +//@end_date Point in time (Unix timestamp) when the auction will be ended +//@min_bid The minimum possible bid in the auction in Telegram Stars +//@bid_levels A sparse list of bids that were made in the auction +//@top_bidder_user_ids User identifiers of at most 3 users with the biggest bids +//@rounds Rounds of the auction in which their duration or extension rules are changed +//@current_round_end_date Point in time (Unix timestamp) when the current round will end +//@current_round_number 1-based number of the current round +//@total_round_count The total number of rounds +//@distributed_item_count The number of items that were purchased on the auction by all users +//@left_item_count The number of items that have to be distributed on the auction +//@acquired_item_count The number of items that were purchased by the current user on the auction +//@user_bid Bid of the current user in the auction; may be null if none +auctionStateActive start_date:int32 end_date:int32 min_bid:int53 bid_levels:vector top_bidder_user_ids:vector rounds:vector current_round_end_date:int32 current_round_number:int32 total_round_count:int32 distributed_item_count:int32 left_item_count:int32 acquired_item_count:int32 user_bid:userAuctionBid = AuctionState; + +//@description Contains information about a finished auction +//@start_date Point in time (Unix timestamp) when the auction started +//@end_date Point in time (Unix timestamp) when the auction will be ended +//@average_price Average price of bought items in Telegram Stars +//@acquired_item_count The number of items that were purchased by the current user on the auction +//@telegram_listed_item_count Number of items from the auction being resold on Telegram +//@fragment_listed_item_count Number of items from the auction being resold on Fragment +//@fragment_url The HTTPS link to the Fragment for the resold items; may be empty if there are no such items being sold on Fragment +auctionStateFinished start_date:int32 end_date:int32 average_price:int53 acquired_item_count:int32 telegram_listed_item_count:int32 fragment_listed_item_count:int32 fragment_url:string = AuctionState; + + +//@description Represent auction state of a gift +//@gift The gift +//@state Auction state of the gift +giftAuctionState gift:gift state:AuctionState = GiftAuctionState; + +//@description Represents a gift that was acquired by the current user on an auction +//@receiver_id Receiver of the gift +//@date Point in time (Unix timestamp) when the gift was acquired +//@star_count The number of Telegram Stars that were paid for the gift +//@auction_round_number Identifier of the auction round in which the gift was acquired +//@auction_round_position Position of the user in the round among all auction participants +//@unique_gift_number Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned +//@text Message added to the gift +//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them +giftAuctionAcquiredGift receiver_id:MessageSender date:int32 star_count:int53 auction_round_number:int32 auction_round_position:int32 unique_gift_number:int32 text:formattedText is_private:Bool = GiftAuctionAcquiredGift; + +//@description Represents a list of gifts that were acquired by the current user on an auction @gifts The list of acquired gifts +giftAuctionAcquiredGifts gifts:vector = GiftAuctionAcquiredGifts; + //@class TransactionDirection @description Describes direction of transactions in a transaction list @@ -1509,81 +1642,81 @@ transactionDirectionOutgoing = TransactionDirection; //@class StarTransactionType @description Describes type of transaction with Telegram Stars -//@description The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only +//@description The transaction is a deposit of Telegram Stars from the Premium bot; relevant for regular users only starTransactionTypePremiumBotDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from App Store; for regular users only +//@description The transaction is a deposit of Telegram Stars from App Store; relevant for regular users only starTransactionTypeAppStoreDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from Google Play; for regular users only +//@description The transaction is a deposit of Telegram Stars from Google Play; relevant for regular users only starTransactionTypeGooglePlayDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only +//@description The transaction is a deposit of Telegram Stars from Fragment; relevant for regular users and bots only starTransactionTypeFragmentDeposit = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars by another user; for regular users only +//@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 //@sticker The sticker to be shown in the transaction information; may be null if unknown starTransactionTypeUserDeposit user_id:int53 sticker:sticker = StarTransactionType; -//@description The transaction is a deposit of Telegram Stars from a giveaway; for regular users only +//@description The transaction is a deposit of Telegram Stars from a giveaway; relevant for regular users only //@chat_id Identifier of a supergroup or a channel chat that created the giveaway -//@giveaway_message_id Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message +//@giveaway_message_id Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message starTransactionTypeGiveawayDeposit chat_id:int53 giveaway_message_id:int53 = StarTransactionType; -//@description The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only +//@description The transaction is a withdrawal of earned Telegram Stars to Fragment; relevant for regular users, bots, supergroup and channel chats only //@withdrawal_state State of the withdrawal; may be null for refunds from Fragment starTransactionTypeFragmentWithdrawal withdrawal_state:RevenueWithdrawalState = StarTransactionType; -//@description The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only +//@description The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; relevant for bots and channel chats only starTransactionTypeTelegramAdsWithdrawal = StarTransactionType; -//@description The transaction is a payment for Telegram API usage; for bots only @request_count The number of billed requests +//@description The transaction is a payment for Telegram API usage; relevant for bots only @request_count The number of billed requests 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; for regular users only +//@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 //@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; for bots only +//@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 //@media The bought media //@payload Bot-provided payload //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotPaidMediaSale user_id:int53 media:vector payload:string affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a purchase of paid media from a channel by the current user; for regular users only +//@description The transaction is a purchase of paid media from a channel by the current user; relevant for regular users only //@chat_id Identifier of the channel chat that sent the paid media -//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@message_id Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message //@media The bought media if the transaction wasn't refunded starTransactionTypeChannelPaidMediaPurchase chat_id:int53 message_id:int53 media:vector = StarTransactionType; -//@description The transaction is a sale of paid media by the channel chat; for channel chats only +//@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 -//@message_id Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message +//@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; for regular users only +//@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 //@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; for bots only +//@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 //@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; for regular users only +//@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 //@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; for bots only +//@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 //@subscription_period The number of seconds between consecutive Telegram Star debitings //@product_info Information about the bought subscription @@ -1591,90 +1724,115 @@ starTransactionTypeBotSubscriptionPurchase user_id:int53 subscription_period:int //@affiliate Information about the affiliate which received commission from the transaction; may be null if none starTransactionTypeBotSubscriptionSale user_id:int53 subscription_period:int32 product_info:productInfo invoice_payload:bytes affiliate:affiliateInfo = StarTransactionType; -//@description The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only +//@description The transaction is a purchase of a subscription to a channel chat by the current user; relevant for regular users only //@chat_id Identifier of the channel chat that created the subscription //@subscription_period The number of seconds between consecutive Telegram Star debitings starTransactionTypeChannelSubscriptionPurchase chat_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a sale of a subscription by the channel chat; for channel chats only +//@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 //@subscription_period The number of seconds between consecutive Telegram Star debitings starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType; -//@description The transaction is a purchase of a regular gift; for regular users and bots only @owner_id Identifier of the user or the channel that received 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 that 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 starTransactionTypeGiftPurchase owner_id:MessageSender gift:gift = StarTransactionType; -//@description The transaction is a transfer of an upgraded gift; for regular users only @owner_id Identifier of the user or the channel that received the gift @gift The gift +//@description The transaction is an offer of gift purchase; relevant for regular users only @gift The gift +starTransactionTypeGiftPurchaseOffer gift:upgradedGift = StarTransactionType; + +//@description The transaction is a transfer of an upgraded gift; relevant for regular users only @owner_id Identifier of the user or the channel that received the gift @gift The gift starTransactionTypeGiftTransfer owner_id:MessageSender gift:upgradedGift = StarTransactionType; -//@description The transaction is a drop of original details of an upgraded gift; for regular users only @owner_id Identifier of the user or the channel that owns the gift @gift The gift +//@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; 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 that sent the gift @gift The gift starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; -//@description The transaction is an upgrade of a gift; 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 that 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; for regular users only @owner_id Owner of the upgraded gift @gift The gift +//@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; 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 that sold the gift @gift The gift starTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = StarTransactionType; -//@description The transaction is a sale of an upgraded gift; for regular users only +//@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 //@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 -starTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; +//@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; -//@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only +//@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; relevant for regular users only //@chat_id Identifier of the channel chat -//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +//@message_id Identifier of the reacted message; may be 0 or an identifier of a deleted message 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; for channel chats only +//@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 -//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message +//@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; -//@description The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only +//@description The transaction is a receiving of a commission from an affiliate program; relevant for regular users, bots and channel chats only //@chat_id Identifier of the chat that created the affiliate program //@commission_per_mille The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner starTransactionTypeAffiliateProgramCommission chat_id:int53 commission_per_mille:int32 = StarTransactionType; -//@description The transaction is a sending of a paid message; for regular users only @chat_id Identifier of the chat that received the payment @message_count Number of sent paid messages +//@description The transaction is a sending of a paid message; relevant for regular users only @chat_id Identifier of the chat that received the payment @message_count Number of sent paid messages starTransactionTypePaidMessageSend chat_id:int53 message_count:int32 = StarTransactionType; -//@description The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only +//@description The transaction is a receiving of a paid message; relevant for regular users, supergroup and channel chats only //@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 starTransactionTypePaidMessageReceive sender_id:MessageSender message_count:int32 commission_per_mille:int32 commission_star_amount:starAmount = StarTransactionType; -//@description The transaction is a payment for a suggested post; for regular users only +//@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 +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 +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 +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 +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 //@chat_id Identifier of the channel chat that posted the post starTransactionTypeSuggestedPostPaymentSend chat_id:int53 = StarTransactionType; -//@description The transaction is a receiving of a payment for a suggested post by the channel chat; for channel chats only +//@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 starTransactionTypeSuggestedPostPaymentReceive user_id:int53 = StarTransactionType; -//@description The transaction is a purchase of Telegram Premium subscription; for regular users and bots only +//@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 //@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; -//@description The transaction is a transfer of Telegram Stars to a business bot; for regular users only @user_id Identifier of the bot that received Telegram Stars +//@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; 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 that sent Telegram Stars starTransactionTypeBusinessBotTransferReceive user_id:int53 = StarTransactionType; -//@description The transaction is a payment for search of posts in public Telegram channels; for regular users only +//@description The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only starTransactionTypePublicPostSearch = StarTransactionType; //@description The transaction is a transaction of an unsupported type @@ -1703,18 +1861,25 @@ starTransactions star_amount:starAmount transactions:vector nex //@sticker The sticker to be shown in the transaction information; may be null if unknown tonTransactionTypeFragmentDeposit is_gift:Bool sticker:sticker = TonTransactionType; +//@description The transaction is a withdrawal of earned Toncoins to Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment +tonTransactionTypeFragmentWithdrawal withdrawal_state:RevenueWithdrawalState = TonTransactionType; + //@description The transaction is a payment for a suggested post @chat_id Identifier of the channel chat that posted the post tonTransactionTypeSuggestedPostPayment chat_id:int53 = TonTransactionType; -//@description The transaction is a purchase of an upgraded gift for some user or channel; for regular users only @user_id Identifier of the user that sold the gift @gift The gift +//@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 tonTransactionTypeUpgradedGiftPurchase user_id:int53 gift:upgradedGift = TonTransactionType; -//@description The transaction is a sale of an upgraded gift; for regular users only +//@description The transaction is a sale of an upgraded gift //@user_id Identifier of the user that 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 -tonTransactionTypeUpgradedGiftSale user_id:int53 gift:upgradedGift commission_per_mille:int32 commission_toncoin_amount:int53 = TonTransactionType; +//@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 transaction of an unsupported type tonTransactionTypeUnsupported = TonTransactionType; @@ -1735,6 +1900,18 @@ tonTransaction id:string ton_amount:int53 is_refund:Bool date:int32 type:TonTran tonTransactions ton_amount:int53 transactions:vector next_offset:string = TonTransactions; +//@class ActiveStoryState @description Describes state of active stories posted by a chat + +//@description The chat has an active live story @story_id Identifier of the active live story +activeStoryStateLive story_id:int32 = ActiveStoryState; + +//@description The chat has some unread active stories +activeStoryStateUnread = ActiveStoryState; + +//@description The chat has active stories, all of which were read +activeStoryStateRead = ActiveStoryState; + + //@class GiveawayParticipantStatus @description Contains information about status of a user in a giveaway //@description The user is eligible for the giveaway @@ -1854,8 +2031,9 @@ emojiStatusCustomEmojis custom_emoji_ids:vector = EmojiStatusCustomEmojis //@description Describes usernames assigned to a user, a supergroup, or a channel //@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames //@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive -//@editable_username Active or disabled username, which may be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo -usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; +//@editable_username Active or disabled username, which may be changed with setUsername or setSupergroupUsername +//@collectible_usernames Collectible usernames that were purchased at https://fragment.com and can be passed to getCollectibleItemInfo for more details +usernames active_usernames:vector disabled_usernames:vector editable_username:string collectible_usernames:vector = Usernames; //@description Represents a user @@ -1880,15 +2058,14 @@ usernames active_usernames:vector disabled_usernames:vector edit //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_info Information about restrictions that must be applied to the corresponding private chat; may be null if none -//@has_active_stories True, if the user has non-expired stories available to the current user -//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user +//@active_story_state State of active stories of the user; may be null if the user has no active stories //@restricts_new_chats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them //@paid_message_star_count Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_info:restrictionInfo has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool paid_message_star_count:int53 have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_info:restrictionInfo active_story_state:ActiveStoryState restricts_new_chats:Bool paid_message_star_count:int53 have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -2185,7 +2362,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@sign_messages True, if messages sent to the channel contains name of the sender. This field is only applicable to channels //@show_message_sender True, if messages sent to the channel have information about the sender user. This field is only applicable to channels //@join_to_send_messages True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups -//@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. Can be true only for non-broadcast supergroups with username, location, or a linked chat +//@join_by_request True, if all users directly joining the supergroup need to be approved by supergroup administrators. May be true only for non-broadcast supergroups with username, location, or a linked chat //@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup //@is_channel True, if the supergroup is a channel //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members @@ -2197,9 +2374,8 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@has_forum_tabs True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups //@restriction_info Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none //@paid_message_star_count Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message -//@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user -//@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user -supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_automatic_translation:Bool has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_direct_messages_group:Bool is_administered_direct_messages_group:Bool verification_status:verificationStatus has_direct_messages_group:Bool has_forum_tabs:Bool restriction_info:restrictionInfo paid_message_star_count:int53 has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; +//@active_story_state State of active stories of the supergroup or channel; may be null if there are no active stories +supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_automatic_translation:Bool has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_direct_messages_group:Bool is_administered_direct_messages_group:Bool verification_status:verificationStatus has_direct_messages_group:Bool has_forum_tabs:Bool restriction_info:restrictionInfo paid_message_star_count:int53 active_story_state:ActiveStoryState = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -2276,7 +2452,7 @@ secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_has //@next_free_query_in Amount of time till the next free query can be sent; 0 if it can be sent now //@star_count Number of Telegram Stars that must be paid for each non-free query //@is_current_query_free True, if the search for the specified query isn't charged -publicPostSearchLimits daily_free_query_count:int32 remaining_free_query_count:int32 next_free_query_in:int32 star_count:int64 is_current_query_free:Bool = PublicPostSearchLimits; +publicPostSearchLimits daily_free_query_count:int32 remaining_free_query_count:int32 next_free_query_in:int32 star_count:int53 is_current_query_free:Bool = PublicPostSearchLimits; //@class MessageSender @description Contains information about the sender of a message @@ -2384,7 +2560,12 @@ paidReactionTypeChat chat_id:int53 = PaidReactionType; //@is_top True, if the reactor is one of the most active reactors; may be false if the reactor is the current user //@is_me True, if the paid reaction was added by the current user //@is_anonymous True, if the reactor is anonymous -paidReactor sender_id:MessageSender star_count:int32 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; +paidReactor sender_id:MessageSender star_count:int53 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; + +//@description Contains a list of users and chats that spend most money on paid messages and reactions in a live story +//@total_star_count Total amount of spend Telegram Stars +//@top_donors List of top donors in the live story +liveStoryDonors total_star_count:int53 top_donors:vector = LiveStoryDonors; //@description Contains information about a forwarded message //@origin Origin of the forwarded message @@ -2507,7 +2688,7 @@ inputTextQuote text:formattedText position:int32 = InputTextQuote; //@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat //@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. //-Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, -//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, +//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, messageSticker, messageStory, //-messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote checklist_task_id:int32 origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; @@ -2566,7 +2747,7 @@ factCheck text:formattedText country_code:string = FactCheck; //@fact_check Information about fact-check added to the message; may be null if none //@suggested_post_info Information about the suggested post; may be null if the message isn't a suggested post //@reply_to Information about the message or the story this message is replying to; may be null if none -//@topic_id Identifier of the topic within the chat to which the message belongs; may be null if none +//@topic_id Identifier of the topic within the chat to which the message belongs; may be null if none; may change when the chat is converted to a forum or back //@self_destruct_type The message's self-destruct type; may be null if none //@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet //@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never @@ -2578,9 +2759,10 @@ factCheck text:formattedText country_code:string = FactCheck; //@media_album_id Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums //@effect_id Unique identifier of the effect added to the message; 0 if none //@restriction_info Information about the restrictions that must be applied to the message content; may be null if none +//@summary_language_code IETF language tag of the message language on which it can be summarized; empty if summary isn't available for the message //@content Content of the message //@reply_markup Reply markup for the message; may be null if none -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_ton_suggested_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_paid_star_suggested_post:Bool is_paid_ton_suggested_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck suggested_post_info:suggestedPostInfo reply_to:MessageReplyTo topic_id:MessageTopic self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 paid_message_star_count:int53 author_signature:string media_album_id:int64 effect_id:int64 restriction_info:restrictionInfo summary_language_code:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null @@ -3736,6 +3918,11 @@ linkPreviewTypeExternalAudio url:string mime_type:string duration:int32 = LinkPr //@duration Duration of the video, in seconds; 0 if unknown linkPreviewTypeExternalVideo url:string mime_type:string width:int32 height:int32 duration:int32 = LinkPreviewType; +//@description The link is a link to a gift auction +//@gift The gift +//@auction_end_date Point in time (Unix timestamp) when the auction will be ended +linkPreviewTypeGiftAuction gift:gift auction_end_date:int32 = LinkPreviewType; + //@description The link is a link to a gift collection @icons Icons for some gifts from the collection; may be empty linkPreviewTypeGiftCollection icons:vector = LinkPreviewType; @@ -3745,6 +3932,11 @@ linkPreviewTypeGroupCall = LinkPreviewType; //@description The link is a link to an invoice linkPreviewTypeInvoice = LinkPreviewType; +//@description The link is a link to a live story group call +//@story_poster_chat_id The identifier of the chat that posted the story +//@story_id Story identifier +linkPreviewTypeLiveStory story_poster_chat_id:int53 story_id:int32 = LinkPreviewType; + //@description The link is a link to a text or a poll Telegram message linkPreviewTypeMessage = LinkPreviewType; @@ -4439,7 +4631,7 @@ messageAnimatedEmoji animated_emoji:animatedEmoji emoji:string = 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 //@emoji Emoji on which the dice throw animation is based -//@value The dice value. If the value is 0, the dice don't have final state yet +//@value The dice value. If the value is 0, then the dice don't have final state yet //@success_animation_frame_number Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded messageDice initial_state:DiceStickers final_state:DiceStickers emoji:string value:int32 success_animation_frame_number:int32 = MessageContent; @@ -4449,6 +4641,14 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; +//@description A stake dice message. The dice value is randomly generated by the server +//@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 +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 //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Story identifier @@ -4581,7 +4781,7 @@ messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageConten //@description A payment has been sent to a bot or a business account //@invoice_chat_id Identifier of the chat, containing the corresponding invoice message -//@invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message +//@invoice_message_id Identifier of the message with the corresponding invoice; may be 0 or an identifier of a deleted message //@currency Currency for the price of the product //@total_amount Total price for the product, in the smallest units of the currency //@subscription_until_date Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn't recurring @@ -4620,9 +4820,10 @@ messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none //@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none -//@month_count Number of months the Telegram Premium subscription will be active +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedText currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; +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 @@ -4633,10 +4834,11 @@ messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 text:formattedT //@amount The paid amount, in the smallest units of the currency; 0 if unknown //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none or unknown //@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if unknown -//@month_count Number of months the Telegram Premium subscription will be active after code activation +//@month_count Number of months the Telegram Premium subscription will be active after code activation; 0 if the number of months isn't integer +//@day_count Number of days the Telegram Premium subscription will be active after code activation //@sticker A sticker to be shown in the message; may be null if unknown //@code The gift code -messagePremiumGiftCode creator_id:MessageSender text:formattedText is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; +messagePremiumGiftCode creator_id:MessageSender text:formattedText is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 day_count:int32 sticker:sticker code:string = MessageContent; //@description A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway //@star_count Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways @@ -4650,7 +4852,7 @@ messageGiveawayCreated star_count:int53 = MessageContent; messageGiveaway parameters:giveawayParameters winner_count:int32 prize:GiveawayPrize sticker:sticker = MessageContent; //@description A giveaway without public winners has been completed for the chat -//@giveaway_message_id Identifier of the message with the giveaway; can be 0 if the message was deleted +//@giveaway_message_id Identifier of the message with the giveaway; may be 0 or an identifier of a deleted message //@winner_count Number of winners in the giveaway //@is_star_giveaway True, if the giveaway is a Telegram Star giveaway //@unclaimed_prize_count Number of undistributed prizes; for Telegram Premium giveaways only @@ -4694,7 +4896,7 @@ messageGiftedTon gifter_user_id:int53 receiver_user_id:int53 ton_amount:int53 tr //@star_count Number of Telegram Stars that were received //@transaction_id Identifier of the transaction for Telegram Stars credit //@boosted_chat_id Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway -//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted +//@giveaway_message_id Identifier of the message with the giveaway in the boosted chat; may be 0 or an identifier of a deleted message //@is_unclaimed True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat //@sticker A sticker to be shown in the message; may be null if unknown messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent; @@ -4705,9 +4907,11 @@ messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id //@receiver_id Receiver of the gift //@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift //@text Message added to the gift +//@unique_gift_number Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned //@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver //@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift //@is_upgrade_separate True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost +//@is_from_auction True, if the message is a notification about a gift won on an auction //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_saved True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift //@is_prepaid_upgrade True, if the message is about prepaid upgrade of the gift by another user @@ -4717,7 +4921,7 @@ messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id //@was_refunded True, if the gift was refunded and isn't available anymore //@upgraded_received_gift_id Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift //@prepaid_upgrade_hash If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade -messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received_gift_id:string text:formattedText sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool is_private:Bool is_saved:Bool is_prepaid_upgrade:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgraded_received_gift_id:string prepaid_upgrade_hash:string = MessageContent; +messageGift gift:gift sender_id:MessageSender receiver_id:MessageSender received_gift_id:string text:formattedText unique_gift_number:int32 sell_star_count:int53 prepaid_upgrade_star_count:int53 is_upgrade_separate:Bool is_from_auction:Bool is_private:Bool is_saved:Bool is_prepaid_upgrade:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgraded_received_gift_id:string prepaid_upgrade_hash:string = MessageContent; //@description An upgraded gift was received or sent by the current user, or the current user was notified about a channel gift //@gift The gift @@ -4742,6 +4946,20 @@ messageUpgradedGift gift:upgradedGift sender_id:MessageSender receiver_id:Messag //@origin Origin of the upgraded gift messageRefundedUpgradedGift gift:gift sender_id:MessageSender receiver_id:MessageSender origin:UpgradedGiftOrigin = MessageContent; +//@description An offer to purchase an upgraded gift was sent or received +//@gift The gift +//@state State of the offer +//@price The proposed price +//@expiration_date Point in time (Unix timestamp) when the offer will expire or has expired +messageUpgradedGiftPurchaseOffer gift:upgradedGift state:GiftPurchaseOfferState price:GiftResalePrice expiration_date:int32 = MessageContent; + +//@description An offer to purchase a gift was rejected or expired +//@gift The gift +//@price The proposed price +//@offer_message_id Identifier of the message with purchase offer which was rejected or expired; may be 0 or an identifier of a deleted message +//@was_expired True, if the offer has expired; otherwise, the offer was explicitly rejected +messageUpgradedGiftPurchaseOfferRejected gift:upgradedGift price:GiftResalePrice offer_message_id:int53 was_expired:Bool = MessageContent; + //@description Paid messages were refunded @message_count The number of refunded messages @star_count The number of refunded Telegram Stars messagePaidMessagesRefunded message_count:int32 star_count:int53 = MessageContent; @@ -4755,40 +4973,40 @@ messagePaidMessagePriceChanged paid_message_star_count:int53 = MessageContent; messageDirectMessagePriceChanged is_enabled:Bool paid_message_star_count:int53 = MessageContent; //@description Some tasks from a checklist were marked as done or not done -//@checklist_message_id Identifier of the message with the checklist; can be 0 if the message was deleted +//@checklist_message_id Identifier of the message with the checklist; may be 0 or an identifier of a deleted message //@marked_as_done_task_ids Identifiers of tasks that were marked as done //@marked_as_not_done_task_ids Identifiers of tasks that were marked as not done messageChecklistTasksDone checklist_message_id:int53 marked_as_done_task_ids:vector marked_as_not_done_task_ids:vector = MessageContent; //@description Some tasks were added to a checklist -//@checklist_message_id Identifier of the message with the checklist; can be 0 if the message was deleted +//@checklist_message_id Identifier of the message with the checklist; may be 0 or an identifier of a deleted message //@tasks List of tasks added to the checklist messageChecklistTasksAdded checklist_message_id:int53 tasks:vector = MessageContent; //@description Approval of suggested post has failed, because the user which proposed the post had no enough funds -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@price Price of the suggested post messageSuggestedPostApprovalFailed suggested_post_message_id:int53 price:SuggestedPostPrice = MessageContent; //@description A suggested post was approved -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@price Price of the suggested post; may be null if the post is non-paid //@send_date Point in time (Unix timestamp) when the post is expected to be published messageSuggestedPostApproved suggested_post_message_id:int53 price:SuggestedPostPrice send_date:int32 = MessageContent; //@description A suggested post was declined -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@comment Comment added by administrator of the channel when the post was declined messageSuggestedPostDeclined suggested_post_message_id:int53 comment:string = MessageContent; //@description A suggested post was published for getOption("suggested_post_lifetime_min") seconds and payment for the post was received -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@star_amount The amount of received Telegram Stars //@ton_amount The amount of received Toncoins; in the smallest units of the cryptocurrency messageSuggestedPostPaid suggested_post_message_id:int53 star_amount:starAmount ton_amount:int53 = MessageContent; //@description A suggested post was refunded -//@suggested_post_message_id Identifier of the message with the suggested post; can be 0 if the message was deleted +//@suggested_post_message_id Identifier of the message with the suggested post; may be 0 or an identifier of a deleted message //@reason Reason of the refund messageSuggestedPostRefunded suggested_post_message_id:int53 reason:SuggestedPostRefundReason = MessageContent; @@ -4924,8 +5142,11 @@ inputPaidMedia type:InputPaidMediaType media:InputFile thumbnail:inputThumbnail //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent -//@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future -messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; +//@description The message will be sent at the specified date +//@send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future +//@repeat_period Period after which the message will be sent again; in seconds; 0 if never; for Telegram Premium users only; may be non-zero only in sendMessage and forwardMessages with one message requests; +//-must be one of 0, 86400, 7 * 86400, 14 * 86400, 30 * 86400, 91 * 86400, 182 * 86400, 365 * 86400, or additionally 60, or 300 in the Test DC +messageSchedulingStateSendAtDate send_date:int32 repeat_period:int32 = MessageSchedulingState; //@description The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known messageSchedulingStateSendWhenOnline = MessageSchedulingState; @@ -4954,7 +5175,7 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, //-live location messages and self-destructing messages can't be scheduled -//@effect_id Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats +//@effect_id Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage, sendMessageAlbum in private chats and forwardMessages with one message to private chats //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates //@only_preview Pass true to get a fake message instead of actually sending them messageSendOptions suggested_post_info:inputSuggestedPostInfo disable_notification:Bool from_background:Bool protect_content:Bool allow_paid_broadcast:Bool paid_message_star_count:int53 update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; @@ -4974,7 +5195,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, //-Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@link_preview_options Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options -//@clear_draft True, if a chat message draft must be deleted +//@clear_draft True, if the chat message draft must be deleted inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). @@ -5110,6 +5331,13 @@ inputMessageInvoice invoice:invoice title:string description:string photo_url:st //@is_closed True, if the poll needs to be sent already closed; for bots only inputMessagePoll question:formattedText options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +//@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 +//-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; + //@description A message with a forwarded story. Stories can't be forwarded to secret chats. A story can be forwarded only if story.can_be_forwarded //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Story identifier @@ -5523,6 +5751,11 @@ storyContentPhoto photo:photo = StoryContent; //@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent; +//@description A live story +//@group_call_id Identifier of the corresponding group call. The group call can be received through the method getGroupCall +//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary group call +storyContentLive group_call_id:int32 is_rtmp_stream:Bool = StoryContent; + //@description A story content that is not supported in the current TDLib version storyContentUnsupported = StoryContent; @@ -5583,11 +5816,12 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@is_edited True, if the story was edited //@is_posted_to_chat_page True, if the story is saved in the profile of the chat that posted it and will be available there after expiration //@is_visible_only_for_self True, if the story is visible only for the current user -//@can_be_added_to_album True, if the story can be added to an album +//@can_be_added_to_album True, if the story can be added to an album using createStoryAlbum and addStoryAlbumStories //@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_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 //@can_get_interactions True, if interactions with the story can be received through getStoryInteractions @@ -5600,7 +5834,7 @@ storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 r //@areas Clickable areas to be shown on the story content //@caption Caption of the story //@album_ids Identifiers of story albums to which the story is added; only for manageable stories -story id:int32 poster_chat_id:int53 poster_id:MessageSender date:int32 is_being_posted:Bool is_being_edited:Bool is_edited:Bool is_posted_to_chat_page:Bool is_visible_only_for_self:Bool can_be_added_to_album:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_posted_to_chat_page:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText album_ids:vector = Story; +story id:int32 poster_chat_id:int53 poster_id:MessageSender date:int32 is_being_posted:Bool is_being_edited:Bool is_edited:Bool is_posted_to_chat_page:Bool is_visible_only_for_self:Bool can_be_added_to_album:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_set_privacy_settings:Bool can_toggle_is_posted_to_chat_page:Bool can_get_statistics:Bool can_get_interactions:Bool has_expired_viewers:Bool repost_info:storyRepostInfo interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText album_ids:vector = Story; //@description Represents a list of stories //@total_count Approximate total number of stories found @@ -5630,7 +5864,8 @@ storyFullId poster_chat_id:int53 story_id:int32 = StoryFullId; //@story_id Unique story identifier among stories of the chat //@date Point in time (Unix timestamp) when the story was published //@is_for_close_friends True, if the story is available only to close friends -storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; +//@is_live True, if the story is a live story +storyInfo story_id:int32 date:int32 is_for_close_friends:Bool is_live:Bool = StoryInfo; //@description Describes active stories posted by a chat //@chat_id Identifier of the chat that posted the stories @@ -5711,7 +5946,7 @@ publicForwards total_count:int32 forwards:vector next_offset:stri //@description Describes media previews of a bot //@date Point in time (Unix timestamp) when the preview was added or changed last time -//@content Content of the preview +//@content Content of the preview; may only be of the types storyContentPhoto, storyContentVideo, or storyContentUnsupported botMediaPreview date:int32 content:StoryContent = BotMediaPreview; //@description Contains a list of media previews of a bot @previews List of media previews @@ -5944,14 +6179,14 @@ groupCallVideoQualityMedium = GroupCallVideoQuality; groupCallVideoQualityFull = GroupCallVideoQuality; -//@description Describes an available stream in a video chat +//@description Describes an available stream in a video chat or a live story //@channel_id Identifier of an audio/video channel //@scale Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds //@time_offset Point in time when the stream currently ends; Unix timestamp in milliseconds -videoChatStream channel_id:int32 scale:int32 time_offset:int53 = VideoChatStream; +groupCallStream channel_id:int32 scale:int32 time_offset:int53 = GroupCallStream; -//@description Represents a list of video chat streams @streams A list of video chat streams -videoChatStreams streams:vector = VideoChatStreams; +//@description Represents a list of group call streams @streams A list of group call streams +groupCallStreams streams:vector = GroupCallStreams; //@description Represents an RTMP URL @url The URL @stream_key Stream key rtmpUrl url:string stream_key:string = RtmpUrl; @@ -5963,31 +6198,37 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall //@description Describes a group call //@id 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 +//@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 +//@paid_message_star_count The minimum number of Telegram Stars that must be paid by general participant for each sent message to the call; for live stories only //@scheduled_start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended; for video chats only //@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts; for video chats only //@is_active True, if the call is active //@is_video_chat True, if the call is bound to a chat -//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only +//@is_live_story True, if the call is a live story of a chat +//@is_rtmp_stream True, if the call is an RTMP stream instead of an ordinary video chat; for video chats and live stories only //@is_joined True, if the call is joined //@need_rejoin True, if user was kicked from the call because of network loss and the call needs to be rejoined //@is_owned True, if the user is the owner of the call and can end the call, change volume level of other users, or ban users there; for group calls that aren't bound to a chat -//@can_be_managed True, if the current user can manage the group call; for video chats only +//@can_be_managed True, if the current user can manage the group call; for video chats and live stories only //@participant_count Number of participants in the group call //@has_hidden_listeners True, if group call participants, which are muted, aren't returned in participant list; for video chats only //@loaded_all_participants True, if all group call participants are loaded +//@message_sender_id Message sender chosen to send messages to the group call; for live stories only; may be null if the call isn't a live story //@recent_speakers At most 3 recently speaking users in the group call //@is_my_video_enabled True, if the current user's video is enabled //@is_my_video_paused True, if the current user's video is paused //@can_enable_video True, if the current user can broadcast video or share screen //@mute_new_participants True, if only group call administrators can unmute new participants; for video chats only //@can_toggle_mute_new_participants True, if the current user can enable or disable mute_new_participants setting; for video chats only -//@can_send_messages True, if users can send messages to the group call -//@can_toggle_can_send_messages True, if the current user can enable or disable sending messages in the group call +//@can_send_messages True, if the current user can send messages to the group call +//@are_messages_allowed True, if sending of messages is allowed in the group call +//@can_toggle_are_messages_allowed True, if the current user can enable or disable sending of messages in the group call +//@can_delete_messages True, if the user can delete messages in the group call //@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 scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_video_chat: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 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 can_toggle_can_send_messages:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall; +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; //@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; @@ -6025,6 +6266,26 @@ groupCallParticipants total_count:int32 participant_ids:vector = //@description Contains information about a just created or just joined group call @group_call_id Identifier of the group call @join_payload Join response payload for tgcalls; empty if the call isn't joined groupCallInfo group_call_id:int32 join_payload:string = GroupCallInfo; +//@description Represents a message sent in a group call +//@message_id Unique message identifier within the group call +//@sender_id Identifier of the sender of the message +//@date Point in time (Unix timestamp) when the message was sent +//@text Text of the message. If empty, then the message is a paid reaction in a live story +//@paid_message_star_count The number of Telegram Stars that were paid to send the message; for live stories only +//@is_from_owner True, if the message is sent by the owner of the call and must be treated as a message of the maximum level; for live stories only +//@can_be_deleted True, if the message can be deleted by the current user; for live stories only +groupCallMessage message_id:int32 sender_id:MessageSender date:int32 text:formattedText paid_message_star_count:int53 is_from_owner:Bool can_be_deleted:Bool = GroupCallMessage; + +//@description Represents a level of features for a message sent in a live story group call +//@min_star_count The minimum number of Telegram Stars required to get features of the level +//@pin_duration The amount of time the message of this level will be pinned, in seconds +//@max_text_length The maximum allowed length of the message text +//@max_custom_emoji_count The maximum allowed number of custom emoji in the message text +//@first_color The first color used to show the message text in the RGB format +//@second_color The second color used to show the message text in the RGB format +//@background_color Background color for the message the RGB format +groupCallMessageLevel min_star_count:int53 pin_duration:int32 max_text_length:int32 max_custom_emoji_count:int32 first_color:int32 second_color:int32 background_color:int32 = GroupCallMessageLevel; + //@class InviteGroupCallParticipantResult @description Describes result of group call participant invitation @@ -6946,6 +7207,9 @@ premiumFeatureMessageEffects = PremiumFeature; //@description The ability to create and use checklist messages premiumFeatureChecklists = PremiumFeature; +//@description The ability to require a payment for incoming messages in new chats +premiumFeaturePaidMessages = PremiumFeature; + //@class BusinessFeature @description Describes a feature available to Business user accounts @@ -7335,6 +7599,18 @@ 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 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 +canPostStoryResultLiveStoryIsActive story_id:int32 = CanPostStoryResult; + + +//@class StartLiveStoryResult @description Represents result of starting a live story + +//@description The live story was successfully posted @story The live story +startLiveStoryResultOk story:story = StartLiveStoryResult; + +//@description The live story failed to post with an error to be handled @error_type Type of the error; other error types may be returned as regular errors +startLiveStoryResultFail error_type:CanPostStoryResult = StartLiveStoryResult; + //@class CanTransferOwnershipResult @description Represents result of checking whether the current session can be used to transfer a chat ownership to another user @@ -7760,6 +8036,9 @@ userPrivacySettingShowBio = UserPrivacySetting; //@description A privacy setting for managing whether the user's birthdate is visible userPrivacySettingShowBirthdate = UserPrivacySetting; +//@description A privacy setting for managing whether the user's profile audio files are visible +userPrivacySettingShowProfileAudio = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -8082,6 +8361,10 @@ internalLinkTypeEditProfileSettings = InternalLinkType; //@game_short_name Short name of the game internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; +//@description The link is a link to a gift auction. Call getGiftAuctionState with the given auction identifier to process the link +//@auction_id Unique identifier of the auction +internalLinkTypeGiftAuction auction_id:string = InternalLinkType; + //@description The link is a link to a gift collection. Call searchPublicChat with the given username, then call getReceivedGifts with the received gift owner identifier //-and the given collection identifier, then show the collection if received //@gift_owner_username Username of the owner of the gift collection @@ -8110,6 +8393,14 @@ 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, @@ -8145,12 +8436,18 @@ 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; @@ -8612,6 +8909,13 @@ suggestedActionExtendStarSubscriptions = SuggestedAction; //@url The link to open when the suggestion is clicked suggestedActionCustom name:string title:formattedText description:formattedText url:string = SuggestedAction; +//@description Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address +//@can_be_hidden True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the app without setting up the email address +suggestedActionSetLoginEmailAddress can_be_hidden:Bool = SuggestedAction; + +//@description Suggests the user to add a passkey for login using addLoginPasskey +suggestedActionAddLoginPasskey = SuggestedAction; + //@description Contains a counter @count Count count count:int32 = Count; @@ -9187,7 +9491,8 @@ updateForumTopicInfo info:forumTopicInfo = Update; //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic //@notification_settings Notification settings for the topic -updateForumTopic chat_id:int53 forum_topic_id:int32 is_pinned:Bool last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings = Update; +//@draft_message A draft of a message in the topic; may be null if none +updateForumTopic chat_id:int53 forum_topic_id:int32 is_pinned:Bool last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = Update; //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; @@ -9340,15 +9645,38 @@ updateGroupCallParticipants group_call_id:int32 participant_user_ids:vector = Update; -//@description A new message was received in a group call. It must be shown for at most getOption("group_call_message_show_time_max") seconds after receiving +//@description A new message was received in a group call @group_call_id Identifier of the group call @message The message +updateNewGroupCallMessage group_call_id:int32 message:groupCallMessage = Update; + +//@description A new paid reaction was received in a live story group call //@group_call_id Identifier of the group call -//@sender_id Identifier of the sender of the message -//@text Text of the message -updateGroupCallNewMessage group_call_id:int32 sender_id:MessageSender text:formattedText = Update; +//@sender_id Identifier of the sender of the reaction +//@star_count The number of Telegram Stars that were paid to send the reaction +updateNewGroupCallPaidReaction group_call_id:int32 sender_id:MessageSender star_count:int53 = Update; + +//@description A group call message failed to send +//@group_call_id Identifier of the group call +//@message_id Message identifier +//@error The cause of the message sending failure +updateGroupCallMessageSendFailed group_call_id:int32 message_id:int32 error:error = Update; + +//@description Some group call messages were deleted +//@group_call_id Identifier of the group call +//@message_ids Identifiers of the deleted messages +updateGroupCallMessagesDeleted group_call_id:int32 message_ids:vector = Update; + +//@description The list of top donors in live story group call has changed @group_call_id Identifier of the group call @donors New list of live story donors +updateLiveStoryTopDonors group_call_id:int32 donors:liveStoryDonors = Update; //@description New call signaling data arrived @call_id The call identifier @data The data updateNewCallSignalingData call_id:int32 data:bytes = Update; +//@description State of a gift auction was updated @state New state of the auction +updateGiftAuctionState state:giftAuctionState = Update; + +//@description The list of auctions in which participate the current user has changed @states New states of the auctions +updateActiveGiftAuctions states:vector = Update; + //@description Some privacy setting rules have been changed @setting The privacy setting @rules New privacy rules updateUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRules = Update; @@ -9394,6 +9722,10 @@ updateStoryListChatCount story_list:StoryList chat_count:int32 = Update; //@cooldown_until_date Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown updateStoryStealthMode active_until_date:int32 cooldown_until_date:int32 = Update; +//@description Lists of bots which Mini Apps must be allowed to read text from clipboard and must be opened without a warning +//@bot_user_ids List of user identifiers of the bots; the corresponding users may not be sent using updateUser updates and may not be accessible +updateTrustedMiniAppBots bot_user_ids:vector = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -9514,9 +9846,15 @@ updateTonRevenueStatus status:tonRevenueStatus = Update; //@next_reset_date Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown updateSpeechRecognitionTrial max_media_duration:int32 weekly_count:int32 left_count:int32 next_reset_date:int32 = Update; +//@description The levels of live story group call messages have changed @levels New description of the levels in decreasing order of groupCallMessageLevel.min_star_count +updateGroupCallMessageLevels levels:vector = Update; + //@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis updateDiceEmojis emojis:vector = Update; +//@description The stake dice state has changed @state The new state. The state can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState +updateStakeDiceState state:stakeDiceState = Update; + //@description Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played //@chat_id Chat identifier //@message_id Message identifier @@ -9782,6 +10120,19 @@ checkAuthenticationCode code:string = Ok; //@other_user_ids List of user identifiers of other users currently using the application requestQrCodeAuthentication other_user_ids:vector = Ok; +//@description Returns parameters for authentication using a passkey as JSON-serialized string +getAuthenticationPasskeyParameters = Text; + +//@description Checks a passkey to log in to the corresponding account. Call getAuthenticationPasskeyParameters to get parameters for the passkey. Works only when the current authorization state is +//-authorizationStateWaitPhoneNumber or authorizationStateWaitOtherDeviceConfirmation, or if there is no pending authentication query and the current authorization state is +//-authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword +//@credential_id Base64url-encoded identifier of the credential +//@client_data JSON-encoded client data +//@authenticator_data Authenticator data of the application that created the credential +//@signature Cryptographic signature of the credential +//@user_handle User handle of the passkey +checkAuthenticationPasskey credential_id:string client_data:string authenticator_data:bytes signature:bytes user_handle:bytes = Ok; + //@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration //@first_name The first name of the user; 1-64 characters //@last_name The last name of the user; 0-64 characters @@ -9851,8 +10202,12 @@ getPasswordState = PasswordState; //@new_recovery_email_address New recovery email address; may be empty setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; -//@description Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty. -//-The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly +//@description Checks whether the current user is required to set login email address +isLoginEmailAddressRequired = Ok; + +//@description Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty, +//-or the user received suggestedActionSetLoginEmailAddress and isLoginEmailAddressRequired succeeds. The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. +//-To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly //@new_login_email_address New login email address setLoginEmailAddress new_login_email_address:string = EmailAddressAuthenticationCodeInfo; @@ -9947,6 +10302,7 @@ getMessageLocally chat_id:int53 message_id:int53 = Message; //-the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information //-for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, //-the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, +//-the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, //-and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message @@ -10459,13 +10815,15 @@ translateText text:formattedText to_language_code:string = FormattedText; //@description Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@to_language_code Language code of the language to which the message is translated. Must be one of -//-"af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", -//-"fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", -//-"ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", -//-"st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" +//@to_language_code Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; +//@description Summarizes content of the message with non-empty summary_language_code +//@chat_id Identifier of the chat to which the message belongs +//@message_id Identifier of the message +//@translate_to_language_code Pass a language code to which the summary will be translated; may be empty if translation isn't needed. See translateText.to_language_code for the list of supported values +summarizeMessage chat_id:int53 message_id:int53 translate_to_language_code:string = FormattedText; + //@description Recognizes speech in a video note or a voice note message //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable @@ -10808,7 +11166,7 @@ setBusinessAccountGiftSettings business_connection_id:string settings:giftSettin //@description Returns the amount of Telegram Stars owned by a business account; for bots only @business_connection_id Unique identifier of business connection getBusinessAccountStarAmount business_connection_id:string = StarAmount; -//@description Transfer Telegram Stars from the business account to the business bot; for bots only +//@description Transfers Telegram Stars from the business account to the business bot; for bots only //@business_connection_id Unique identifier of business connection //@star_count Number of Telegram Stars to transfer transferBusinessAccountStars business_connection_id:string star_count:int53 = Ok; @@ -10973,6 +11331,21 @@ readAllForumTopicReactions chat_id:int53 forum_topic_id:int32 = Ok; unpinAllForumTopicMessages chat_id:int53 forum_topic_id:int32 = Ok; +//@description Returns parameters for creating of a new passkey as JSON-serialized string +getPasskeyParameters = Text; + +//@description Adds a passkey allowed to be used for the login by the current user and returns the added passkey. Call getPasskeyParameters to get parameters for creating of the passkey +//@client_data JSON-encoded client data +//@attestation_object Passkey attestation object +addLoginPasskey client_data:string attestation_object:bytes = Passkey; + +//@description Returns the list of passkeys allowed to be used for the login by the current user +getLoginPasskeys = Passkeys; + +//@description Removes a passkey from the list of passkeys allowed to be used for the login by the current user @passkey_id Unique identifier of the passkey to remove +removeLoginPasskey passkey_id:string = Ok; + + //@description Returns information about an emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction getEmojiReaction emoji:string = EmojiReaction; @@ -11701,6 +12074,10 @@ getChatAdministrators chat_id:int53 = ChatAdministrators; clearAllDraftMessages exclude_secret_chats:Bool = Ok; +//@description Returns the current state of stake dice +getStakeDiceState = StakeDiceState; + + //@description Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier @notification_sound_id Identifier of the notification sound getSavedNotificationSound notification_sound_id:int64 = NotificationSounds; @@ -11741,7 +12118,7 @@ toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; -//@description Traverse all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read +//@description Traverses all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read readChatList chat_list:ChatList = Ok; @@ -11768,13 +12145,22 @@ canPostStory chat_id:int53 = CanPostStoryResult; //@areas Clickable rectangle areas to be shown on the story media; pass null if none //@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") //@privacy_settings The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats -//@album_ids Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_story_count_max") +//@album_ids Identifiers of story albums to which the story will be added upon posting. An album can have up to getOption("story_album_size_max") stories //@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise //@from_story_full_id Full identifier of the original story, which content was used to create the story; pass null if the story isn't repost of another story //@is_posted_to_chat_page Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting postStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings album_ids:vector active_period:int32 from_story_full_id:storyFullId is_posted_to_chat_page:Bool protect_content:Bool = Story; +//@description Starts a new live story on behalf of a chat; requires can_post_stories administrator right for channel chats +//@chat_id Identifier of the chat that will start the live story. Pass Saved Messages chat identifier when starting a live story on behalf of the current user, or a channel chat identifier +//@privacy_settings The privacy settings for the story; ignored for stories posted on behalf of channel chats +//@protect_content Pass true if the content of the story must be protected from screenshotting +//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary group call +//@enable_messages Pass true to allow viewers of the story to send messages +//@paid_message_star_count The minimum number of Telegram Stars that must be paid by viewers for each sent message to the call; 0-getOption("paid_group_call_message_star_count_max") +startLiveStory chat_id:int53 privacy_settings:StoryPrivacySettings protect_content:Bool is_rtmp_stream:Bool enable_messages:Bool paid_message_star_count:int53 = StartLiveStoryResult; + //@description Changes content and caption of a story. Can be called only if story.can_be_edited == true //@story_poster_chat_id Identifier of the chat that posted the story //@story_id Identifier of the story to edit @@ -11789,7 +12175,7 @@ editStory story_poster_chat_id:int53 story_id:int32 content:InputStoryContent ar //@cover_frame_timestamp New timestamp of the frame, which will be used as video thumbnail editStoryCover story_poster_chat_id:int53 story_id:int32 cover_frame_timestamp:double = Ok; -//@description Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true +//@description Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_set_privacy_settings == true //@story_id Identifier of the story //@privacy_settings The new privacy settings for the story setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; @@ -11853,7 +12239,7 @@ closeStory story_poster_chat_id:int53 story_id:int32 = Ok; //@description Returns reactions, which can be chosen for a story @row_size Number of reaction per row, 5-25 getStoryAvailableReactions row_size:int32 = AvailableReactions; -//@description Changes chosen reaction on a story that has already been sent +//@description Changes chosen reaction on a story that has already been sent; not supported for live stories //@story_poster_chat_id The identifier of the poster of the story //@story_id The identifier of the story //@reaction_type Type of the reaction to set; pass null to remove the reaction. Custom emoji reactions can be used only by Telegram Premium users. Paid reactions can't be set @@ -11911,7 +12297,7 @@ getStoryAlbumStories chat_id:int53 story_album_id:int32 offset:int32 limit:int32 //@description Creates an album of stories; requires can_edit_stories administrator right for supergroup and channel chats //@story_poster_chat_id Identifier of the chat that posted the stories //@name Name of the album; 1-12 characters -//@story_ids Identifiers of stories to add to the album; 0-getOption("story_album_story_count_max") identifiers +//@story_ids Identifiers of stories to add to the album; 0-getOption("story_album_size_max") identifiers createStoryAlbum story_poster_chat_id:int53 name:string story_ids:vector = StoryAlbum; //@description Changes order of story albums. If the albums are owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat @@ -11934,8 +12320,8 @@ setStoryAlbumName chat_id:int53 story_album_id:int32 name:string = StoryAlbum; //-requires can_edit_stories administrator right in the chat. Returns the changed album //@chat_id Identifier of the chat that owns the stories //@story_album_id Identifier of the story album -//@story_ids Identifier of the stories to add to the album; 1-getOption("story_album_story_count_max") identifiers. -//-If after addition the album has more than getOption("story_album_story_count_max") stories, then the last one are removed from the album +//@story_ids Identifier of the stories to add to the album; 1-getOption("story_album_size_max") identifiers. +//-If after addition the album has more than getOption("story_album_size_max") stories, then the last one are removed from the album addStoryAlbumStories chat_id:int53 story_album_id:int32 story_ids:vector = StoryAlbum; //@description Removes stories from an album. If the album is owned by a supergroup or a channel chat, then @@ -12045,7 +12431,7 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok; //@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is expected to be saved getSuggestedFileName file_id:int32 directory:string = Text; -//@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. +//@description Preliminarily uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. //-In all other cases there is no need to preliminary upload a file. Updates updateFile will be used to notify about upload progress. //-The upload will not be completed until the file is sent in a message //@file File to upload @@ -12116,7 +12502,7 @@ removeAllFilesFromDownloads only_active:Bool only_completed:Bool delete_from_cac searchFileDownloads query:string only_active:Bool only_completed:Bool offset:string limit:int32 = FoundFileDownloads; -//@description Application or reCAPTCHA verification has been completed. Can be called before authorization +//@description Informs TDLib that application or reCAPTCHA verification has been completed. Can be called before authorization //@verification_id Unique identifier for the verification process as received from updateApplicationVerificationRequired or updateApplicationRecaptchaVerificationRequired //@token Play Integrity API token for the Android application, or secret from push notification for the iOS application for application verification, or reCAPTCHA token for reCAPTCHA verifications; //-pass an empty string to abort verification and receive the error "VERIFICATION_FAILED" for the request @@ -12248,7 +12634,7 @@ approveSuggestedPost chat_id:int53 message_id:int53 send_date:int32 = Ok; //@comment Comment for the creator of the suggested post; 0-128 characters declineSuggestedPost chat_id:int53 message_id:int53 comment:string = Ok; -//@description Sent a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. +//@description Sends a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest price or time change for an existing suggested post. //-Returns the sent message //@chat_id Identifier of the channel direct messages chat //@message_id Identifier of the message in the chat which will be sent as suggested post. Use messageProperties.can_add_offer to check whether an offer can be added @@ -12295,7 +12681,9 @@ sendCallLog call_id:int32 log_file:InputFile = Ok; //@description Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined @chat_id Chat identifier getVideoChatAvailableParticipants chat_id:int53 = MessageSenders; -//@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined @chat_id Chat identifier @default_participant_id Default group call participant identifier to join the video chats +//@description Changes default participant identifier, on whose behalf a video chat in the chat will be joined +//@chat_id Chat identifier +//@default_participant_id Default group call participant identifier to join the video chats in the chat setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSender = Ok; //@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right @@ -12314,6 +12702,12 @@ getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; //@description Replaces the current RTMP URL for streaming to the video chat of a chat; requires owner privileges in the chat @chat_id Chat identifier replaceVideoChatRtmpUrl chat_id:int53 = RtmpUrl; +//@description Returns RTMP URL for streaming to a live story; requires can_post_stories administrator right for channel chats @chat_id Chat identifier +getLiveStoryRtmpUrl chat_id:int53 = RtmpUrl; + +//@description Replaces the current RTMP URL for streaming to a live story; requires owner privileges for channel chats @chat_id Chat identifier +replaceLiveStoryRtmpUrl chat_id:int53 = RtmpUrl; + //@description Returns information about a group call @group_call_id Group call identifier getGroupCall group_call_id:int32 = GroupCall; @@ -12325,26 +12719,31 @@ startScheduledVideoChat group_call_id:int32 = Ok; //@enabled_start_notification New value of the enabled_start_notification setting toggleVideoChatEnabledStartNotification group_call_id:int32 enabled_start_notification:Bool = Ok; -//@description Joins a group call that is not bound to a chat @input_group_call The group call to join @join_parameters Parameters to join the call +//@description Joins a regular group call that is not bound to a chat @input_group_call The group call to join @join_parameters Parameters to join the call joinGroupCall input_group_call:InputGroupCall join_parameters:groupCallJoinParameters = GroupCallInfo; //@description Joins an active video chat. Returns join response payload for tgcalls //@group_call_id Group call identifier -//@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only +//@participant_id Identifier of a group call participant, which will be used to join the call; pass null to join as self //@join_parameters Parameters to join the call //@invite_hash Invite hash as received from internalLinkTypeVideoChat joinVideoChat group_call_id:int32 participant_id:MessageSender join_parameters:groupCallJoinParameters invite_hash:string = Text; -//@description Starts screen sharing in a joined group call. Returns join response payload for tgcalls +//@description Joins a group call of an active live story. Returns join response payload for tgcalls +//@group_call_id Group call identifier +//@join_parameters Parameters to join the call +joinLiveStory group_call_id:int32 join_parameters:groupCallJoinParameters = Text; + +//@description Starts screen sharing in a joined group call; not supported in live stories. Returns join response payload for tgcalls //@group_call_id Group call identifier //@audio_source_id Screen sharing audio channel synchronization source identifier; received from tgcalls //@payload Group call join payload; received from tgcalls startGroupCallScreenSharing group_call_id:int32 audio_source_id:int32 payload:string = Text; -//@description Pauses or unpauses screen sharing in a joined group call @group_call_id Group call identifier @is_paused Pass true to pause screen sharing; pass false to unpause it +//@description Pauses or unpauses screen sharing in a joined group call; not supported in live stories @group_call_id Group call identifier @is_paused Pass true to pause screen sharing; pass false to unpause it toggleGroupCallScreenSharingIsPaused group_call_id:int32 is_paused:Bool = Ok; -//@description Ends screen sharing in a joined group call @group_call_id Group call identifier +//@description Ends screen sharing in a joined group call; not supported in live stories @group_call_id Group call identifier endGroupCallScreenSharing group_call_id:int32 = Ok; //@description Sets title of a video chat; requires groupCall.can_be_managed right @group_call_id Group call identifier @title New group call title; 1-64 characters @@ -12355,15 +12754,56 @@ setVideoChatTitle group_call_id:int32 title:string = Ok; //@mute_new_participants New value of the mute_new_participants setting toggleVideoChatMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; -//@description Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_can_send_messages right +//@description Toggles whether participants of a group call can send messages there. Requires groupCall.can_toggle_are_messages_allowed right //@group_call_id Group call identifier -//@can_send_messages New value of the can_send_messages setting -toggleGroupCallCanSendMessages group_call_id:int32 can_send_messages:Bool = Ok; +//@are_messages_allowed New value of the are_messages_allowed setting +toggleGroupCallAreMessagesAllowed group_call_id:int32 are_messages_allowed:Bool = Ok; + +//@description Returns information about the user or the chat that streams to a live story; for live stories that aren't an RTMP stream only @group_call_id Group call identifier +getLiveStoryStreamer group_call_id:int32 = GroupCallParticipant; + +//@description Returns the list of message sender identifiers, on whose behalf messages can be sent to a live story @group_call_id Group call identifier +getLiveStoryAvailableMessageSenders group_call_id:int32 = ChatMessageSenders; + +//@description Selects a message sender to send messages in a live story call +//@group_call_id Group call identifier +//@message_sender_id New message sender for the group call +setLiveStoryMessageSender group_call_id:int32 message_sender_id:MessageSender = Ok; //@description Sends a message to other participants of a group call. Requires groupCall.can_send_messages right //@group_call_id Group call identifier -//@text Text of the message to send; 1-getOption("group_call_message_text_length_max") characters -sendGroupCallMessage group_call_id:int32 text:formattedText = Ok; +//@text Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, +//-which depends on paid_message_star_count. Can't contain line feeds for live stories +//@paid_message_star_count The number of Telegram Stars the user agreed to pay to send the message; for live stories only; 0-getOption("paid_group_call_message_star_count_max"). +//-Must be 0 for messages sent to live stories posted by the current user +sendGroupCallMessage group_call_id:int32 text:formattedText paid_message_star_count:int53 = Ok; + +//@description Adds pending paid reaction in a live story group call. Can't be used in live stories posted by the current user. +//-Call commitPendingLiveStoryReactions or removePendingLiveStoryReactions to actually send all pending reactions when the undo timer is over or abort the sending +//@group_call_id Group call identifier +//@star_count Number of Telegram Stars to be used for the reaction. The total number of pending paid reactions must not exceed getOption("paid_group_call_message_star_count_max") +addPendingLiveStoryReaction group_call_id:int32 star_count:int53 = Ok; + +//@description Applies all pending paid reactions in a live story group call @group_call_id Group call identifier +commitPendingLiveStoryReactions group_call_id:int32 = Ok; + +//@description Removes all pending paid reactions in a live story group call @group_call_id Group call identifier +removePendingLiveStoryReactions group_call_id:int32 = Ok; + +//@description Deletes messages in a group call; for live story calls only. Requires groupCallMessage.can_be_deleted right +//@group_call_id Group call identifier +//@message_ids Identifiers of the messages to be deleted +//@report_spam Pass true to report the messages as spam +deleteGroupCallMessages group_call_id:int32 message_ids:vector report_spam:Bool = Ok; + +//@description Deletes all messages sent by the specified message sender in a group call; for live story calls only. Requires groupCall.can_delete_messages right +//@group_call_id Group call identifier +//@sender_id Identifier of the sender of messages to delete +//@report_spam Pass true to report the messages as spam +deleteGroupCallMessagesBySender group_call_id:int32 sender_id:MessageSender report_spam:Bool = Ok; + +//@description Returns the list of top live story donors @group_call_id Group call identifier of the live story +getLiveStoryTopDonors group_call_id:int32 = LiveStoryDonors; //@description Invites a user to an active group call; for group calls not bound to a chat only. Sends a service message of the type messageGroupCall. //-The group call can have at most getOption("group_call_participant_count_max") participants @@ -12411,19 +12851,24 @@ toggleGroupCallIsMyVideoPaused group_call_id:int32 is_my_video_paused:Bool = Ok; //@description Toggles whether current user's video is enabled @group_call_id Group call identifier @is_my_video_enabled Pass true if the current user's video is enabled toggleGroupCallIsMyVideoEnabled group_call_id:int32 is_my_video_enabled:Bool = Ok; +//@description Changes the minimum number of Telegram Stars that must be paid by general participant for each sent message to a live story call. Requires groupCall.can_be_managed right +//@group_call_id Group call identifier; must be an identifier of a live story call +//@paid_message_star_count The new minimum number of Telegram Stars; 0-getOption("paid_group_call_message_star_count_max") +setGroupCallPaidMessageStarCount group_call_id:int32 paid_message_star_count:int53 = Ok; + //@description Informs TDLib that speaking state of a participant of an active group call has changed. Returns identifier of the participant if it is found //@group_call_id Group call identifier //@audio_source Group call participant's synchronization audio source identifier, or 0 for the current user //@is_speaking Pass true if the user is speaking setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_speaking:Bool = MessageSender; -//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves +//@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves; not supported for live stories //@group_call_id Group call identifier //@participant_id Participant identifier //@is_muted Pass true to mute the user; pass false to unmute them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; -//@description Changes volume level of a participant of an active group call. If the current user can manage the group call or is the owner of the group call, +//@description Changes volume level of a participant of an active group call; not supported for live stories. If the current user can manage the group call or is the owner of the group call, //-then the participant's volume level will be changed for all users with the default volume level //@group_call_id Group call identifier //@participant_id Participant identifier @@ -12441,7 +12886,8 @@ toggleGroupCallParticipantIsHandRaised group_call_id:int32 participant_id:Messag //@limit The maximum number of participants to return; must be positive getGroupCallParticipants input_group_call:InputGroupCall limit:int32 = GroupCallParticipants; -//@description Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded +//@description Loads more participants of a group call; not supported in live stories. The loaded participants will be received through updates. +//-Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded //@group_call_id Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined //@limit The maximum number of participants to load; up to 100 loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; @@ -12449,19 +12895,19 @@ loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok; //@description Leaves a group call @group_call_id Group call identifier leaveGroupCall group_call_id:int32 = Ok; -//@description Ends a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise @group_call_id Group call identifier +//@description Ends a group call. Requires groupCall.can_be_managed right for video chats and live stories or groupCall.is_owned otherwise @group_call_id Group call identifier endGroupCall group_call_id:int32 = Ok; -//@description Returns information about available video chat streams @group_call_id Group call identifier -getVideoChatStreams group_call_id:int32 = VideoChatStreams; +//@description Returns information about available streams in a video chat or a live story @group_call_id Group call identifier +getGroupCallStreams group_call_id:int32 = GroupCallStreams; -//@description Returns a file with a segment of a video chat stream in a modified OGG format for audio or MPEG-4 format for video +//@description Returns a file with a segment of a video chat or live story in a modified OGG format for audio or MPEG-4 format for video //@group_call_id Group call identifier //@time_offset Point in time when the stream segment begins; Unix timestamp in milliseconds //@scale Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds //@channel_id Identifier of an audio/video channel to get as received from tgcalls //@video_quality Video quality as received from tgcalls; pass null to get the worst available quality -getVideoChatStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = Data; +getGroupCallStreamSegment group_call_id:int32 time_offset:int53 scale:int32 channel_id:int32 video_quality:GroupCallVideoQuality = Data; //@description Encrypts group call data before sending them over network using tgcalls //@group_call_id Group call identifier. The call must not be a video chat @@ -12606,6 +13052,12 @@ removeProfileAudio file_id:int32 = Ok; //@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message getStickerOutline sticker_file_id:int32 for_animated_emoji:Bool for_clicked_animated_emoji_message:Bool = Outline; +//@description Returns outline of a sticker as an SVG path. This is an offline method. Returns an empty string if the outline isn't known +//@sticker_file_id File identifier of the sticker +//@for_animated_emoji Pass true to get the outline scaled for animated emoji +//@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message +getStickerOutlineSvgPath sticker_file_id:int32 for_animated_emoji:Bool for_clicked_animated_emoji_message:Bool = Text; + //@description Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned //@sticker_type Type of the stickers to return //@query Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers @@ -12713,7 +13165,7 @@ getStickerEmojis sticker:InputFile = Emojis; //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown searchEmojis text:string input_language_codes:vector = EmojiKeywords; -//@description Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +//@description Returns emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified //@text Text to search for //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown getKeywordEmojis text:string input_language_codes:vector = Emojis; @@ -12869,7 +13321,7 @@ reportPhoneNumberCodeMissing mobile_network_code:string = Ok; //@reason Reason of code resending; pass null if unknown resendPhoneNumberCode reason:ResendCodeReason = AuthenticationCodeInfo; -//@description Check the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check +//@description Checks the authentication code and completes the request for which the code was sent if appropriate @code Authentication code to check checkPhoneNumberCode code:string = Ok; @@ -12987,7 +13439,7 @@ editBotMediaPreview bot_user_id:int53 language_code:string file_id:int32 content //@file_ids File identifiers of the media in the new order reorderBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector = Ok; -//@description Delete media previews from the list of media previews of a bot +//@description Deletes media previews from the list of media previews of a bot //@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App //@language_code Language code of the media previews to delete //@file_ids File identifiers of the media to delete @@ -13261,6 +13713,32 @@ canSendGift gift_id:int64 = CanSendGiftResult; //@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free sendGift gift_id:int64 owner_id:MessageSender text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok; +//@description Returns auction state for a gift @auction_id Unique identifier of the auction +getGiftAuctionState auction_id:string = GiftAuctionState; + +//@description Returns the gifts that were acquired by the current user on a gift auction @gift_id Identifier of the auctioned gift +getGiftAuctionAcquiredGifts gift_id:int64 = GiftAuctionAcquiredGifts; + +//@description Informs TDLib that a gift auction was opened by the user @gift_id Identifier of the gift, which auction was opened +openGiftAuction gift_id:int64 = Ok; + +//@description Informs TDLib that a gift auction was closed by the user @gift_id Identifier of the gift, which auction was closed +closeGiftAuction gift_id:int64 = Ok; + +//@description Places a bid on an auction gift +//@gift_id Identifier of the gift to place the bid on +//@star_count The number of Telegram Stars to place in the bid +//@user_id Identifier of the user that will receive the gift +//@text 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 +//@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them +placeGiftAuctionBid gift_id:int64 star_count:int53 user_id:int53 text:formattedText is_private:Bool = Ok; + +//@description Increases a bid for an auction gift without changing gift text and receiver +//@gift_id Identifier of the gift to put the bid on +//@star_count The number of Telegram Stars to put in the bid +increaseGiftAuctionBid gift_id:int64 star_count:int53 = Ok; + //@description Sells a gift for Telegram Stars; requires owner privileges for gifts owned by a 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 @@ -13284,6 +13762,9 @@ 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 all possible variants of upgraded gifts for a regular gift @gift_id Identifier of the gift +getGiftUpgradeVariants gift_id:int64 = 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 @@ -13316,6 +13797,19 @@ dropGiftOriginalDetails received_gift_id:string star_count:int53 = Ok; //@price The price that the user agreed to pay for the gift sendResoldGift gift_name:string owner_id:MessageSender price:GiftResalePrice = GiftResaleResult; +//@description Sends an offer to purchase an upgraded gift +//@owner_id Identifier of the user or the channel chat that currently owns the gift and will receive the offer +//@gift_name Name of the upgraded gift +//@price The price that the user agreed to pay for the gift +//@duration Duration of the offer, in seconds; must be one of 21600, 43200, 86400, 129600, 172800, or 259200. Can also be 120 if Telegram test environment is used +//@paid_message_star_count The number of Telegram Stars the user agreed to pay additionally for sending of the offer message to the current gift owner; pass userFullInfo.outgoing_paid_message_star_count for users and 0 otherwise +sendGiftPurchaseOffer owner_id:MessageSender gift_name:string price:GiftResalePrice duration:int32 paid_message_star_count:int53 = Ok; + +//@description Handles a pending gift purchase offer +//@message_id Identifier of the message with the gift purchase offer +//@accept Pass true to accept the request; pass false to reject it +processGiftPurchaseOffer message_id:int53 accept:Bool = Ok; + //@description Returns gifts received by the given user or chat //@business_connection_id Unique identifier of business connection on behalf of which to send the request; for bots only //@owner_id Identifier of the gift receiver @@ -13347,6 +13841,9 @@ getUpgradedGiftValueInfo name:string = UpgradedGiftValueInfo; //@password The 2-step verification password of the current user getUpgradedGiftWithdrawalUrl received_gift_id:string password:string = HttpUrl; +//@description Returns promotional anumation for upgraded gifts +getUpgradedGiftsPromotionalAnimation = Animation; + //@description Changes resale price of a unique gift owned by the current user //@received_gift_id Identifier of the unique gift //@price The new price for the unique gift; pass null to disallow gift resale. The current user will receive @@ -13372,7 +13869,7 @@ getGiftCollections owner_id:MessageSender = GiftCollections; //-An owner can have up to getOption("gift_collection_count_max") gift collections. The new collection will be added to the end of the gift collection list of the owner. Returns the created collection //@owner_id Identifier of the user or the channel chat that received the gifts //@name Name of the collection; 1-12 characters -//@received_gift_ids Identifier of the gifts to add to the collection; 0-getOption("gift_collection_gift_count_max") identifiers +//@received_gift_ids Identifier of the gifts to add to the collection; 0-getOption("gift_collection_size_max") identifiers createGiftCollection owner_id:MessageSender name:string received_gift_ids:vector = GiftCollection; //@description Changes order of gift collections. If the collections are owned by a channel chat, then requires can_post_messages administrator right in the channel chat @@ -13394,8 +13891,8 @@ setGiftCollectionName owner_id:MessageSender collection_id:int32 name:string = G //@description Adds gifts to the beginning of a previously created collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection //@owner_id Identifier of the user or the channel chat that owns the collection //@collection_id Identifier of the gift collection -//@received_gift_ids Identifier of the gifts to add to the collection; 1-getOption("gift_collection_gift_count_max") identifiers. -//-If after addition the collection has more than getOption("gift_collection_gift_count_max") gifts, then the last one are removed from the collection +//@received_gift_ids Identifier of the gifts to add to the collection; 1-getOption("gift_collection_size_max") identifiers. +//-If after addition the collection has more than getOption("gift_collection_size_max") gifts, then the last one are removed from the collection addGiftCollectionGifts owner_id:MessageSender collection_id:int32 received_gift_ids:vector = GiftCollection; //@description Removes gifts from a collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat. Returns the changed collection @@ -13535,7 +14032,7 @@ allowUnpaidMessagesFromUser user_id:int53 refund_payments:Bool = Ok; setChatPaidMessageStarCount chat_id:int53 paid_message_star_count:int53 = Ok; -//@description Check whether the current user can message another user or try to create a chat with them +//@description Checks whether the current user can message another user or try to create a chat with them //@user_id Identifier of the other user //@only_local Pass true to get only locally available information without sending network requests canSendMessageToUser user_id:int53 only_local:Bool = CanSendMessageToUserResult; @@ -13898,7 +14395,7 @@ getPremiumGiftPaymentOptions = PremiumGiftPaymentOptions; //@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user getPremiumGiveawayPaymentOptions boosted_chat_id:int53 = PremiumGiveawayPaymentOptions; -//@description Return information about a Telegram Premium gift code @code The code to check +//@description Returns information about a Telegram Premium gift code @code The code to check checkPremiumGiftCode code:string = PremiumGiftCodeInfo; //@description Applies a Telegram Premium gift code @code The code to apply