diff --git a/client/extra.go b/client/extra.go index 9b32fc9..0a6c60f 100644 --- a/client/extra.go +++ b/client/extra.go @@ -15,29 +15,29 @@ func UuidV4Generator() ExtraGenerator { } func IsCommand(text string) bool { - if i := strings.Index(text, "/"); i == 0 { - return true + if text != "" { + if text[0] == '/' { + return true + } } return false } func CheckCommand(text string, entities []*TextEntity) string { if IsCommand(text) { - cmd := text - // e.g. ["/hello 123", "/hell o 123"] // Result: "/hello", "/hell" - if i := strings.Index(cmd, " "); i != -1 { - cmd = cmd[:i] + if i := strings.Index(text, " "); i != -1 { + return text[:i] } // e.g.: ["/hello@world_bot", "/hello@", "/hello@123"] // Result: "/hello" - if i := strings.Index(cmd, "@"); i != -1 { - cmd = cmd[:i] + if i := strings.Index(text, "@"); i != -1 { + return text[:i] } - return cmd + return text } return "" } diff --git a/client/function.go b/client/function.go index cbd2cde..f4c29cf 100755 --- a/client/function.go +++ b/client/function.go @@ -355,63 +355,6 @@ 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"` @@ -829,31 +772,12 @@ 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, 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 +// 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 func (client *Client) SetLoginEmailAddress(req *SetLoginEmailAddressRequest) (*EmailAddressAuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -1505,7 +1429,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, 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 +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively. 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{ @@ -1748,35 +1672,6 @@ func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*Message return UnmarshalMessageViewers(result.Data) } -type GetMessageAuthorRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` -} - -// Returns information about actual author of a message sent on behalf of a channel. The method can be called if messageProperties.can_get_author == true -func (client *Client) GetMessageAuthor(req *GetMessageAuthorRequest) (*User, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessageAuthor", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalUser(result.Data) -} - type GetFileRequest struct { // Identifier of the file to get FileId int32 `json:"file_id"` @@ -2492,7 +2387,7 @@ func (client *Client) GetSuitableDiscussionChats() (*Chats, error) { return UnmarshalChats(result.Data) } -// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives the error "CHANNELS_TOO_MUCH". Also, the limit can be increased with Telegram Premium +// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium func (client *Client) GetInactiveSupergroupChats() (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -2530,352 +2425,6 @@ func (client *Client) GetSuitablePersonalChats() (*Chats, error) { return UnmarshalChats(result.Data) } -type LoadDirectMessagesChatTopicsRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached - Limit int32 `json:"limit"` -} - -// Loads more topics in a channel direct messages chat administered by the current user. The loaded topics will be sent through updateDirectMessagesChatTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded -func (client *Client) LoadDirectMessagesChatTopics(req *LoadDirectMessagesChatTopicsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "loadDirectMessagesChatTopics", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type GetDirectMessagesChatTopicRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the topic to get - TopicId int64 `json:"topic_id"` -} - -// Returns information about the topic in a channel direct messages chat administered by the current user -func (client *Client) GetDirectMessagesChatTopic(req *GetDirectMessagesChatTopicRequest) (*DirectMessagesChatTopic, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getDirectMessagesChatTopic", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalDirectMessagesChatTopic(result.Data) -} - -type GetDirectMessagesChatTopicHistoryRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the topic which messages will be fetched - TopicId int64 `json:"topic_id"` - // Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message - FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages - Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns messages in the topic in a channel direct messages chat administered by the current user. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) -func (client *Client) GetDirectMessagesChatTopicHistory(req *GetDirectMessagesChatTopicHistoryRequest) (*Messages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getDirectMessagesChatTopicHistory", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "from_message_id": req.FromMessageId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessages(result.Data) -} - -type GetDirectMessagesChatTopicMessageByDateRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the topic which messages will be fetched - TopicId int64 `json:"topic_id"` - // Point in time (Unix timestamp) relative to which to search for messages - Date int32 `json:"date"` -} - -// Returns the last message sent in the topic in a channel direct messages chat administered by the current user no later than the specified date -func (client *Client) GetDirectMessagesChatTopicMessageByDate(req *GetDirectMessagesChatTopicMessageByDateRequest) (*Message, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getDirectMessagesChatTopicMessageByDate", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "date": req.Date, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessage(result.Data) -} - -type DeleteDirectMessagesChatTopicHistoryRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the topic which messages will be deleted - TopicId int64 `json:"topic_id"` -} - -// Deletes all messages in the topic in a channel direct messages chat administered by the current user -func (client *Client) DeleteDirectMessagesChatTopicHistory(req *DeleteDirectMessagesChatTopicHistoryRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "deleteDirectMessagesChatTopicHistory", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type DeleteDirectMessagesChatTopicMessagesByDateRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the topic which messages will be deleted - TopicId int64 `json:"topic_id"` - // The minimum date of the messages to delete - MinDate int32 `json:"min_date"` - // The maximum date of the messages to delete - MaxDate int32 `json:"max_date"` -} - -// Deletes all messages between the specified dates in the topic in a channel direct messages chat administered by the current user. Messages sent in the last 30 seconds will not be deleted -func (client *Client) DeleteDirectMessagesChatTopicMessagesByDate(req *DeleteDirectMessagesChatTopicMessagesByDateRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "deleteDirectMessagesChatTopicMessagesByDate", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "min_date": req.MinDate, - "max_date": req.MaxDate, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SetDirectMessagesChatTopicIsMarkedAsUnreadRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Topic identifier - TopicId int64 `json:"topic_id"` - // New value of is_marked_as_unread - IsMarkedAsUnread bool `json:"is_marked_as_unread"` -} - -// Changes the marked as unread state of the topic in a channel direct messages chat administered by the current user -func (client *Client) SetDirectMessagesChatTopicIsMarkedAsUnread(req *SetDirectMessagesChatTopicIsMarkedAsUnreadRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setDirectMessagesChatTopicIsMarkedAsUnread", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "is_marked_as_unread": req.IsMarkedAsUnread, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type UnpinAllDirectMessagesChatTopicMessagesRequest struct { - // Identifier of the chat - ChatId int64 `json:"chat_id"` - // Topic identifier - TopicId int64 `json:"topic_id"` -} - -// Removes all pinned messages from the topic in a channel direct messages chat administered by the current user -func (client *Client) UnpinAllDirectMessagesChatTopicMessages(req *UnpinAllDirectMessagesChatTopicMessagesRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "unpinAllDirectMessagesChatTopicMessages", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ReadAllDirectMessagesChatTopicReactionsRequest struct { - // Identifier of the chat - ChatId int64 `json:"chat_id"` - // Topic identifier - TopicId int64 `json:"topic_id"` -} - -// Removes all unread reactions in the topic in a channel direct messages chat administered by the current user -func (client *Client) ReadAllDirectMessagesChatTopicReactions(req *ReadAllDirectMessagesChatTopicReactionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllDirectMessagesChatTopicReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type GetDirectMessagesChatTopicRevenueRequest struct { - // Chat identifier of the channel direct messages chat administered by the current user - ChatId int64 `json:"chat_id"` - // Identifier of the topic - TopicId int64 `json:"topic_id"` -} - -// Returns the total number of Telegram Stars received by the channel chat for direct messages from the given topic -func (client *Client) GetDirectMessagesChatTopicRevenue(req *GetDirectMessagesChatTopicRevenueRequest) (*StarCount, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getDirectMessagesChatTopicRevenue", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStarCount(result.Data) -} - -type ToggleDirectMessagesChatTopicCanSendUnpaidMessagesRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Identifier of the topic - TopicId int64 `json:"topic_id"` - // Pass true to allow unpaid messages; pass false to disallow unpaid messages - CanSendUnpaidMessages bool `json:"can_send_unpaid_messages"` - // Pass true to refund the user previously paid messages - RefundPayments bool `json:"refund_payments"` -} - -// Allows to send unpaid messages to the given topic of the channel direct messages chat administered by the current user -func (client *Client) ToggleDirectMessagesChatTopicCanSendUnpaidMessages(req *ToggleDirectMessagesChatTopicCanSendUnpaidMessagesRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleDirectMessagesChatTopicCanSendUnpaidMessages", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "topic_id": req.TopicId, - "can_send_unpaid_messages": req.CanSendUnpaidMessages, - "refund_payments": req.RefundPayments, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type LoadSavedMessagesTopicsRequest struct { // The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached Limit int32 `json:"limit"` @@ -2907,9 +2456,9 @@ type GetSavedMessagesTopicHistoryRequest struct { SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` // Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } @@ -3116,9 +2665,9 @@ type GetChatHistoryRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` // Pass true to get only messages that are available without sending network requests OnlyLocal bool `json:"only_local"` @@ -3156,9 +2705,9 @@ type GetMessageThreadHistoryRequest struct { MessageId int64 `json:"message_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } @@ -3248,23 +2797,25 @@ func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) { type SearchChatMessagesRequest struct { // Identifier of the chat in which to search messages ChatId int64 `json:"chat_id"` - // Pass topic identifier to search messages only in specific topic; pass null to search for messages in all topics - TopicId MessageTopic `json:"topic_id"` // Query to search for Query string `json:"query"` // Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats SenderId MessageSender `json:"sender_id"` // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number to get the specified message and some newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` // Additional filter for messages to search; pass null to search for all messages Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified thread will be returned; supergroups only + MessageThreadId int64 `json:"message_thread_id"` + // If not 0, only messages in the specified Saved Messages topic will be returned; pass 0 to return all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } -// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and topic_id search criteria is expected to be supported, only if it is required for Telegram official application implementation +// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*FoundChatMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3272,13 +2823,14 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Found }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, "query": req.Query, "sender_id": req.SenderId, "from_message_id": req.FromMessageId, "offset": req.Offset, "limit": req.Limit, "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -3386,9 +2938,9 @@ type SearchSavedMessagesRequest struct { Query string `json:"query"` // Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number to get the specified message and some newer messages + // Specify 0 to get results from exactly the message from_message_id or a negative offset to get the specified message and some newer messages Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } @@ -3427,7 +2979,7 @@ type SearchCallMessagesRequest struct { OnlyMissed bool `json:"only_missed"` } -// Searches for call and group call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +// Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib func (client *Client) SearchCallMessages(req *SearchCallMessagesRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3479,67 +3031,6 @@ func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocument return UnmarshalFoundMessages(result.Data) } -type GetPublicPostSearchLimitsRequest struct { - // Query that will be searched for - Query string `json:"query"` -} - -// Checks public post search limits without actually performing the search -func (client *Client) GetPublicPostSearchLimits(req *GetPublicPostSearchLimitsRequest) (*PublicPostSearchLimits, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getPublicPostSearchLimits", - }, - Data: map[string]interface{}{ - "query": req.Query, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalPublicPostSearchLimits(result.Data) -} - -type SearchPublicPostsRequest struct { - // Query to search for - Query string `json:"query"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` - // The Telegram Star amount the user agreed to pay for the search; pass 0 for free searches - StarCount int64 `json:"star_count"` -} - -// Searches for public channel posts using the given query. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchPublicPosts(req *SearchPublicPostsRequest) (*FoundPublicPosts, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "searchPublicPosts", - }, - Data: map[string]interface{}{ - "query": req.Query, - "offset": req.Offset, - "limit": req.Limit, - "star_count": req.StarCount, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundPublicPosts(result.Data) -} - type SearchPublicMessagesByTagRequest struct { // Hashtag or cashtag to search for Tag string `json:"tag"` @@ -3574,7 +3065,7 @@ func (client *Client) SearchPublicMessagesByTag(req *SearchPublicMessagesByTagRe type SearchPublicStoriesByTagRequest struct { // Identifier of the chat that posted the stories to search for; pass 0 to search stories in all chats - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Hashtag or cashtag to search for Tag string `json:"tag"` // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -3590,7 +3081,7 @@ func (client *Client) SearchPublicStoriesByTag(req *SearchPublicStoriesByTagRequ Type: "searchPublicStoriesByTag", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "tag": req.Tag, "offset": req.Offset, "limit": req.Limit, @@ -3880,12 +3371,12 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos type GetChatMessageCalendarRequest struct { // Identifier of the chat in which to return information about messages ChatId int64 `json:"chat_id"` - // Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics and message threads aren't supported - TopicId MessageTopic `json:"topic_id"` // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` + // If not0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } // Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" @@ -3896,9 +3387,9 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, "filter": req.Filter, "from_message_id": req.FromMessageId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -3915,15 +3406,15 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest) type GetChatMessageCountRequest struct { // Identifier of the chat in which to count messages ChatId int64 `json:"chat_id"` - // Pass topic identifier to get number of messages only in specific topic; pass null to get number of messages in all topics; message threads aren't supported - TopicId MessageTopic `json:"topic_id"` // Filter for message content; searchMessagesFilterEmpty is unsupported in this function Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified Saved Messages topic will be counted; pass 0 to count all messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` // Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally ReturnLocal bool `json:"return_local"` } -// Returns approximate number of messages of the specified type in the chat or its topic +// Returns approximate number of messages of the specified type in the chat func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Count, error) { result, err := client.Send(Request{ meta: meta{ @@ -3931,8 +3422,8 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, "filter": req.Filter, + "saved_messages_topic_id": req.SavedMessagesTopicId, "return_local": req.ReturnLocal, }, }) @@ -3950,15 +3441,17 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou type GetChatMessagePositionRequest struct { // Identifier of the chat in which to find message position ChatId int64 `json:"chat_id"` - // Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages; message threads aren't supported - TopicId MessageTopic `json:"topic_id"` - // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function - Filter SearchMessagesFilter `json:"filter"` // Message identifier MessageId int64 `json:"message_id"` + // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function + Filter SearchMessagesFilter `json:"filter"` + // If not 0, only messages in the specified thread will be considered; supergroups only + MessageThreadId int64 `json:"message_thread_id"` + // If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` } -// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat and topic. Cannot be used in secret chats +// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) (*Count, error) { result, err := client.Send(Request{ meta: meta{ @@ -3966,9 +3459,10 @@ func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest) }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, - "filter": req.Filter, "message_id": req.MessageId, + "filter": req.Filter, + "message_thread_id": req.MessageThreadId, + "saved_messages_topic_id": req.SavedMessagesTopicId, }, }) if err != nil { @@ -4244,134 +3738,6 @@ func (client *Client) ReportSponsoredChat(req *ReportSponsoredChatRequest) (Repo } } -type GetVideoMessageAdvertisementsRequest struct { - // Identifier of the chat with the message - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` -} - -// Returns advertisements to be shown while a video from a message is watched. Available only if messageProperties.can_get_video_advertisements -func (client *Client) GetVideoMessageAdvertisements(req *GetVideoMessageAdvertisementsRequest) (*VideoMessageAdvertisements, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getVideoMessageAdvertisements", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalVideoMessageAdvertisements(result.Data) -} - -type ViewVideoMessageAdvertisementRequest struct { - // Unique identifier of the advertisement - AdvertisementUniqueId int64 `json:"advertisement_unique_id"` -} - -// Informs TDLib that the user viewed a video message advertisement -func (client *Client) ViewVideoMessageAdvertisement(req *ViewVideoMessageAdvertisementRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "viewVideoMessageAdvertisement", - }, - Data: map[string]interface{}{ - "advertisement_unique_id": req.AdvertisementUniqueId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ClickVideoMessageAdvertisementRequest struct { - // Unique identifier of the advertisement - AdvertisementUniqueId int64 `json:"advertisement_unique_id"` -} - -// Informs TDLib that the user clicked a video message advertisement -func (client *Client) ClickVideoMessageAdvertisement(req *ClickVideoMessageAdvertisementRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "clickVideoMessageAdvertisement", - }, - Data: map[string]interface{}{ - "advertisement_unique_id": req.AdvertisementUniqueId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ReportVideoMessageAdvertisementRequest struct { - // Unique identifier of the advertisement - AdvertisementUniqueId int64 `json:"advertisement_unique_id"` - // Option identifier chosen by the user; leave empty for the initial request - OptionId []byte `json:"option_id"` -} - -// Reports a video message advertisement to Telegram moderators -func (client *Client) ReportVideoMessageAdvertisement(req *ReportVideoMessageAdvertisementRequest) (ReportSponsoredResult, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "reportVideoMessageAdvertisement", - }, - Data: map[string]interface{}{ - "advertisement_unique_id": req.AdvertisementUniqueId, - "option_id": req.OptionId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - switch result.Type { - case TypeReportSponsoredResultOk: - return UnmarshalReportSponsoredResultOk(result.Data) - - case TypeReportSponsoredResultFailed: - return UnmarshalReportSponsoredResultFailed(result.Data) - - case TypeReportSponsoredResultOptionRequired: - return UnmarshalReportSponsoredResultOptionRequired(result.Data) - - case TypeReportSponsoredResultAdsHidden: - return UnmarshalReportSponsoredResultAdsHidden(result.Data) - - case TypeReportSponsoredResultPremiumRequired: - return UnmarshalReportSponsoredResultPremiumRequired(result.Data) - - default: - return nil, errors.New("invalid type") - } -} - type RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -4560,7 +3926,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. See translateText.to_language_code for the list of supported values + // 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" ToLanguageCode string `json:"to_language_code"` } @@ -4587,38 +3953,6 @@ 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"` @@ -4738,8 +4072,8 @@ func (client *Client) SetChatMessageSender(req *SetChatMessageSenderRequest) (*O type SendMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // Topic in which the message will be sent; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the message will be sent + MessageThreadId int64 `json:"message_thread_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options @@ -4758,7 +4092,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "reply_to": req.ReplyTo, "options": req.Options, "reply_markup": req.ReplyMarkup, @@ -4779,8 +4113,8 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { type SendMessageAlbumRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // Topic in which the messages will be sent; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the messages will be sent + MessageThreadId int64 `json:"message_thread_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options @@ -4797,7 +4131,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, @@ -4849,8 +4183,8 @@ func (client *Client) SendBotStartMessage(req *SendBotStartMessageRequest) (*Mes type SendInlineQueryResultMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` - // Topic in which the message will be sent; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the message will be sent + MessageThreadId int64 `json:"message_thread_id"` // Information about the message or story to be replied; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options @@ -4871,7 +4205,7 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "reply_to": req.ReplyTo, "options": req.Options, "query_id": req.QueryId, @@ -4893,15 +4227,15 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes type ForwardMessagesRequest struct { // Identifier of the chat to which to forward messages ChatId int64 `json:"chat_id"` - // Topic in which the messages will be forwarded; message threads aren't supported; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the message will be sent; for forum threads only + MessageThreadId int64 `json:"message_thread_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` - // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable + // Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable SendCopy bool `json:"send_copy"` // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` @@ -4915,7 +4249,7 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "from_chat_id": req.FromChatId, "message_ids": req.MessageIds, "options": req.Options, @@ -5028,7 +4362,7 @@ func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreensho } type AddLocalMessageRequest struct { - // Target chat; channel direct messages chats aren't supported + // Target chat ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` @@ -5240,41 +4574,6 @@ func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationReques return UnmarshalMessage(result.Data) } -type EditMessageChecklistRequest struct { - // The chat the message belongs to - ChatId int64 `json:"chat_id"` - // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited - MessageId int64 `json:"message_id"` - // The new message reply markup; pass null if none; for bots only - ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The new checklist. If some tasks were completed, this information will be kept - Checklist *InputChecklist `json:"checklist"` -} - -// Edits the message content of a checklist. Returns the edited message after the edit is completed on the server side -func (client *Client) EditMessageChecklist(req *EditMessageChecklistRequest) (*Message, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "editMessageChecklist", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "reply_markup": req.ReplyMarkup, - "checklist": req.Checklist, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessage(result.Data) -} - type EditMessageMediaRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` @@ -5789,44 +5088,6 @@ func (client *Client) EditBusinessMessageLiveLocation(req *EditBusinessMessageLi return UnmarshalBusinessMessage(result.Data) } -type EditBusinessMessageChecklistRequest struct { - // Unique identifier of business connection on behalf of which the message was sent - BusinessConnectionId string `json:"business_connection_id"` - // The chat the message belongs to - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` - // The new message reply markup; pass null if none - ReplyMarkup ReplyMarkup `json:"reply_markup"` - // The new checklist. If some tasks were completed, this information will be kept - Checklist *InputChecklist `json:"checklist"` -} - -// Edits the content of a checklist in a message sent on behalf of a business account; for bots only -func (client *Client) EditBusinessMessageChecklist(req *EditBusinessMessageChecklistRequest) (*BusinessMessage, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "editBusinessMessageChecklist", - }, - Data: map[string]interface{}{ - "business_connection_id": req.BusinessConnectionId, - "chat_id": req.ChatId, - "message_id": req.MessageId, - "reply_markup": req.ReplyMarkup, - "checklist": req.Checklist, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalBusinessMessage(result.Data) -} - type EditBusinessMessageMediaRequest struct { // Unique identifier of business connection on behalf of which the message was sent BusinessConnectionId string `json:"business_connection_id"` @@ -6074,7 +5335,7 @@ func (client *Client) DeleteBusinessMessages(req *DeleteBusinessMessagesRequest) type EditBusinessStoryRequest struct { // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story to edit StoryId int32 `json:"story_id"` // New content of the story @@ -6087,14 +5348,14 @@ type EditBusinessStoryRequest struct { PrivacySettings StoryPrivacySettings `json:"privacy_settings"` } -// Changes a story posted by the bot on behalf of a business account; for bots only +// Changes a story sent by the bot on behalf of a business account; for bots only func (client *Client) EditBusinessStory(req *EditBusinessStoryRequest) (*Story, error) { result, err := client.Send(Request{ meta: meta{ Type: "editBusinessStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "content": req.Content, "areas": req.Areas, @@ -6120,7 +5381,7 @@ type DeleteBusinessStoryRequest struct { StoryId int32 `json:"story_id"` } -// Deletes a story posted by the bot on behalf of a business account; for bots only +// Deletes a story sent by the bot on behalf of a business account; for bots only func (client *Client) DeleteBusinessStory(req *DeleteBusinessStoryRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6208,7 +5469,7 @@ type SetBusinessAccountProfilePhotoRequest struct { BusinessConnectionId string `json:"business_connection_id"` // Profile photo to set; pass null to remove the photo Photo InputChatPhoto `json:"photo"` - // Pass true to set the public photo, which will be visible even if the main photo is hidden by privacy settings + // Pass true to set the public photo, which will be visible even the main photo is hidden by privacy settings IsPublic bool `json:"is_public"` } @@ -6298,7 +5559,7 @@ type GetBusinessAccountStarAmountRequest struct { BusinessConnectionId string `json:"business_connection_id"` } -// Returns the Telegram Star amount owned by a business account; for bots only +// Returns the amount of Telegram Stars owned by a business account; for bots only func (client *Client) GetBusinessAccountStarAmount(req *GetBusinessAccountStarAmountRequest) (*StarAmount, error) { result, err := client.Send(Request{ meta: meta{ @@ -6326,7 +5587,7 @@ type TransferBusinessAccountStarsRequest struct { StarCount int64 `json:"star_count"` } -// Transfers Telegram Stars from the business account to the business bot; for bots only +// Transfer 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{ @@ -6539,7 +5800,7 @@ type AddQuickReplyShortcutMessageRequest struct { ShortcutName string `json:"shortcut_name"` // Identifier of a quick reply message in the same shortcut to be replied; pass 0 if none ReplyToMessageId int64 `json:"reply_to_message_id"` - // The content of the message to be added; inputMessagePaidMedia, inputMessageForwarded and inputMessageLocation with live_period aren't supported + // The content of the message to be added; inputMessagePoll, inputMessageForwarded and inputMessageLocation with live_period aren't supported InputMessageContent InputMessageContent `json:"input_message_content"` } @@ -6670,11 +5931,11 @@ type EditQuickReplyMessageRequest struct { ShortcutId int32 `json:"shortcut_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageChecklist, inputMessageDocument, inputMessagePhoto, inputMessageText, or inputMessageVideo + // New content of the message. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo InputMessageContent InputMessageContent `json:"input_message_content"` } -// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Media message can be edited only to a media message. Checklist messages can be edited only to a checklist message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa +// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Media message can be edited only to a media message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6721,13 +5982,11 @@ type CreateForumTopicRequest struct { ChatId int64 `json:"chat_id"` // Name of the topic; 1-128 characters Name string `json:"name"` - // Pass true if the name of the topic wasn't entered explicitly; for chats with bots only - IsNameImplicit bool `json:"is_name_implicit"` // Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons Icon *ForumTopicIcon `json:"icon"` } -// Creates a topic in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator or can_create_topics member right in the supergroup +// Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -6736,7 +5995,6 @@ func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopi Data: map[string]interface{}{ "chat_id": req.ChatId, "name": req.Name, - "is_name_implicit": req.IsNameImplicit, "icon": req.Icon, }, }) @@ -6754,8 +6012,8 @@ func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopi type EditForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` // New name of the topic; 0-128 characters. If empty, the previous topic name is kept Name string `json:"name"` // Pass true to edit the icon of the topic. Icon of the General topic can't be edited @@ -6764,7 +6022,7 @@ type EditForumTopicRequest struct { IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` } -// Edits title and icon of a topic in a forum supergroup chat or a chat with a bot with topics; for supergroup chats requires can_manage_topics administrator right unless the user is creator of the topic +// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6772,7 +6030,7 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, "name": req.Name, "edit_icon_custom_emoji": req.EditIconCustomEmoji, "icon_custom_emoji_id": req.IconCustomEmojiId, @@ -6792,11 +6050,11 @@ func (client *Client) EditForumTopic(req *EditForumTopicRequest) (*Ok, error) { type GetForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` } -// Returns information about a topic in a forum supergroup chat or a chat with a bot with topics +// Returns information about a forum topic func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, error) { result, err := client.Send(Request{ meta: meta{ @@ -6804,7 +6062,7 @@ func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, err }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, }, }) if err != nil { @@ -6818,52 +6076,14 @@ func (client *Client) GetForumTopic(req *GetForumTopicRequest) (*ForumTopic, err return UnmarshalForumTopic(result.Data) } -type GetForumTopicHistoryRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` - // Identifier of the message starting from which history must be fetched; use 0 to get results from the last message - FromMessageId int64 `json:"from_message_id"` - // Specify 0 to get results from exactly the message from_message_id or a negative number from -99 to -1 to get additionally -offset newer messages - Offset int32 `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, then the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns messages in a topic in a forum supergroup chat or a chat with a bot with topics. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) GetForumTopicHistory(req *GetForumTopicHistoryRequest) (*Messages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getForumTopicHistory", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - "from_message_id": req.FromMessageId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessages(result.Data) -} - type GetForumTopicLinkRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` } -// Returns an HTTPS link to a topic in a forum supergroup chat. This is an offline method +// Returns an HTTPS link to a topic in a forum chat. This is an offline method func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*MessageLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -6871,7 +6091,7 @@ func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*Message }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, }, }) if err != nil { @@ -6886,7 +6106,7 @@ func (client *Client) GetForumTopicLink(req *GetForumTopicLinkRequest) (*Message } type GetForumTopicsRequest struct { - // Identifier of the chat + // Identifier of the forum chat ChatId int64 `json:"chat_id"` // Query to search for in the forum topic's name Query string `json:"query"` @@ -6894,13 +6114,13 @@ type GetForumTopicsRequest struct { OffsetDate int32 `json:"offset_date"` // The message identifier of the last message in the last found topic, or 0 for the first request OffsetMessageId int64 `json:"offset_message_id"` - // The forum topic identifier of the last found topic, or 0 for the first request - OffsetForumTopicId int32 `json:"offset_forum_topic_id"` + // The message thread identifier of the last found topic, or 0 for the first request + OffsetMessageThreadId int64 `json:"offset_message_thread_id"` // The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Returns found forum topics in a forum supergroup chat or a chat with a bot with topics. This is a temporary method for getting information about topic list from the server +// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, error) { result, err := client.Send(Request{ meta: meta{ @@ -6911,7 +6131,7 @@ func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, "query": req.Query, "offset_date": req.OffsetDate, "offset_message_id": req.OffsetMessageId, - "offset_forum_topic_id": req.OffsetForumTopicId, + "offset_message_thread_id": req.OffsetMessageThreadId, "limit": req.Limit, }, }) @@ -6929,13 +6149,13 @@ func (client *Client) GetForumTopics(req *GetForumTopicsRequest) (*ForumTopics, type SetForumTopicNotificationSettingsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` // New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever NotificationSettings *ChatNotificationSettings `json:"notification_settings"` } -// Changes the notification settings of a forum topic in a forum supergroup chat or a chat with a bot with topics +// Changes the notification settings of a forum topic func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotificationSettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6943,7 +6163,7 @@ func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotifi }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, "notification_settings": req.NotificationSettings, }, }) @@ -6961,13 +6181,13 @@ func (client *Client) SetForumTopicNotificationSettings(req *SetForumTopicNotifi type ToggleForumTopicIsClosedRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` // Pass true to close the topic; pass false to reopen it IsClosed bool `json:"is_closed"` } -// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic +// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup unless the user is creator of the topic func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6975,7 +6195,7 @@ func (client *Client) ToggleForumTopicIsClosed(req *ToggleForumTopicIsClosedRequ }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, "is_closed": req.IsClosed, }, }) @@ -6997,7 +6217,7 @@ type ToggleGeneralForumTopicIsHiddenRequest struct { IsHidden bool `json:"is_hidden"` } -// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup +// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the supergroup func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTopicIsHiddenRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7022,13 +6242,13 @@ func (client *Client) ToggleGeneralForumTopicIsHidden(req *ToggleGeneralForumTop type ToggleForumTopicIsPinnedRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` // Pass true to pin the topic; pass false to unpin it IsPinned bool `json:"is_pinned"` } -// Changes the pinned state of a topic in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics +// Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7036,7 +6256,7 @@ func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequ }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, + "message_thread_id": req.MessageThreadId, "is_pinned": req.IsPinned, }, }) @@ -7054,11 +6274,11 @@ func (client *Client) ToggleForumTopicIsPinned(req *ToggleForumTopicIsPinnedRequ type SetPinnedForumTopicsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // The new list of identifiers of the pinned forum topics - ForumTopicIds []int32 `json:"forum_topic_ids"` + // The new list of pinned forum topics + MessageThreadIds []int64 `json:"message_thread_ids"` } -// Changes the order of pinned topics in a forum supergroup chat or a chat with a bot with topics; requires can_manage_topics administrator right in the supergroup +// Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7066,7 +6286,7 @@ func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*O }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_ids": req.ForumTopicIds, + "message_thread_ids": req.MessageThreadIds, }, }) if err != nil { @@ -7083,11 +6303,11 @@ func (client *Client) SetPinnedForumTopics(req *SetPinnedForumTopicsRequest) (*O type DeleteForumTopicRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` - // Forum topic identifier - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the forum topic + MessageThreadId int64 `json:"message_thread_id"` } -// Deletes all messages from a topic in a forum supergroup chat or a chat with a bot with topics; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages +// Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7095,187 +6315,7 @@ func (client *Client) DeleteForumTopic(req *DeleteForumTopicRequest) (*Ok, error }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ReadAllForumTopicMentionsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Forum topic identifier in which mentions are marked as read - ForumTopicId int32 `json:"forum_topic_id"` -} - -// Marks all mentions in a topic in a forum supergroup chat as read -func (client *Client) ReadAllForumTopicMentions(req *ReadAllForumTopicMentionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllForumTopicMentions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type ReadAllForumTopicReactionsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Forum topic identifier in which reactions are marked as read - ForumTopicId int32 `json:"forum_topic_id"` -} - -// Marks all reactions in a topic in a forum supergroup chat or a chat with a bot with topics as read -func (client *Client) ReadAllForumTopicReactions(req *ReadAllForumTopicReactionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "readAllForumTopicReactions", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type UnpinAllForumTopicMessagesRequest struct { - // Identifier of the chat - ChatId int64 `json:"chat_id"` - // Forum topic identifier in which messages will be unpinned - ForumTopicId int32 `json:"forum_topic_id"` -} - -// Removes all pinned messages from a topic in a forum supergroup chat or a chat with a bot with topics; requires can_pin_messages member right in the supergroup -func (client *Client) UnpinAllForumTopicMessages(req *UnpinAllForumTopicMessagesRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "unpinAllForumTopicMessages", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - 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, + "message_thread_id": req.MessageThreadId, }, }) if err != nil { @@ -8342,73 +7382,6 @@ func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type AddChecklistTasksRequest struct { - // Identifier of the chat with the message - ChatId int64 `json:"chat_id"` - // Identifier of the message containing the checklist. Use messageProperties.can_add_tasks to check whether the tasks can be added - MessageId int64 `json:"message_id"` - // List of added tasks - Tasks []*InputChecklistTask `json:"tasks"` -} - -// Adds tasks to a checklist in a message -func (client *Client) AddChecklistTasks(req *AddChecklistTasksRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addChecklistTasks", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "tasks": req.Tasks, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type MarkChecklistTasksAsDoneRequest struct { - // Identifier of the chat with the message - ChatId int64 `json:"chat_id"` - // Identifier of the message containing the checklist. Use messageProperties.can_mark_tasks_as_done to check whether the tasks can be marked as done or not done - MessageId int64 `json:"message_id"` - // Identifiers of tasks that were marked as done - MarkedAsDoneTaskIds []int32 `json:"marked_as_done_task_ids"` - // Identifiers of tasks that were marked as not done - MarkedAsNotDoneTaskIds []int32 `json:"marked_as_not_done_task_ids"` -} - -// Adds tasks of a checklist in a message as done or not done -func (client *Client) MarkChecklistTasksAsDone(req *MarkChecklistTasksAsDoneRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "markChecklistTasksAsDone", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "marked_as_done_task_ids": req.MarkedAsDoneTaskIds, - "marked_as_not_done_task_ids": req.MarkedAsNotDoneTaskIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type HideSuggestedActionRequest struct { // Suggested action to hide Action SuggestedAction `json:"action"` @@ -8528,7 +7501,7 @@ type GetLoginUrlRequest struct { MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` - // Pass true to allow the bot to send messages to the current user. Phone number access can't be requested using the button + // Pass true to allow the bot to send messages to the current user AllowWriteAccess bool `json:"allow_write_access"` } @@ -8673,7 +7646,7 @@ func (client *Client) GetInlineQueryResults(req *GetInlineQueryResultsRequest) ( type AnswerInlineQueryRequest struct { // Identifier of the inline query InlineQueryId JsonInt64 `json:"inline_query_id"` - // Pass true if results may be cached and returned only for the user who sent the query. By default, results may be returned to any user who sends the same query + // Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query IsPersonal bool `json:"is_personal"` // Button to be shown above inline query results; pass null if none Button *InlineQueryResultsButton `json:"button"` @@ -9003,8 +7976,8 @@ type OpenWebAppRequest struct { BotUserId int64 `json:"bot_user_id"` // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise Url string `json:"url"` - // Topic in which the message will be sent; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the message will be sent + MessageThreadId int64 `json:"message_thread_id"` // Information about the message or story to be replied in the message sent by the Web App; pass null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Parameters to use to open the Web App @@ -9021,7 +7994,7 @@ func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { "chat_id": req.ChatId, "bot_user_id": req.BotUserId, "url": req.Url, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "reply_to": req.ReplyTo, "parameters": req.Parameters, }, @@ -9402,7 +8375,7 @@ type DeleteChatReplyMarkupRequest struct { MessageId int64 `json:"message_id"` } -// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used or dismissed +// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9427,8 +8400,8 @@ func (client *Client) DeleteChatReplyMarkup(req *DeleteChatReplyMarkupRequest) ( type SendChatActionRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the topic in which the action is performed; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the action was performed + MessageThreadId int64 `json:"message_thread_id"` // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` // The action description; pass null to cancel the currently active action @@ -9443,7 +8416,7 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "business_connection_id": req.BusinessConnectionId, "action": req.Action, }, @@ -9459,41 +8432,6 @@ func (client *Client) SendChatAction(req *SendChatActionRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SendTextMessageDraftRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // The forum topic identifier in which the message will be sent; pass 0 if none - ForumTopicId int32 `json:"forum_topic_id"` - // Unique identifier of the draft - DraftId JsonInt64 `json:"draft_id"` - // Draft text of the message - Text *FormattedText `json:"text"` -} - -// Sends a draft for a being generated text message; for bots only -func (client *Client) SendTextMessageDraft(req *SendTextMessageDraftRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendTextMessageDraft", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "forum_topic_id": req.ForumTopicId, - "draft_id": req.DraftId, - "text": req.Text, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type OpenChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -9553,7 +8491,7 @@ type ViewMessagesRequest struct { MessageIds []int64 `json:"message_ids"` // Source of the message view; pass null to guess the source based on chat open state Source MessageSource `json:"source"` - // Pass true to mark as read the specified messages even if the chat is closed + // Pass true to mark as read the specified messages even the chat is closed ForceRead bool `json:"force_read"` } @@ -9692,6 +8630,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte } switch result.Type { + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(result.Data) + case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data) @@ -9713,8 +8654,11 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(result.Data) - case TypeInternalLinkTypeCallsPage: - return UnmarshalInternalLinkTypeCallsPage(result.Data) + case TypeInternalLinkTypeBuyStars: + return UnmarshalInternalLinkTypeBuyStars(result.Data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(result.Data) @@ -9725,30 +8669,21 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) - case TypeInternalLinkTypeChatSelection: - return UnmarshalInternalLinkTypeChatSelection(result.Data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(result.Data) - case TypeInternalLinkTypeContactsPage: - return UnmarshalInternalLinkTypeContactsPage(result.Data) - - case TypeInternalLinkTypeDirectMessagesChat: - return UnmarshalInternalLinkTypeDirectMessagesChat(result.Data) + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) - case TypeInternalLinkTypeGiftAuction: - return UnmarshalInternalLinkTypeGiftAuction(result.Data) - - case TypeInternalLinkTypeGiftCollection: - return UnmarshalInternalLinkTypeGiftCollection(result.Data) - - case TypeInternalLinkTypeGroupCall: - return UnmarshalInternalLinkTypeGroupCall(result.Data) - case TypeInternalLinkTypeInstantView: return UnmarshalInternalLinkTypeInstantView(result.Data) @@ -9758,8 +8693,8 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(result.Data) - case TypeInternalLinkTypeLiveStory: - return UnmarshalInternalLinkTypeLiveStory(result.Data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(result.Data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(result.Data) @@ -9770,35 +8705,23 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(result.Data) - case TypeInternalLinkTypeMyProfilePage: - return UnmarshalInternalLinkTypeMyProfilePage(result.Data) - - case TypeInternalLinkTypeNewChannelChat: - return UnmarshalInternalLinkTypeNewChannelChat(result.Data) - - case TypeInternalLinkTypeNewGroupChat: - return UnmarshalInternalLinkTypeNewGroupChat(result.Data) - - case TypeInternalLinkTypeNewPrivateChat: - return UnmarshalInternalLinkTypeNewPrivateChat(result.Data) - - case TypeInternalLinkTypeNewStory: - return UnmarshalInternalLinkTypeNewStory(result.Data) - case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(result.Data) case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(result.Data) - case TypeInternalLinkTypePremiumFeaturesPage: - return UnmarshalInternalLinkTypePremiumFeaturesPage(result.Data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(result.Data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) - case TypeInternalLinkTypePremiumGiftPurchase: - return UnmarshalInternalLinkTypePremiumGiftPurchase(result.Data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(result.Data) @@ -9812,33 +8735,27 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(result.Data) - case TypeInternalLinkTypeSavedMessages: - return UnmarshalInternalLinkTypeSavedMessages(result.Data) - - case TypeInternalLinkTypeSearch: - return UnmarshalInternalLinkTypeSearch(result.Data) - case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) - case TypeInternalLinkTypeStarPurchase: - return UnmarshalInternalLinkTypeStarPurchase(result.Data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(result.Data) - case TypeInternalLinkTypeStoryAlbum: - return UnmarshalInternalLinkTypeStoryAlbum(result.Data) - case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(result.Data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(result.Data) + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) + case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(result.Data) @@ -9897,13 +8814,11 @@ func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (Logi type GetExternalLinkRequest struct { // The HTTP link Link string `json:"link"` - // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to send them messages + // Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages AllowWriteAccess bool `json:"allow_write_access"` - // Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to access their phone number - AllowPhoneNumberAccess bool `json:"allow_phone_number_access"` } -// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed. May return an empty link if just a toast about successful login has to be shown +// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -9912,7 +8827,6 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er Data: map[string]interface{}{ "link": req.Link, "allow_write_access": req.AllowWriteAccess, - "allow_phone_number_access": req.AllowPhoneNumberAccess, }, }) if err != nil { @@ -9952,12 +8866,41 @@ func (client *Client) ReadAllChatMentions(req *ReadAllChatMentionsRequest) (*Ok, return UnmarshalOk(result.Data) } +type ReadAllMessageThreadMentionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which mentions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all mentions in a forum topic as read +func (client *Client) ReadAllMessageThreadMentions(req *ReadAllMessageThreadMentionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadMentions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type ReadAllChatReactionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` } -// Marks all reactions in a chat as read +// Marks all reactions in a chat or a forum topic as read func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -9978,6 +8921,35 @@ func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*O return UnmarshalOk(result.Data) } +type ReadAllMessageThreadReactionsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Message thread identifier in which reactions are marked as read + MessageThreadId int64 `json:"message_thread_id"` +} + +// Marks all reactions in a forum topic as read +func (client *Client) ReadAllMessageThreadReactions(req *ReadAllMessageThreadReactionsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllMessageThreadReactions", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -11120,40 +10092,11 @@ func (client *Client) DeleteChatBackground(req *DeleteChatBackgroundRequest) (*O return UnmarshalOk(result.Data) } -type GetGiftChatThemesRequest struct { - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of chat themes to return - Limit int32 `json:"limit"` -} - -// Returns available to the current user gift chat themes -func (client *Client) GetGiftChatThemes(req *GetGiftChatThemesRequest) (*GiftChatThemes, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getGiftChatThemes", - }, - Data: map[string]interface{}{ - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftChatThemes(result.Data) -} - type SetChatThemeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New chat theme; pass null to return the default theme - Theme InputChatTheme `json:"theme"` + // Name of the new chat theme; pass an empty string to return the default theme + ThemeName string `json:"theme_name"` } // Changes the chat theme. Supported only in private and secret chats @@ -11164,7 +10107,7 @@ func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "theme": req.Theme, + "theme_name": req.ThemeName, }, }) if err != nil { @@ -11181,13 +10124,13 @@ func (client *Client) SetChatTheme(req *SetChatThemeRequest) (*Ok, error) { type SetChatDraftMessageRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Topic in which the draft will be changed; pass null to change the draft for the chat itself - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the draft was changed + MessageThreadId int64 `json:"message_thread_id"` // New draft message; pass null to remove the draft. All files in draft message content must be of the type inputFileLocal. Media thumbnails and captions are ignored DraftMessage *DraftMessage `json:"draft_message"` } -// Changes the draft message in a chat or a topic +// Changes the draft message in a chat func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11195,7 +10138,7 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok, }, Data: map[string]interface{}{ "chat_id": req.ChatId, - "topic_id": req.TopicId, + "message_thread_id": req.MessageThreadId, "draft_message": req.DraftMessage, }, }) @@ -11500,38 +10443,6 @@ func (client *Client) SetChatDiscussionGroup(req *SetChatDiscussionGroupRequest) return UnmarshalOk(result.Data) } -type SetChatDirectMessagesGroupRequest struct { - // Identifier of the channel chat - ChatId int64 `json:"chat_id"` - // Pass true if the direct messages group is enabled for the channel chat; pass false otherwise - IsEnabled bool `json:"is_enabled"` - // The new number of Telegram Stars that must be paid for each message that is sent to the direct messages chat unless the sender is an administrator of the channel chat; 0-getOption("paid_message_star_count_max"). The channel will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending. Requires supergroupFullInfo.can_enable_paid_messages for positive amounts - PaidMessageStarCount int64 `json:"paid_message_star_count"` -} - -// Changes direct messages group settings for a channel chat; requires owner privileges in the chat -func (client *Client) SetChatDirectMessagesGroup(req *SetChatDirectMessagesGroupRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setChatDirectMessagesGroup", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "is_enabled": req.IsEnabled, - "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 SetChatLocationRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11564,11 +10475,11 @@ func (client *Client) SetChatLocation(req *SetChatLocationRequest) (*Ok, error) type SetChatSlowModeDelayRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // New slow mode delay for the chat, in seconds; must be one of 0, 5, 10, 30, 60, 300, 900, 3600 + // New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 SlowModeDelay int32 `json:"slow_mode_delay"` } -// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members administrator right +// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right func (client *Client) SetChatSlowModeDelay(req *SetChatSlowModeDelayRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -11680,6 +10591,35 @@ func (client *Client) UnpinAllChatMessages(req *UnpinAllChatMessagesRequest) (*O return UnmarshalOk(result.Data) } +type UnpinAllMessageThreadMessagesRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Message thread identifier in which messages will be unpinned + MessageThreadId int64 `json:"message_thread_id"` +} + +// Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup +func (client *Client) UnpinAllMessageThreadMessages(req *UnpinAllMessageThreadMessagesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "unpinAllMessageThreadMessages", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_thread_id": req.MessageThreadId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type JoinChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -11832,7 +10772,7 @@ type BanChatMemberRequest struct { MemberId MessageSender `json:"member_id"` // Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned BannedUntilDate int32 `json:"banned_until_date"` - // Pass true to delete all messages in the chat for the user who is being removed. Always true for supergroups and channels + // Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels RevokeMessages bool `json:"revoke_messages"` } @@ -11926,32 +10866,6 @@ func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) ( return UnmarshalOk(result.Data) } -type GetChatOwnerAfterLeavingRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the chat during that period; requires owner privileges in the chat. Available only for supergroups and channel chats -func (client *Client) GetChatOwnerAfterLeaving(req *GetChatOwnerAfterLeavingRequest) (*User, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getChatOwnerAfterLeaving", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalUser(result.Data) -} - type GetChatMemberRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -12068,25 +10982,6 @@ 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"` @@ -12379,7 +11274,7 @@ type ReadChatListRequest struct { ChatList ChatList `json:"chat_list"` } -// Traverses all chats in a chat list and marks all messages in the chats as read +// Traverse 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{ @@ -12428,7 +11323,7 @@ func (client *Client) GetCurrentWeather(req *GetCurrentWeatherRequest) (*Current type GetStoryRequest struct { // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` // Pass true to get only locally available information without sending network requests @@ -12442,7 +11337,7 @@ func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { Type: "getStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "only_local": req.OnlyLocal, }, @@ -12458,11 +11353,11 @@ func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { return UnmarshalStory(result.Data) } -// Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canPostStory before actually trying to post a story there -func (client *Client) GetChatsToPostStories() (*Chats, error) { +// Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +func (client *Client) GetChatsToSendStories() (*Chats, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatsToPostStories", + Type: "getChatsToSendStories", }, Data: map[string]interface{}{}, }) @@ -12477,16 +11372,16 @@ func (client *Client) GetChatsToPostStories() (*Chats, error) { return UnmarshalChats(result.Data) } -type CanPostStoryRequest struct { +type CanSendStoryRequest struct { // Chat identifier. Pass Saved Messages chat identifier when posting a story on behalf of the current user ChatId int64 `json:"chat_id"` } -// Checks whether the current user can post a story on behalf of a chat; requires can_post_stories administrator right for supergroup and channel chats -func (client *Client) CanPostStory(req *CanPostStoryRequest) (CanPostStoryResult, error) { +// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats +func (client *Client) CanSendStory(req *CanSendStoryRequest) (CanSendStoryResult, error) { result, err := client.Send(Request{ meta: meta{ - Type: "canPostStory", + Type: "canSendStory", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -12501,33 +11396,30 @@ func (client *Client) CanPostStory(req *CanPostStoryRequest) (CanPostStoryResult } switch result.Type { - case TypeCanPostStoryResultOk: - return UnmarshalCanPostStoryResultOk(result.Data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(result.Data) - case TypeCanPostStoryResultPremiumNeeded: - return UnmarshalCanPostStoryResultPremiumNeeded(result.Data) + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(result.Data) - case TypeCanPostStoryResultBoostNeeded: - return UnmarshalCanPostStoryResultBoostNeeded(result.Data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(result.Data) - case TypeCanPostStoryResultActiveStoryLimitExceeded: - return UnmarshalCanPostStoryResultActiveStoryLimitExceeded(result.Data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(result.Data) - case TypeCanPostStoryResultWeeklyLimitExceeded: - return UnmarshalCanPostStoryResultWeeklyLimitExceeded(result.Data) + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(result.Data) - case TypeCanPostStoryResultMonthlyLimitExceeded: - return UnmarshalCanPostStoryResultMonthlyLimitExceeded(result.Data) - - case TypeCanPostStoryResultLiveStoryIsActive: - return UnmarshalCanPostStoryResultLiveStoryIsActive(result.Data) + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(result.Data) default: return nil, errors.New("invalid type") } } -type PostStoryRequest struct { +type SendStoryRequest struct { // Identifier of the chat that will post the story. Pass Saved Messages chat identifier when posting a story on behalf of the current user ChatId int64 `json:"chat_id"` // Content of the story @@ -12536,10 +11428,8 @@ type PostStoryRequest struct { Areas *InputStoryAreas `json:"areas"` // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") Caption *FormattedText `json:"caption"` - // The privacy settings for the story; ignored for stories posted on behalf of supergroup and channel chats + // The privacy settings for the story; ignored for stories sent to 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_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"` // 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 @@ -12550,11 +11440,11 @@ type PostStoryRequest struct { ProtectContent bool `json:"protect_content"` } -// Posts a new story on behalf of a chat; requires can_post_stories administrator right for supergroup and channel chats. Returns a temporary story -func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { +// Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story +func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { result, err := client.Send(Request{ meta: meta{ - Type: "postStory", + Type: "sendStory", }, Data: map[string]interface{}{ "chat_id": req.ChatId, @@ -12562,7 +11452,6 @@ func (client *Client) PostStory(req *PostStoryRequest) (*Story, error) { "areas": req.Areas, "caption": req.Caption, "privacy_settings": req.PrivacySettings, - "album_ids": req.AlbumIds, "active_period": req.ActivePeriod, "from_story_full_id": req.FromStoryFullId, "is_posted_to_chat_page": req.IsPostedToChatPage, @@ -12580,59 +11469,9 @@ 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"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story to edit StoryId int32 `json:"story_id"` // New content of the story; pass null to keep the current content @@ -12650,7 +11489,7 @@ func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { Type: "editStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "content": req.Content, "areas": req.Areas, @@ -12670,7 +11509,7 @@ func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { type EditStoryCoverRequest struct { // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story to edit StoryId int32 `json:"story_id"` // New timestamp of the frame, which will be used as video thumbnail @@ -12684,7 +11523,7 @@ func (client *Client) EditStoryCover(req *EditStoryCoverRequest) (*Ok, error) { Type: "editStoryCover", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "cover_frame_timestamp": req.CoverFrameTimestamp, }, @@ -12707,7 +11546,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_set_privacy_settings == 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_be_edited == true func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12731,7 +11570,7 @@ func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsReques type ToggleStoryIsPostedToChatPageRequest struct { // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story StoryId int32 `json:"story_id"` // Pass true to make the story accessible after expiration; pass false to make it private @@ -12745,7 +11584,7 @@ func (client *Client) ToggleStoryIsPostedToChatPage(req *ToggleStoryIsPostedToCh Type: "toggleStoryIsPostedToChatPage", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "is_posted_to_chat_page": req.IsPostedToChatPage, }, @@ -12763,19 +11602,19 @@ func (client *Client) ToggleStoryIsPostedToChatPage(req *ToggleStoryIsPostedToCh type DeleteStoryRequest struct { // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story to delete StoryId int32 `json:"story_id"` } -// Deletes a previously posted story. Can be called only if story.can_be_deleted == true +// Deletes a previously sent story. Can be called only if story.can_be_deleted == true func (client *Client) DeleteStory(req *DeleteStoryRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "deleteStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, }, }) @@ -12814,7 +11653,7 @@ type LoadActiveStoriesRequest struct { StoryList StoryList `json:"story_list"` } -// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_poster_chat_id) in descending order. Returns a 404 error if all active stories have been loaded +// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded func (client *Client) LoadActiveStories(req *LoadActiveStoriesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12931,7 +11770,7 @@ type GetChatArchivedStoriesRequest struct { Limit int32 `json:"limit"` } -// Returns the list of all stories posted by the given chat; requires can_edit_stories administrator right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +// Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ @@ -12961,7 +11800,7 @@ type SetChatPinnedStoriesRequest struct { StoryIds []int32 `json:"story_ids"` } -// Changes the list of pinned stories on a chat page; requires can_edit_stories administrator right in the chat +// Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat func (client *Client) SetChatPinnedStories(req *SetChatPinnedStoriesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12984,8 +11823,8 @@ func (client *Client) SetChatPinnedStories(req *SetChatPinnedStoriesRequest) (*O } type OpenStoryRequest struct { - // The identifier of the chat that posted the opened story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the opened story + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` } @@ -12997,7 +11836,7 @@ func (client *Client) OpenStory(req *OpenStoryRequest) (*Ok, error) { Type: "openStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, }, }) @@ -13013,8 +11852,8 @@ func (client *Client) OpenStory(req *OpenStoryRequest) (*Ok, error) { } type CloseStoryRequest struct { - // The identifier of the poster of the story to close - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story to close + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` } @@ -13026,7 +11865,7 @@ func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { Type: "closeStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, }, }) @@ -13068,8 +11907,8 @@ func (client *Client) GetStoryAvailableReactions(req *GetStoryAvailableReactions } type SetStoryReactionRequest struct { - // The identifier of the poster of the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` // 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 @@ -13078,14 +11917,14 @@ type SetStoryReactionRequest struct { UpdateRecentReactions bool `json:"update_recent_reactions"` } -// Changes chosen reaction on a story that has already been sent; not supported for live stories +// Changes chosen reaction on a story that has already been sent func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setStoryReaction", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "reaction_type": req.ReactionType, "update_recent_reactions": req.UpdateRecentReactions, @@ -13147,8 +11986,8 @@ func (client *Client) GetStoryInteractions(req *GetStoryInteractionsRequest) (*S } type GetChatStoryInteractionsRequest struct { - // The identifier of the poster of the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` // Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions; reactionTypePaid isn't supported @@ -13168,7 +12007,7 @@ func (client *Client) GetChatStoryInteractions(req *GetChatStoryInteractionsRequ Type: "getChatStoryInteractions", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "reaction_type": req.ReactionType, "prefer_forwards": req.PreferForwards, @@ -13188,8 +12027,8 @@ func (client *Client) GetChatStoryInteractions(req *GetChatStoryInteractionsRequ } type ReportStoryRequest struct { - // The identifier of the poster of the story to report - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story to report + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story to report StoryId int32 `json:"story_id"` // Option identifier chosen by the user; leave empty for the initial request @@ -13205,7 +12044,7 @@ func (client *Client) ReportStory(req *ReportStoryRequest) (ReportStoryResult, e Type: "reportStory", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "option_id": req.OptionId, "text": req.Text, @@ -13254,8 +12093,8 @@ func (client *Client) ActivateStoryStealthMode() (*Ok, error) { } type GetStoryPublicForwardsRequest struct { - // The identifier of the poster of the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -13271,7 +12110,7 @@ func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) Type: "getStoryPublicForwards", }, Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "offset": req.Offset, "limit": req.Limit, @@ -13288,285 +12127,6 @@ func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) return UnmarshalPublicForwards(result.Data) } -type GetChatStoryAlbumsRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Returns the list of story albums owned by the given chat -func (client *Client) GetChatStoryAlbums(req *GetChatStoryAlbumsRequest) (*StoryAlbums, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getChatStoryAlbums", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbums(result.Data) -} - -type GetStoryAlbumStoriesRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` - // Story album identifier - StoryAlbumId int32 `json:"story_album_id"` - // Offset of the first entry to return; use 0 to get results from the first album story - Offset int32 `json:"offset"` - // The maximum number of stories to be returned. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns the list of stories added to the given story album. For optimal performance, the number of returned stories is chosen by TDLib -func (client *Client) GetStoryAlbumStories(req *GetStoryAlbumStoriesRequest) (*Stories, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getStoryAlbumStories", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStories(result.Data) -} - -type CreateStoryAlbumRequest struct { - // Identifier of the chat that posted the stories - 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_size_max") identifiers - StoryIds []int32 `json:"story_ids"` -} - -// Creates an album of stories; requires can_edit_stories administrator right for supergroup and channel chats -func (client *Client) CreateStoryAlbum(req *CreateStoryAlbumRequest) (*StoryAlbum, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "createStoryAlbum", - }, - Data: map[string]interface{}{ - "story_poster_chat_id": req.StoryPosterChatId, - "name": req.Name, - "story_ids": req.StoryIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbum(result.Data) -} - -type ReorderStoryAlbumsRequest struct { - // Identifier of the chat that owns the stories - ChatId int64 `json:"chat_id"` - // New order of story albums - StoryAlbumIds []int32 `json:"story_album_ids"` -} - -// 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 -func (client *Client) ReorderStoryAlbums(req *ReorderStoryAlbumsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "reorderStoryAlbums", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_ids": req.StoryAlbumIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type DeleteStoryAlbumRequest struct { - // Identifier of the chat that owns the stories - ChatId int64 `json:"chat_id"` - // Identifier of the story album - StoryAlbumId int32 `json:"story_album_id"` -} - -// Deletes a story album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat -func (client *Client) DeleteStoryAlbum(req *DeleteStoryAlbumRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "deleteStoryAlbum", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SetStoryAlbumNameRequest struct { - // Identifier of the chat that owns the stories - ChatId int64 `json:"chat_id"` - // Identifier of the story album - StoryAlbumId int32 `json:"story_album_id"` - // New name of the album; 1-12 characters - Name string `json:"name"` -} - -// Changes name of an album of stories. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album -func (client *Client) SetStoryAlbumName(req *SetStoryAlbumNameRequest) (*StoryAlbum, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setStoryAlbumName", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - "name": req.Name, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbum(result.Data) -} - -type AddStoryAlbumStoriesRequest struct { - // Identifier of the chat that owns the stories - 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_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"` -} - -// Adds stories to the beginning of a previously created story album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album -func (client *Client) AddStoryAlbumStories(req *AddStoryAlbumStoriesRequest) (*StoryAlbum, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addStoryAlbumStories", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - "story_ids": req.StoryIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbum(result.Data) -} - -type RemoveStoryAlbumStoriesRequest struct { - // Identifier of the chat that owns the stories - ChatId int64 `json:"chat_id"` - // Identifier of the story album - StoryAlbumId int32 `json:"story_album_id"` - // Identifier of the stories to remove from the album - StoryIds []int32 `json:"story_ids"` -} - -// Removes stories from an album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album -func (client *Client) RemoveStoryAlbumStories(req *RemoveStoryAlbumStoriesRequest) (*StoryAlbum, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeStoryAlbumStories", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - "story_ids": req.StoryIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbum(result.Data) -} - -type ReorderStoryAlbumStoriesRequest struct { - // Identifier of the chat that owns the stories - ChatId int64 `json:"chat_id"` - // Identifier of the story album - StoryAlbumId int32 `json:"story_album_id"` - // Identifier of the stories to move to the beginning of the album. All other stories are placed in the current order after the specified stories - StoryIds []int32 `json:"story_ids"` -} - -// Changes order of stories in an album. If the album is owned by a supergroup or a channel chat, then requires can_edit_stories administrator right in the chat. Returns the changed album -func (client *Client) ReorderStoryAlbumStories(req *ReorderStoryAlbumStoriesRequest) (*StoryAlbum, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "reorderStoryAlbumStories", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "story_album_id": req.StoryAlbumId, - "story_ids": req.StoryIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalStoryAlbum(result.Data) -} - type GetChatBoostLevelFeaturesRequest struct { // Pass true to get the list of features for channels; pass false to get the list of features for supergroups IsChannel bool `json:"is_channel"` @@ -14003,7 +12563,7 @@ func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatusCustomEmojis, e return UnmarshalEmojiStatusCustomEmojis(result.Data) } -// Returns the list of emoji statuses, which can't be used as chat emoji status, even if they are from a sticker set with is_allowed_as_chat_emoji_status == true +// Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatusCustomEmojis, error) { result, err := client.Send(Request{ meta: meta{ @@ -14156,7 +12716,7 @@ type PreliminaryUploadFileRequest struct { Priority int32 `json:"priority"` } -// 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 +// 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 func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) { result, err := client.Send(Request{ meta: meta{ @@ -14308,7 +12868,7 @@ type ReadFilePartRequest struct { } // Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file -func (client *Client) ReadFilePart(req *ReadFilePartRequest) (*Data, error) { +func (client *Client) ReadFilePart(req *ReadFilePartRequest) (*FilePart, error) { result, err := client.Send(Request{ meta: meta{ Type: "readFilePart", @@ -14327,7 +12887,7 @@ func (client *Client) ReadFilePart(req *ReadFilePartRequest) (*Data, error) { return nil, buildResponseError(result.Data) } - return UnmarshalData(result.Data) + return UnmarshalFilePart(result.Data) } type DeleteFileRequest struct { @@ -14548,11 +13108,11 @@ func (client *Client) SearchFileDownloads(req *SearchFileDownloadsRequest) (*Fou type SetApplicationVerificationTokenRequest struct { // Unique identifier for the verification process as received from updateApplicationVerificationRequired or updateApplicationRecaptchaVerificationRequired VerificationId int64 `json:"verification_id"` - // 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 + // 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 error VERIFICATION_FAILED for the request Token string `json:"token"` } -// Informs TDLib that application or reCAPTCHA verification has been completed. Can be called before authorization +// 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{ @@ -15153,7 +13713,7 @@ func (client *Client) GetChatJoinRequests(req *GetChatJoinRequestsRequest) (*Cha type ProcessChatJoinRequestRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the user who sent the request + // Identifier of the user that sent the request UserId int64 `json:"user_id"` // Pass true to approve the request; pass false to decline it Approve bool `json:"approve"` @@ -15214,102 +13774,6 @@ func (client *Client) ProcessChatJoinRequests(req *ProcessChatJoinRequestsReques return UnmarshalOk(result.Data) } -type ApproveSuggestedPostRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the message with the suggested post. Use messageProperties.can_be_approved to check whether the suggested post can be approved - MessageId int64 `json:"message_id"` - // Point in time (Unix timestamp) when the post is expected to be published; pass 0 if the date has already been chosen. If specified, then the date must be in the future, but at most getOption("suggested_post_send_delay_max") seconds in the future - SendDate int32 `json:"send_date"` -} - -// Approves a suggested post in a channel direct messages chat -func (client *Client) ApproveSuggestedPost(req *ApproveSuggestedPostRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "approveSuggestedPost", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "send_date": req.SendDate, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type DeclineSuggestedPostRequest struct { - // Chat identifier of the channel direct messages chat - ChatId int64 `json:"chat_id"` - // Identifier of the message with the suggested post. Use messageProperties.can_be_declined to check whether the suggested post can be declined - MessageId int64 `json:"message_id"` - // Comment for the creator of the suggested post; 0-128 characters - Comment string `json:"comment"` -} - -// Declines a suggested post in a channel direct messages chat -func (client *Client) DeclineSuggestedPost(req *DeclineSuggestedPostRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "declineSuggestedPost", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "comment": req.Comment, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type AddOfferRequest struct { - // Identifier of the channel direct messages chat - ChatId int64 `json:"chat_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 or messageProperties.can_edit_suggested_post_info to check whether price or time of sending of the post can be changed - MessageId int64 `json:"message_id"` - // Options to be used to send the message. New information about the suggested post must always be specified - Options *MessageSendOptions `json:"options"` -} - -// 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{ - Type: "addOffer", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "options": req.Options, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalMessage(result.Data) -} - type CreateCallRequest struct { // Identifier of the user to be called UserId int64 `json:"user_id"` @@ -15317,6 +13781,8 @@ type CreateCallRequest struct { Protocol *CallProtocol `json:"protocol"` // Pass true to create a video call IsVideo bool `json:"is_video"` + // Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none + GroupCallId int32 `json:"group_call_id"` } // Creates a new call @@ -15329,6 +13795,7 @@ func (client *Client) CreateCall(req *CreateCallRequest) (*CallId, error) { "user_id": req.UserId, "protocol": req.Protocol, "is_video": req.IsVideo, + "group_call_id": req.GroupCallId, }, }) if err != nil { @@ -15405,8 +13872,6 @@ type DiscardCallRequest struct { CallId int32 `json:"call_id"` // Pass true if the user was disconnected IsDisconnected bool `json:"is_disconnected"` - // If the call was upgraded to a group call, pass invite link to the group call - InviteLink string `json:"invite_link"` // The call duration, in seconds Duration int32 `json:"duration"` // Pass true if the call was a video call @@ -15424,7 +13889,6 @@ func (client *Client) DiscardCall(req *DiscardCallRequest) (*Ok, error) { Data: map[string]interface{}{ "call_id": req.CallId, "is_disconnected": req.IsDisconnected, - "invite_link": req.InviteLink, "duration": req.Duration, "is_video": req.IsVideo, "connection_id": req.ConnectionId, @@ -15563,7 +14027,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 in the chat + // Default group call participant identifier to join the video chats DefaultParticipantId MessageSender `json:"default_participant_id"` } @@ -15625,18 +14089,18 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId } type CreateGroupCallRequest struct { - // Parameters to join the call; pass null to only create call link without joining the call - JoinParameters *GroupCallJoinParameters `json:"join_parameters"` + // Call identifier + CallId int32 `json:"call_id"` } -// Creates a new group call that isn't bound to a chat -func (client *Client) CreateGroupCall(req *CreateGroupCallRequest) (*GroupCallInfo, error) { +// Creates a group call from a one-to-one call +func (client *Client) CreateGroupCall(req *CreateGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "createGroupCall", }, Data: map[string]interface{}{ - "join_parameters": req.JoinParameters, + "call_id": req.CallId, }, }) if err != nil { @@ -15647,7 +14111,7 @@ func (client *Client) CreateGroupCall(req *CreateGroupCallRequest) (*GroupCallIn return nil, buildResponseError(result.Data) } - return UnmarshalGroupCallInfo(result.Data) + return UnmarshalOk(result.Data) } type GetVideoChatRtmpUrlRequest struct { @@ -15655,7 +14119,7 @@ type GetVideoChatRtmpUrlRequest struct { ChatId int64 `json:"chat_id"` } -// Returns RTMP URL for streaming to the video chat of a chat; requires can_manage_video_chats administrator right +// Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right func (client *Client) GetVideoChatRtmpUrl(req *GetVideoChatRtmpUrlRequest) (*RtmpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -15681,7 +14145,7 @@ type ReplaceVideoChatRtmpUrlRequest struct { ChatId int64 `json:"chat_id"` } -// Replaces the current RTMP URL for streaming to the video chat of a chat; requires owner privileges in the chat +// Replaces the current RTMP URL for streaming to the chat; requires owner privileges func (client *Client) ReplaceVideoChatRtmpUrl(req *ReplaceVideoChatRtmpUrlRequest) (*RtmpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -15702,58 +14166,6 @@ 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"` @@ -15780,16 +14192,16 @@ func (client *Client) GetGroupCall(req *GetGroupCallRequest) (*GroupCall, error) return UnmarshalGroupCall(result.Data) } -type StartScheduledVideoChatRequest struct { - // Group call identifier of the video chat +type StartScheduledGroupCallRequest struct { + // Group call identifier GroupCallId int32 `json:"group_call_id"` } -// Starts a scheduled video chat -func (client *Client) StartScheduledVideoChat(req *StartScheduledVideoChatRequest) (*Ok, error) { +// Starts a scheduled group call +func (client *Client) StartScheduledGroupCall(req *StartScheduledGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "startScheduledVideoChat", + Type: "startScheduledGroupCall", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -15806,18 +14218,18 @@ func (client *Client) StartScheduledVideoChat(req *StartScheduledVideoChatReques return UnmarshalOk(result.Data) } -type ToggleVideoChatEnabledStartNotificationRequest struct { +type ToggleGroupCallEnabledStartNotificationRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // New value of the enabled_start_notification setting EnabledStartNotification bool `json:"enabled_start_notification"` } -// Toggles whether the current user will receive a notification when the video chat starts; for scheduled video chats only -func (client *Client) ToggleVideoChatEnabledStartNotification(req *ToggleVideoChatEnabledStartNotificationRequest) (*Ok, error) { +// Toggles whether the current user will receive a notification when the group call starts; scheduled group calls only +func (client *Client) ToggleGroupCallEnabledStartNotification(req *ToggleGroupCallEnabledStartNotificationRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleVideoChatEnabledStartNotification", + Type: "toggleGroupCallEnabledStartNotification", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -15836,85 +14248,39 @@ func (client *Client) ToggleVideoChatEnabledStartNotification(req *ToggleVideoCh } type JoinGroupCallRequest struct { - // The group call to join - InputGroupCall InputGroupCall `json:"input_group_call"` - // Parameters to join the call - JoinParameters *GroupCallJoinParameters `json:"join_parameters"` + // 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 + ParticipantId MessageSender `json:"participant_id"` + // Caller audio channel synchronization source identifier; received from tgcalls + AudioSourceId int32 `json:"audio_source_id"` + // Group call join payload; received from tgcalls + Payload string `json:"payload"` + // Pass true to join the call with muted microphone + IsMuted bool `json:"is_muted"` + // Pass true if the user's video is enabled + IsMyVideoEnabled bool `json:"is_my_video_enabled"` + // If non-empty, invite hash to be used to join the group call without being muted by administrators + InviteHash string `json:"invite_hash"` + // Fingerprint of the encryption key for E2E group calls not bound to a chat; pass 0 for voice chats + KeyFingerprint JsonInt64 `json:"key_fingerprint"` } -// Joins a regular group call that is not bound to a chat -func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*GroupCallInfo, error) { +// Joins an active group call. Returns join response payload for tgcalls +func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ Type: "joinGroupCall", }, - Data: map[string]interface{}{ - "input_group_call": req.InputGroupCall, - "join_parameters": req.JoinParameters, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGroupCallInfo(result.Data) -} - -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 - ParticipantId MessageSender `json:"participant_id"` - // Parameters to join the call - JoinParameters *GroupCallJoinParameters `json:"join_parameters"` - // Invite hash as received from internalLinkTypeVideoChat - InviteHash string `json:"invite_hash"` -} - -// Joins an active video chat. Returns join response payload for tgcalls -func (client *Client) JoinVideoChat(req *JoinVideoChatRequest) (*Text, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "joinVideoChat", - }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, "participant_id": req.ParticipantId, - "join_parameters": req.JoinParameters, + "audio_source_id": req.AudioSourceId, + "payload": req.Payload, + "is_muted": req.IsMuted, + "is_my_video_enabled": req.IsMyVideoEnabled, "invite_hash": req.InviteHash, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - 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, + "key_fingerprint": req.KeyFingerprint, }, }) if err != nil { @@ -15937,7 +14303,7 @@ type StartGroupCallScreenSharingRequest struct { Payload string `json:"payload"` } -// Starts screen sharing in a joined group call; not supported in live stories. Returns join response payload for tgcalls +// Starts screen sharing in a joined group call. Returns join response payload for tgcalls func (client *Client) StartGroupCallScreenSharing(req *StartGroupCallScreenSharingRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -15967,7 +14333,7 @@ type ToggleGroupCallScreenSharingIsPausedRequest struct { IsPaused bool `json:"is_paused"` } -// Pauses or unpauses screen sharing in a joined group call; not supported in live stories +// Pauses or unpauses screen sharing in a joined group call func (client *Client) ToggleGroupCallScreenSharingIsPaused(req *ToggleGroupCallScreenSharingIsPausedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -15994,7 +14360,7 @@ type EndGroupCallScreenSharingRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends screen sharing in a joined group call; not supported in live stories +// Ends screen sharing in a joined group call func (client *Client) EndGroupCallScreenSharing(req *EndGroupCallScreenSharingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16015,18 +14381,18 @@ func (client *Client) EndGroupCallScreenSharing(req *EndGroupCallScreenSharingRe return UnmarshalOk(result.Data) } -type SetVideoChatTitleRequest struct { +type SetGroupCallTitleRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // New group call title; 1-64 characters Title string `json:"title"` } -// Sets title of a video chat; requires groupCall.can_be_managed right -func (client *Client) SetVideoChatTitle(req *SetVideoChatTitleRequest) (*Ok, error) { +// Sets group call title. Requires groupCall.can_be_managed group call flag +func (client *Client) SetGroupCallTitle(req *SetGroupCallTitleRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "setVideoChatTitle", + Type: "setGroupCallTitle", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16044,18 +14410,18 @@ func (client *Client) SetVideoChatTitle(req *SetVideoChatTitleRequest) (*Ok, err return UnmarshalOk(result.Data) } -type ToggleVideoChatMuteNewParticipantsRequest struct { +type ToggleGroupCallMuteNewParticipantsRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // New value of the mute_new_participants setting MuteNewParticipants bool `json:"mute_new_participants"` } -// Toggles whether new participants of a video chat can be unmuted only by administrators of the video chat. Requires groupCall.can_toggle_mute_new_participants right -func (client *Client) ToggleVideoChatMuteNewParticipants(req *ToggleVideoChatMuteNewParticipantsRequest) (*Ok, error) { +// Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag +func (client *Client) ToggleGroupCallMuteNewParticipants(req *ToggleGroupCallMuteNewParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "toggleVideoChatMuteNewParticipants", + Type: "toggleGroupCallMuteNewParticipants", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16073,436 +14439,18 @@ func (client *Client) ToggleVideoChatMuteNewParticipants(req *ToggleVideoChatMut return UnmarshalOk(result.Data) } -type ToggleGroupCallAreMessagesAllowedRequest struct { - // Group call identifier - GroupCallId int32 `json:"group_call_id"` - // 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_are_messages_allowed right -func (client *Client) ToggleGroupCallAreMessagesAllowed(req *ToggleGroupCallAreMessagesAllowedRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleGroupCallAreMessagesAllowed", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "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 { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -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 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 -func (client *Client) SendGroupCallMessage(req *SendGroupCallMessageRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendGroupCallMessage", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "text": req.Text, - "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 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"` - // User identifier - UserId int64 `json:"user_id"` - // Pass true if the group call is a video call - IsVideo bool `json:"is_video"` -} - -// 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 -func (client *Client) InviteGroupCallParticipant(req *InviteGroupCallParticipantRequest) (InviteGroupCallParticipantResult, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "inviteGroupCallParticipant", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "user_id": req.UserId, - "is_video": req.IsVideo, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - switch result.Type { - case TypeInviteGroupCallParticipantResultUserPrivacyRestricted: - return UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(result.Data) - - case TypeInviteGroupCallParticipantResultUserAlreadyParticipant: - return UnmarshalInviteGroupCallParticipantResultUserAlreadyParticipant(result.Data) - - case TypeInviteGroupCallParticipantResultUserWasBanned: - return UnmarshalInviteGroupCallParticipantResultUserWasBanned(result.Data) - - case TypeInviteGroupCallParticipantResultSuccess: - return UnmarshalInviteGroupCallParticipantResultSuccess(result.Data) - - default: - return nil, errors.New("invalid type") - } -} - -type DeclineGroupCallInvitationRequest struct { - // Identifier of the chat with the message - ChatId int64 `json:"chat_id"` - // Identifier of the message of the type messageGroupCall - MessageId int64 `json:"message_id"` -} - -// Declines an invitation to an active group call via messageGroupCall. Can be called both by the sender and the receiver of the invitation -func (client *Client) DeclineGroupCallInvitation(req *DeclineGroupCallInvitationRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "declineGroupCallInvitation", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type BanGroupCallParticipantsRequest struct { - // Group call identifier - GroupCallId int32 `json:"group_call_id"` - // Identifiers of group call participants to ban; identifiers of unknown users from the update updateGroupCallParticipants can be also passed to the method - UserIds []JsonInt64 `json:"user_ids"` -} - -// Bans users from a group call not bound to a chat; requires groupCall.is_owned. Only the owner of the group call can invite the banned users back -func (client *Client) BanGroupCallParticipants(req *BanGroupCallParticipantsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "banGroupCallParticipants", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "user_ids": req.UserIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type InviteVideoChatParticipantsRequest struct { +type InviteGroupCallParticipantsRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` // User identifiers. At most 10 users can be invited simultaneously UserIds []int64 `json:"user_ids"` } -// Invites users to an active video chat. Sends a service message of the type messageInviteVideoChatParticipants to the chat bound to the group call -func (client *Client) InviteVideoChatParticipants(req *InviteVideoChatParticipantsRequest) (*Ok, error) { +// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats +func (client *Client) InviteGroupCallParticipants(req *InviteGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "inviteVideoChatParticipants", + Type: "inviteGroupCallParticipants", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16520,18 +14468,18 @@ func (client *Client) InviteVideoChatParticipants(req *InviteVideoChatParticipan return UnmarshalOk(result.Data) } -type GetVideoChatInviteLinkRequest struct { +type GetGroupCallInviteLinkRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // Pass true if the invite link needs to contain an invite hash, passing which to joinVideoChat would allow the invited user to unmute themselves. Requires groupCall.can_be_managed right + // Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag CanSelfUnmute bool `json:"can_self_unmute"` } // Returns invite link to a video chat in a public chat -func (client *Client) GetVideoChatInviteLink(req *GetVideoChatInviteLinkRequest) (*HttpUrl, error) { +func (client *Client) GetGroupCallInviteLink(req *GetGroupCallInviteLinkRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getVideoChatInviteLink", + Type: "getGroupCallInviteLink", }, Data: map[string]interface{}{ "group_call_id": req.GroupCallId, @@ -16554,7 +14502,7 @@ type RevokeGroupCallInviteLinkRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Revokes invite link for a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise +// Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag func (client *Client) RevokeGroupCallInviteLink(req *RevokeGroupCallInviteLinkRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16586,7 +14534,7 @@ type StartGroupCallRecordingRequest struct { UsePortraitOrientation bool `json:"use_portrait_orientation"` } -// Starts recording of an active group call; for video chats only. Requires groupCall.can_be_managed right +// Starts recording of an active group call. Requires groupCall.can_be_managed group call flag func (client *Client) StartGroupCallRecording(req *StartGroupCallRecordingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16615,7 +14563,7 @@ type EndGroupCallRecordingRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends recording of an active group call; for video chats only. Requires groupCall.can_be_managed right +// Ends recording of an active group call. Requires groupCall.can_be_managed group call flag func (client *Client) EndGroupCallRecording(req *EndGroupCallRecordingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16694,35 +14642,6 @@ 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"` @@ -16732,8 +14651,8 @@ type SetGroupCallParticipantIsSpeakingRequest struct { IsSpeaking bool `json:"is_speaking"` } -// Informs TDLib that speaking state of a participant of an active group call has changed. Returns identifier of the participant if it is found -func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallParticipantIsSpeakingRequest) (MessageSender, error) { +// Informs TDLib that speaking state of a participant of an active group has changed +func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallParticipantIsSpeakingRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setGroupCallParticipantIsSpeaking", @@ -16752,16 +14671,7 @@ func (client *Client) SetGroupCallParticipantIsSpeaking(req *SetGroupCallPartici return nil, buildResponseError(result.Data) } - switch result.Type { - case TypeMessageSenderUser: - return UnmarshalMessageSenderUser(result.Data) - - case TypeMessageSenderChat: - return UnmarshalMessageSenderChat(result.Data) - - default: - return nil, errors.New("invalid type") - } + return UnmarshalOk(result.Data) } type ToggleGroupCallParticipantIsMutedRequest struct { @@ -16773,7 +14683,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; not supported for live stories +// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves func (client *Client) ToggleGroupCallParticipantIsMuted(req *ToggleGroupCallParticipantIsMutedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16805,7 +14715,7 @@ type SetGroupCallParticipantVolumeLevelRequest struct { VolumeLevel int32 `json:"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 +// Changes volume level of a participant of an active group call. If the current user can manage 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{ @@ -16833,11 +14743,11 @@ type ToggleGroupCallParticipantIsHandRaisedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed right to lower other's hand + // Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand IsHandRaised bool `json:"is_hand_raised"` } -// Toggles whether a group call participant hand is rased; for video chats only +// Toggles whether a group call participant hand is rased func (client *Client) ToggleGroupCallParticipantIsHandRaised(req *ToggleGroupCallParticipantIsHandRaisedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16860,35 +14770,6 @@ func (client *Client) ToggleGroupCallParticipantIsHandRaised(req *ToggleGroupCal return UnmarshalOk(result.Data) } -type GetGroupCallParticipantsRequest struct { - // The group call which participants will be returned - InputGroupCall InputGroupCall `json:"input_group_call"` - // The maximum number of participants to return; must be positive - Limit int32 `json:"limit"` -} - -// Returns information about participants of a non-joined group call that is not bound to a chat -func (client *Client) GetGroupCallParticipants(req *GetGroupCallParticipantsRequest) (*GroupCallParticipants, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getGroupCallParticipants", - }, - Data: map[string]interface{}{ - "input_group_call": req.InputGroupCall, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGroupCallParticipants(result.Data) -} - type LoadGroupCallParticipantsRequest struct { // Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined GroupCallId int32 `json:"group_call_id"` @@ -16896,7 +14777,7 @@ type LoadGroupCallParticipantsRequest struct { Limit int32 `json:"limit"` } -// 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 +// 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 func (client *Client) LoadGroupCallParticipants(req *LoadGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16949,7 +14830,7 @@ type EndGroupCallRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Ends a group call. Requires groupCall.can_be_managed right for video chats and live stories or groupCall.is_owned otherwise +// Ends a group call. Requires groupCall.can_be_managed func (client *Client) EndGroupCall(req *EndGroupCallRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16975,7 +14856,7 @@ type GetGroupCallStreamsRequest struct { GroupCallId int32 `json:"group_call_id"` } -// Returns information about available streams in a video chat or a live story +// Returns information about available group call streams func (client *Client) GetGroupCallStreams(req *GetGroupCallStreamsRequest) (*GroupCallStreams, error) { result, err := client.Send(Request{ meta: meta{ @@ -17009,8 +14890,8 @@ type GetGroupCallStreamSegmentRequest struct { VideoQuality GroupCallVideoQuality `json:"video_quality"` } -// 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) { +// Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video +func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRequest) (*FilePart, error) { result, err := client.Send(Request{ meta: meta{ Type: "getGroupCallStreamSegment", @@ -17031,77 +14912,7 @@ func (client *Client) GetGroupCallStreamSegment(req *GetGroupCallStreamSegmentRe return nil, buildResponseError(result.Data) } - return UnmarshalData(result.Data) -} - -type EncryptGroupCallDataRequest struct { - // Group call identifier. The call must not be a video chat - GroupCallId int32 `json:"group_call_id"` - // Data channel for which data is encrypted - DataChannel GroupCallDataChannel `json:"data_channel"` - // Data to encrypt - Data []byte `json:"data"` - // Size of data prefix that must be kept unencrypted - UnencryptedPrefixSize int32 `json:"unencrypted_prefix_size"` -} - -// Encrypts group call data before sending them over network using tgcalls -func (client *Client) EncryptGroupCallData(req *EncryptGroupCallDataRequest) (*Data, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "encryptGroupCallData", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "data_channel": req.DataChannel, - "data": req.Data, - "unencrypted_prefix_size": req.UnencryptedPrefixSize, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalData(result.Data) -} - -type DecryptGroupCallDataRequest struct { - // Group call identifier. The call must not be a video chat - GroupCallId int32 `json:"group_call_id"` - // Identifier of the group call participant, which sent the data - ParticipantId MessageSender `json:"participant_id"` - // Data channel for which data was encrypted; pass null if unknown - DataChannel GroupCallDataChannel `json:"data_channel"` - // Data to decrypt - Data []byte `json:"data"` -} - -// Decrypts group call data received by tgcalls -func (client *Client) DecryptGroupCallData(req *DecryptGroupCallDataRequest) (*Data, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "decryptGroupCallData", - }, - Data: map[string]interface{}{ - "group_call_id": req.GroupCallId, - "participant_id": req.ParticipantId, - "data_channel": req.DataChannel, - "data": req.Data, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalData(result.Data) + return UnmarshalFilePart(result.Data) } type SetMessageSenderBlockListRequest struct { @@ -17201,10 +15012,8 @@ func (client *Client) GetBlockedMessageSenders(req *GetBlockedMessageSendersRequ } type AddContactRequest struct { - // Identifier of the user - UserId int64 `json:"user_id"` - // The contact to add or edit; phone number may be empty and needs to be specified only if known - Contact *ImportedContact `json:"contact"` + // The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored + Contact *Contact `json:"contact"` // Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number SharePhoneNumber bool `json:"share_phone_number"` } @@ -17216,7 +15025,6 @@ func (client *Client) AddContact(req *AddContactRequest) (*Ok, error) { Type: "addContact", }, Data: map[string]interface{}{ - "user_id": req.UserId, "contact": req.Contact, "share_phone_number": req.SharePhoneNumber, }, @@ -17233,8 +15041,8 @@ func (client *Client) AddContact(req *AddContactRequest) (*Ok, error) { } type ImportContactsRequest struct { - // The list of contacts to import or edit - Contacts []*ImportedContact `json:"contacts"` + // The list of contacts to import or edit; contacts' vCard are ignored and are not imported + Contacts []*Contact `json:"contacts"` } // Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @@ -17352,8 +15160,8 @@ func (client *Client) GetImportedContactCount() (*Count, error) { } type ChangeImportedContactsRequest struct { - // The new list of contacts to import - Contacts []*ImportedContact `json:"contacts"` + // The new list of contacts, contact's vCard are ignored and are not imported + Contacts []*Contact `json:"contacts"` } // Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous query, so only one query is possible at the same time @@ -17470,35 +15278,6 @@ func (client *Client) SetUserPersonalProfilePhoto(req *SetUserPersonalProfilePho return UnmarshalOk(result.Data) } -type SetUserNoteRequest struct { - // User identifier - UserId int64 `json:"user_id"` - // Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed - Note *FormattedText `json:"note"` -} - -// Changes a note of a contact user -func (client *Client) SetUserNote(req *SetUserNoteRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setUserNote", - }, - Data: map[string]interface{}{ - "user_id": req.UserId, - "note": req.Note, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SuggestUserProfilePhotoRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -17528,35 +15307,6 @@ func (client *Client) SuggestUserProfilePhoto(req *SuggestUserProfilePhotoReques return UnmarshalOk(result.Data) } -type SuggestUserBirthdateRequest struct { - // User identifier - UserId int64 `json:"user_id"` - // Birthdate to suggest - Birthdate *Birthdate `json:"birthdate"` -} - -// Suggests a birthdate to another regular user with common messages and allowing non-paid messages -func (client *Client) SuggestUserBirthdate(req *SuggestUserBirthdateRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "suggestUserBirthdate", - }, - Data: map[string]interface{}{ - "user_id": req.UserId, - "birthdate": req.Birthdate, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type ToggleBotCanManageEmojiStatusRequest struct { // User identifier of the bot BotUserId int64 `json:"bot_user_id"` @@ -17702,145 +15452,6 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C return UnmarshalChatPhotos(result.Data) } -type GetUserProfileAudiosRequest struct { - // User identifier - UserId int64 `json:"user_id"` - // The number of audio files to skip; must be non-negative - Offset int32 `json:"offset"` - // The maximum number of audio files to be returned; up to 100 - Limit int32 `json:"limit"` -} - -// Returns the list of profile audio files of a user -func (client *Client) GetUserProfileAudios(req *GetUserProfileAudiosRequest) (*Audios, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getUserProfileAudios", - }, - Data: map[string]interface{}{ - "user_id": req.UserId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalAudios(result.Data) -} - -type IsProfileAudioRequest struct { - // Identifier of the audio file to check - FileId int32 `json:"file_id"` -} - -// Checks whether a file is in the profile audio files of the current user. Returns a 404 error if it isn't -func (client *Client) IsProfileAudio(req *IsProfileAudioRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "isProfileAudio", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type AddProfileAudioRequest struct { - // Identifier of the audio file to be added. The file must have been uploaded to the server - FileId int32 `json:"file_id"` -} - -// Adds an audio file to the beginning of the profile audio files of the current user -func (client *Client) AddProfileAudio(req *AddProfileAudioRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addProfileAudio", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SetProfileAudioPositionRequest struct { - // Identifier of the file from profile audio files, which position will be changed - FileId int32 `json:"file_id"` - // Identifier of the file from profile audio files after which the file will be positioned; pass 0 to move the file to the beginning of the list - AfterFileId int32 `json:"after_file_id"` -} - -// Changes position of an audio file in the profile audio files of the current user -func (client *Client) SetProfileAudioPosition(req *SetProfileAudioPositionRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setProfileAudioPosition", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - "after_file_id": req.AfterFileId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type RemoveProfileAudioRequest struct { - // Identifier of the audio file to be removed - FileId int32 `json:"file_id"` -} - -// Removes an audio file from the profile audio files of the current user -func (client *Client) RemoveProfileAudio(req *RemoveProfileAudioRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeProfileAudio", - }, - Data: map[string]interface{}{ - "file_id": req.FileId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type GetStickerOutlineRequest struct { // File identifier of the sticker StickerFileId int32 `json:"sticker_file_id"` @@ -17873,38 +15484,6 @@ 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"` @@ -18649,7 +16228,7 @@ type GetKeywordEmojisRequest struct { InputLanguageCodes []string `json:"input_language_codes"` } -// Returns emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified +// Return 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{ @@ -19057,7 +16636,7 @@ func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) ( type SetProfilePhotoRequest struct { // Profile photo to set Photo InputChatPhoto `json:"photo"` - // Pass true to set the public photo, which will be visible even if the main photo is hidden by privacy settings + // Pass true to set the public photo, which will be visible even the main photo is hidden by privacy settings IsPublic bool `json:"is_public"` } @@ -19138,32 +16717,6 @@ func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SetUpgradedGiftColorsRequest struct { - // Identifier of the upgradedGiftColors scheme to use - UpgradedGiftColorsId JsonInt64 `json:"upgraded_gift_colors_id"` -} - -// Changes color scheme for the current user based on an owned or a hosted upgraded gift; for Telegram Premium users only -func (client *Client) SetUpgradedGiftColors(req *SetUpgradedGiftColorsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setUpgradedGiftColors", - }, - Data: map[string]interface{}{ - "upgraded_gift_colors_id": req.UpgradedGiftColorsId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SetProfileAccentColorRequest struct { // Identifier of the accent color to use for profile; pass -1 if none ProfileAccentColorId int32 `json:"profile_accent_color_id"` @@ -19355,32 +16908,6 @@ func (client *Client) SetBirthdate(req *SetBirthdateRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type SetMainProfileTabRequest struct { - // The new value of the main profile tab - MainProfileTab ProfileTab `json:"main_profile_tab"` -} - -// Changes the main profile tab of the current user -func (client *Client) SetMainProfileTab(req *SetMainProfileTabRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setMainProfileTab", - }, - Data: map[string]interface{}{ - "main_profile_tab": req.MainProfileTab, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type SetPersonalChatRequest struct { // Identifier of the new personal chat; pass 0 to remove the chat. Use getSuitablePersonalChats to get suitable chats ChatId int64 `json:"chat_id"` @@ -19704,7 +17231,7 @@ type CheckPhoneNumberCodeRequest struct { Code string `json:"code"` } -// Checks the authentication code and completes the request for which the code was sent if appropriate +// Check 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{ @@ -20466,7 +17993,7 @@ type DeleteBotMediaPreviewsRequest struct { FileIds []int32 `json:"file_ids"` } -// Deletes media previews from the list of media previews of a bot +// Delete 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{ @@ -20588,7 +18115,7 @@ type ToggleBotUsernameIsActiveRequest struct { IsActive bool `json:"is_active"` } -// Changes active state for a username of a bot. The editable username can be disabled only if there are other active usernames. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true +// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true func (client *Client) ToggleBotUsernameIsActive(req *ToggleBotUsernameIsActiveRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -21264,35 +18791,6 @@ func (client *Client) SetSupergroupUnrestrictBoostCount(req *SetSupergroupUnrest return UnmarshalOk(result.Data) } -type SetSupergroupMainProfileTabRequest struct { - // Identifier of the channel - SupergroupId int64 `json:"supergroup_id"` - // The new value of the main profile tab - MainProfileTab ProfileTab `json:"main_profile_tab"` -} - -// Changes the main profile tab of the channel; requires can_change_info administrator right -func (client *Client) SetSupergroupMainProfileTab(req *SetSupergroupMainProfileTabRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setSupergroupMainProfileTab", - }, - Data: map[string]interface{}{ - "supergroup_id": req.SupergroupId, - "main_profile_tab": req.MainProfileTab, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type ToggleSupergroupSignMessagesRequest struct { // Identifier of the channel SupergroupId int64 `json:"supergroup_id"` @@ -21355,7 +18853,7 @@ func (client *Client) ToggleSupergroupJoinToSendMessages(req *ToggleSupergroupJo } type ToggleSupergroupJoinByRequestRequest struct { - // Identifier of the supergroup that isn't a broadcast group and isn't a channel direct message group + // Identifier of the supergroup that isn't a broadcast group SupergroupId int64 `json:"supergroup_id"` // New value of join_by_request JoinByRequest bool `json:"join_by_request"` @@ -21441,35 +18939,6 @@ func (client *Client) ToggleSupergroupCanHaveSponsoredMessages(req *ToggleSuperg return UnmarshalOk(result.Data) } -type ToggleSupergroupHasAutomaticTranslationRequest struct { - // The identifier of the channel - SupergroupId int64 `json:"supergroup_id"` - // The new value of has_automatic_translation - HasAutomaticTranslation bool `json:"has_automatic_translation"` -} - -// Toggles whether messages are automatically translated in the channel chat; requires can_change_info administrator right in the channel. The chat must have at least chatBoostFeatures.min_automatic_translation_boost_level boost level to enable automatic translation -func (client *Client) ToggleSupergroupHasAutomaticTranslation(req *ToggleSupergroupHasAutomaticTranslationRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "toggleSupergroupHasAutomaticTranslation", - }, - Data: map[string]interface{}{ - "supergroup_id": req.SupergroupId, - "has_automatic_translation": req.HasAutomaticTranslation, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type ToggleSupergroupHasHiddenMembersRequest struct { // Identifier of the supergroup SupergroupId int64 `json:"supergroup_id"` @@ -21533,8 +19002,6 @@ type ToggleSupergroupIsForumRequest struct { SupergroupId int64 `json:"supergroup_id"` // New value of is_forum IsForum bool `json:"is_forum"` - // New value of has_forum_tabs; ignored if is_forum is false - HasForumTabs bool `json:"has_forum_tabs"` } // Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums @@ -21546,7 +19013,6 @@ func (client *Client) ToggleSupergroupIsForum(req *ToggleSupergroupIsForumReques Data: map[string]interface{}{ "supergroup_id": req.SupergroupId, "is_forum": req.IsForum, - "has_forum_tabs": req.HasForumTabs, }, }) if err != nil { @@ -21980,7 +19446,7 @@ func (client *Client) SetGiftSettings(req *SetGiftSettingsRequest) (*Ok, error) } // Returns gifts that can be sent to other users and channel chats -func (client *Client) GetAvailableGifts() (*AvailableGifts, error) { +func (client *Client) GetAvailableGifts() (*Gifts, error) { result, err := client.Send(Request{ meta: meta{ Type: "getAvailableGifts", @@ -21995,48 +19461,13 @@ func (client *Client) GetAvailableGifts() (*AvailableGifts, error) { return nil, buildResponseError(result.Data) } - return UnmarshalAvailableGifts(result.Data) -} - -type CanSendGiftRequest struct { - // Identifier of the gift to send - GiftId JsonInt64 `json:"gift_id"` -} - -// Checks whether a gift with next_send_date in the future can be sent already -func (client *Client) CanSendGift(req *CanSendGiftRequest) (CanSendGiftResult, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "canSendGift", - }, - Data: map[string]interface{}{ - "gift_id": req.GiftId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - switch result.Type { - case TypeCanSendGiftResultOk: - return UnmarshalCanSendGiftResultOk(result.Data) - - case TypeCanSendGiftResultFail: - return UnmarshalCanSendGiftResultFail(result.Data) - - default: - return nil, errors.New("invalid type") - } + return UnmarshalGifts(result.Data) } type SendGiftRequest struct { // Identifier of the gift to send GiftId JsonInt64 `json:"gift_id"` - // Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats + // Identifier of the user or the channel chat that will receive the gift OwnerId MessageSender `json:"owner_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"` @@ -22071,177 +19502,6 @@ 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 who will receive the gift - UserId int64 `json:"user_id"` - // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages - Text *FormattedText `json:"text"` - // 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"` @@ -22249,7 +19509,7 @@ type SellGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` } -// Sells a gift for Telegram Stars; requires owner privileges for gifts owned by a chat +// Sells a gift for Telegram Stars func (client *Client) SellGift(req *SellGiftRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -22359,8 +19619,8 @@ func (client *Client) ToggleChatGiftNotifications(req *ToggleChatGiftNotificatio } type GetGiftUpgradePreviewRequest struct { - // Identifier of the regular gift - RegularGiftId JsonInt64 `json:"regular_gift_id"` + // Identifier of the gift + GiftId JsonInt64 `json:"gift_id"` } // Returns examples of possible upgraded gifts for a regular gift @@ -22370,7 +19630,7 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( Type: "getGiftUpgradePreview", }, Data: map[string]interface{}{ - "regular_gift_id": req.RegularGiftId, + "gift_id": req.GiftId, }, }) if err != nil { @@ -22384,38 +19644,6 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) ( return UnmarshalGiftUpgradePreview(result.Data) } -type GetUpgradedGiftVariantsRequest struct { - // Identifier of the regular gift - RegularGiftId JsonInt64 `json:"regular_gift_id"` - // Pass true to get models that can be obtained by upgrading a regular gift - ReturnUpgradeModels bool `json:"return_upgrade_models"` - // Pass true to get models that can be obtained by crafting a gift from upgraded gifts - ReturnCraftModels bool `json:"return_craft_models"` -} - -// Returns all possible variants of upgraded gifts for a regular gift -func (client *Client) GetUpgradedGiftVariants(req *GetUpgradedGiftVariantsRequest) (*GiftUpgradeVariants, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getUpgradedGiftVariants", - }, - Data: map[string]interface{}{ - "regular_gift_id": req.RegularGiftId, - "return_upgrade_models": req.ReturnUpgradeModels, - "return_craft_models": req.ReturnCraftModels, - }, - }) - 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"` @@ -22423,7 +19651,7 @@ type UpgradeGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Pass true to keep the original gift text, sender and receiver in the upgraded gift KeepOriginalDetails bool `json:"keep_original_details"` - // The Telegram Star amount required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count + // The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count StarCount int64 `json:"star_count"` } @@ -22451,79 +19679,6 @@ func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult, return UnmarshalUpgradeGiftResult(result.Data) } -type BuyGiftUpgradeRequest struct { - // Identifier of the user or the channel chat that owns the gift - OwnerId MessageSender `json:"owner_id"` - // Prepaid upgrade hash as received along with the gift - PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - // The Telegram Star amount the user agreed to pay for the upgrade; must be equal to gift.upgrade_star_count - StarCount int64 `json:"star_count"` -} - -// Pays for upgrade of a regular gift that is owned by another user or channel chat -func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "buyGiftUpgrade", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "prepaid_upgrade_hash": req.PrepaidUpgradeHash, - "star_count": req.StarCount, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type CraftGiftRequest struct { - // Identifier of the gifts to use for crafting - ReceivedGiftIds []string `json:"received_gift_ids"` -} - -// Crafts a new gift from other gifts that will be permanently lost -func (client *Client) CraftGift(req *CraftGiftRequest) (CraftGiftResult, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "craftGift", - }, - Data: map[string]interface{}{ - "received_gift_ids": req.ReceivedGiftIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - switch result.Type { - case TypeCraftGiftResultSuccess: - return UnmarshalCraftGiftResultSuccess(result.Data) - - case TypeCraftGiftResultTooEarly: - return UnmarshalCraftGiftResultTooEarly(result.Data) - - case TypeCraftGiftResultInvalidGift: - return UnmarshalCraftGiftResultInvalidGift(result.Data) - - case TypeCraftGiftResultFail: - return UnmarshalCraftGiftResultFail(result.Data) - - default: - return nil, errors.New("invalid type") - } -} - type TransferGiftRequest struct { // Unique identifier of business connection on behalf of which to send the request; for bots only BusinessConnectionId string `json:"business_connection_id"` @@ -22531,11 +19686,11 @@ type TransferGiftRequest struct { ReceivedGiftId string `json:"received_gift_id"` // Identifier of the user or the channel chat that will receive the gift NewOwnerId MessageSender `json:"new_owner_id"` - // The Telegram Star amount required to pay for the transfer + // The amount of Telegram Stars required to pay for the transfer StarCount int64 `json:"star_count"` } -// Sends an upgraded gift to another user or channel chat +// Sends an upgraded gift to another user or a channel chat func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -22559,166 +19714,21 @@ func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type DropGiftOriginalDetailsRequest struct { - // Identifier of the gift - ReceivedGiftId string `json:"received_gift_id"` - // The Telegram Star amount required to pay for the operation - StarCount int64 `json:"star_count"` -} - -// Drops original details for an upgraded gift -func (client *Client) DropGiftOriginalDetails(req *DropGiftOriginalDetailsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "dropGiftOriginalDetails", - }, - Data: map[string]interface{}{ - "received_gift_id": req.ReceivedGiftId, - "star_count": req.StarCount, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SendResoldGiftRequest struct { - // Name of the upgraded gift to send - GiftName string `json:"gift_name"` - // Identifier of the user or the channel chat that will receive the gift - OwnerId MessageSender `json:"owner_id"` - // The price that the user agreed to pay for the gift - Price GiftResalePrice `json:"price"` -} - -// Sends an upgraded gift that is available for resale to another user or channel chat; gifts already owned by the current user must be transferred using transferGift and can't be passed to the method -func (client *Client) SendResoldGift(req *SendResoldGiftRequest) (GiftResaleResult, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendResoldGift", - }, - Data: map[string]interface{}{ - "gift_name": req.GiftName, - "owner_id": req.OwnerId, - "price": req.Price, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - switch result.Type { - case TypeGiftResaleResultOk: - return UnmarshalGiftResaleResultOk(result.Data) - - case TypeGiftResaleResultPriceIncreased: - return UnmarshalGiftResaleResultPriceIncreased(result.Data) - - default: - return nil, errors.New("invalid type") - } -} - -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"` // Identifier of the gift receiver OwnerId MessageSender `json:"owner_id"` - // Pass collection identifier to get gifts only from the specified collection; pass 0 to get gifts regardless of collections - CollectionId int32 `json:"collection_id"` // Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right ExcludeUnsaved bool `json:"exclude_unsaved"` // Pass true to exclude gifts that are saved to the chat's profile page. Always false for gifts received by other users and channel chats without can_post_messages administrator right ExcludeSaved bool `json:"exclude_saved"` // Pass true to exclude gifts that can be purchased unlimited number of times ExcludeUnlimited bool `json:"exclude_unlimited"` - // Pass true to exclude gifts that can be purchased limited number of times and can be upgraded - ExcludeUpgradable bool `json:"exclude_upgradable"` - // Pass true to exclude gifts that can be purchased limited number of times and can't be upgraded - ExcludeNonUpgradable bool `json:"exclude_non_upgradable"` + // Pass true to exclude gifts that can be purchased limited number of times + ExcludeLimited bool `json:"exclude_limited"` // Pass true to exclude upgraded gifts ExcludeUpgraded bool `json:"exclude_upgraded"` - // Pass true to exclude gifts that can't be used in setUpgradedGiftColors - ExcludeWithoutColors bool `json:"exclude_without_colors"` - // Pass true to exclude gifts that are just hosted and are not owned by the owner - ExcludeHosted bool `json:"exclude_hosted"` // Pass true to sort results by gift price instead of send date SortByPrice bool `json:"sort_by_price"` // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -22736,15 +19746,11 @@ func (client *Client) GetReceivedGifts(req *GetReceivedGiftsRequest) (*ReceivedG Data: map[string]interface{}{ "business_connection_id": req.BusinessConnectionId, "owner_id": req.OwnerId, - "collection_id": req.CollectionId, "exclude_unsaved": req.ExcludeUnsaved, "exclude_saved": req.ExcludeSaved, "exclude_unlimited": req.ExcludeUnlimited, - "exclude_upgradable": req.ExcludeUpgradable, - "exclude_non_upgradable": req.ExcludeNonUpgradable, + "exclude_limited": req.ExcludeLimited, "exclude_upgraded": req.ExcludeUpgraded, - "exclude_without_colors": req.ExcludeWithoutColors, - "exclude_hosted": req.ExcludeHosted, "sort_by_price": req.SortByPrice, "offset": req.Offset, "limit": req.Limit, @@ -22787,38 +19793,6 @@ func (client *Client) GetReceivedGift(req *GetReceivedGiftRequest) (*ReceivedGif return UnmarshalReceivedGift(result.Data) } -type GetGiftsForCraftingRequest struct { - // Identifier of the regular gift that will be used for crafting - RegularGiftId JsonInt64 `json:"regular_gift_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns upgraded gifts of the current user who can be used to craft another gifts -func (client *Client) GetGiftsForCrafting(req *GetGiftsForCraftingRequest) (*GiftsForCrafting, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getGiftsForCrafting", - }, - Data: map[string]interface{}{ - "regular_gift_id": req.RegularGiftId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftsForCrafting(result.Data) -} - type GetUpgradedGiftRequest struct { // Unique name of the upgraded gift Name string `json:"name"` @@ -22845,32 +19819,6 @@ func (client *Client) GetUpgradedGift(req *GetUpgradedGiftRequest) (*UpgradedGif return UnmarshalUpgradedGift(result.Data) } -type GetUpgradedGiftValueInfoRequest struct { - // Unique name of the upgraded gift - Name string `json:"name"` -} - -// Returns information about value of an upgraded gift by its name -func (client *Client) GetUpgradedGiftValueInfo(req *GetUpgradedGiftValueInfoRequest) (*UpgradedGiftValueInfo, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getUpgradedGiftValueInfo", - }, - Data: map[string]interface{}{ - "name": req.Name, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalUpgradedGiftValueInfo(result.Data) -} - type GetUpgradedGiftWithdrawalUrlRequest struct { // Identifier of the gift ReceivedGiftId string `json:"received_gift_id"` @@ -22900,339 +19848,6 @@ 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"` - // The new price for the unique gift; pass null to disallow gift resale. The current user will receive getOption("gift_resale_star_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for the gift if the gift price is in Telegram Stars or getOption("gift_resale_ton_earnings_per_mille") Toncoins for each 1000 Toncoins paid for the gift if the gift price is in Toncoins - Price GiftResalePrice `json:"price"` -} - -// Changes resale price of a unique gift owned by the current user -func (client *Client) SetGiftResalePrice(req *SetGiftResalePriceRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setGiftResalePrice", - }, - Data: map[string]interface{}{ - "received_gift_id": req.ReceivedGiftId, - "price": req.Price, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SearchGiftsForResaleRequest struct { - // Identifier of the regular gift that was upgraded to a unique gift - GiftId JsonInt64 `json:"gift_id"` - // Order in which the results will be sorted - Order GiftForResaleOrder `json:"order"` - // Pass true to get only gifts suitable for crafting - ForCrafting bool `json:"for_crafting"` - // Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. If none attributes of specific type are specified, then all values for this attribute type are allowed - Attributes []UpgradedGiftAttributeId `json:"attributes"` - // Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of gifts to return - Limit int32 `json:"limit"` -} - -// Returns upgraded gifts that can be bought from other owners using sendResoldGift -func (client *Client) SearchGiftsForResale(req *SearchGiftsForResaleRequest) (*GiftsForResale, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "searchGiftsForResale", - }, - Data: map[string]interface{}{ - "gift_id": req.GiftId, - "order": req.Order, - "for_crafting": req.ForCrafting, - "attributes": req.Attributes, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftsForResale(result.Data) -} - -type GetGiftCollectionsRequest struct { - // Identifier of the user or the channel chat that received the gifts - OwnerId MessageSender `json:"owner_id"` -} - -// Returns collections of gifts owned by the given user or chat -func (client *Client) GetGiftCollections(req *GetGiftCollectionsRequest) (*GiftCollections, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getGiftCollections", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollections(result.Data) -} - -type CreateGiftCollectionRequest struct { - // Identifier of the user or the channel chat that received the gifts - 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_size_max") identifiers - ReceivedGiftIds []string `json:"received_gift_ids"` -} - -// Creates a collection from gifts on the current user's or a channel's profile page; requires can_post_messages administrator right in the channel chat. 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 -func (client *Client) CreateGiftCollection(req *CreateGiftCollectionRequest) (*GiftCollection, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "createGiftCollection", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "name": req.Name, - "received_gift_ids": req.ReceivedGiftIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollection(result.Data) -} - -type ReorderGiftCollectionsRequest struct { - // Identifier of the user or the channel chat that owns the collection - OwnerId MessageSender `json:"owner_id"` - // New order of gift collections - CollectionIds []int32 `json:"collection_ids"` -} - -// 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 -func (client *Client) ReorderGiftCollections(req *ReorderGiftCollectionsRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "reorderGiftCollections", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_ids": req.CollectionIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type DeleteGiftCollectionRequest struct { - // Identifier of the user or the channel chat that owns the collection - OwnerId MessageSender `json:"owner_id"` - // Identifier of the gift collection - CollectionId int32 `json:"collection_id"` -} - -// Deletes a gift collection. If the collection is owned by a channel chat, then requires can_post_messages administrator right in the channel chat -func (client *Client) DeleteGiftCollection(req *DeleteGiftCollectionRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "deleteGiftCollection", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_id": req.CollectionId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - -type SetGiftCollectionNameRequest struct { - // Identifier of the user or the channel chat that owns the collection - OwnerId MessageSender `json:"owner_id"` - // Identifier of the gift collection - CollectionId int32 `json:"collection_id"` - // New name of the collection; 1-12 characters - Name string `json:"name"` -} - -// Changes name of a gift 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 -func (client *Client) SetGiftCollectionName(req *SetGiftCollectionNameRequest) (*GiftCollection, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "setGiftCollectionName", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_id": req.CollectionId, - "name": req.Name, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollection(result.Data) -} - -type AddGiftCollectionGiftsRequest struct { - // Identifier of the user or the channel chat that owns the collection - 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_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"` -} - -// 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 -func (client *Client) AddGiftCollectionGifts(req *AddGiftCollectionGiftsRequest) (*GiftCollection, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "addGiftCollectionGifts", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_id": req.CollectionId, - "received_gift_ids": req.ReceivedGiftIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollection(result.Data) -} - -type RemoveGiftCollectionGiftsRequest struct { - // Identifier of the user or the channel chat that owns the collection - OwnerId MessageSender `json:"owner_id"` - // Identifier of the gift collection - CollectionId int32 `json:"collection_id"` - // Identifier of the gifts to remove from the collection - ReceivedGiftIds []string `json:"received_gift_ids"` -} - -// 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 -func (client *Client) RemoveGiftCollectionGifts(req *RemoveGiftCollectionGiftsRequest) (*GiftCollection, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "removeGiftCollectionGifts", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_id": req.CollectionId, - "received_gift_ids": req.ReceivedGiftIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollection(result.Data) -} - -type ReorderGiftCollectionGiftsRequest struct { - // Identifier of the user or the channel chat that owns the collection - OwnerId MessageSender `json:"owner_id"` - // Identifier of the gift collection - CollectionId int32 `json:"collection_id"` - // Identifier of the gifts to move to the beginning of the collection. All other gifts are placed in the current order after the specified gifts - ReceivedGiftIds []string `json:"received_gift_ids"` -} - -// Changes order of gifts in 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 -func (client *Client) ReorderGiftCollectionGifts(req *ReorderGiftCollectionGiftsRequest) (*GiftCollection, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "reorderGiftCollectionGifts", - }, - Data: map[string]interface{}{ - "owner_id": req.OwnerId, - "collection_id": req.CollectionId, - "received_gift_ids": req.ReceivedGiftIds, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalGiftCollection(result.Data) -} - type CreateInvoiceLinkRequest struct { // Unique identifier of business connection on behalf of which to send the request BusinessConnectionId string `json:"business_connection_id"` @@ -23263,7 +19878,7 @@ func (client *Client) CreateInvoiceLink(req *CreateInvoiceLinkRequest) (*HttpUrl } type RefundStarPaymentRequest struct { - // Identifier of the user who did the payment + // Identifier of the user that did the payment UserId int64 `json:"user_id"` // Telegram payment identifier TelegramPaymentChargeId string `json:"telegram_payment_charge_id"` @@ -23291,7 +19906,7 @@ func (client *Client) RefundStarPayment(req *RefundStarPaymentRequest) (*Ok, err return UnmarshalOk(result.Data) } -// Returns a user who can be contacted to get support +// Returns a user that can be contacted to get support func (client *Client) GetSupportUser() (*User, error) { result, err := client.Send(Request{ meta: meta{ @@ -24056,7 +20671,7 @@ type SetChatPaidMessageStarCountRequest struct { PaidMessageStarCount int64 `json:"paid_message_star_count"` } -// Changes the Telegram Star amount that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages +// Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages func (client *Client) SetChatPaidMessageStarCount(req *SetChatPaidMessageStarCountRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -24085,7 +20700,7 @@ type CanSendMessageToUserRequest struct { OnlyLocal bool `json:"only_local"` } -// Checks whether the current user can message another user or try to create a chat with them +// Check 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{ @@ -24520,9 +21135,9 @@ func (client *Client) GetChatRevenueWithdrawalUrl(req *GetChatRevenueWithdrawalU type GetChatRevenueTransactionsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of transactions to be returned; up to 100 + // Number of transactions to skip + Offset int32 `json:"offset"` + // The maximum number of transactions to be returned; up to 200 Limit int32 `json:"limit"` } @@ -24549,38 +21164,6 @@ func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactions return UnmarshalChatRevenueTransactions(result.Data) } -type GetTonTransactionsRequest struct { - // Direction of the transactions to receive; pass null to get all transactions - Direction TransactionDirection `json:"direction"` - // Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of transactions to return - Limit int32 `json:"limit"` -} - -// Returns the list of Toncoin transactions of the current user -func (client *Client) GetTonTransactions(req *GetTonTransactionsRequest) (*TonTransactions, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getTonTransactions", - }, - Data: map[string]interface{}{ - "direction": req.Direction, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalTonTransactions(result.Data) -} - type GetStarRevenueStatisticsRequest struct { // Identifier of the owner of the Telegram Stars; can be identifier of the current user, an owned bot, or a supergroup or a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true OwnerId MessageSender `json:"owner_id"` @@ -24613,7 +21196,7 @@ func (client *Client) GetStarRevenueStatistics(req *GetStarRevenueStatisticsRequ type GetStarWithdrawalUrlRequest struct { // Identifier of the owner of the Telegram Stars; can be identifier of the current user, an owned bot, or an owned supergroup or channel chat OwnerId MessageSender `json:"owner_id"` - // The number of Telegram Stars to withdraw; must be between getOption("star_withdrawal_count_min") and getOption("star_withdrawal_count_max") + // The number of Telegram Stars to withdraw. Must be at least getOption("star_withdrawal_count_min") StarCount int64 `json:"star_count"` // The 2-step verification password of the current user Password string `json:"password"` @@ -24668,58 +21251,6 @@ func (client *Client) GetStarAdAccountUrl(req *GetStarAdAccountUrlRequest) (*Htt return UnmarshalHttpUrl(result.Data) } -type GetTonRevenueStatisticsRequest struct { - // Pass true if a dark theme is used by the application - IsDark bool `json:"is_dark"` -} - -// Returns detailed Toncoin revenue statistics of the current user -func (client *Client) GetTonRevenueStatistics(req *GetTonRevenueStatisticsRequest) (*TonRevenueStatistics, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getTonRevenueStatistics", - }, - Data: map[string]interface{}{ - "is_dark": req.IsDark, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalTonRevenueStatistics(result.Data) -} - -type GetTonWithdrawalUrlRequest struct { - // The 2-step verification password of the current user - Password string `json:"password"` -} - -// Returns a URL for Toncoin withdrawal from the current user's account. The user must have at least 10 toncoins to withdraw and can withdraw up to 100000 Toncoins in one transaction -func (client *Client) GetTonWithdrawalUrl(req *GetTonWithdrawalUrlRequest) (*HttpUrl, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getTonWithdrawalUrl", - }, - Data: map[string]interface{}{ - "password": req.Password, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalHttpUrl(result.Data) -} - type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -25454,7 +21985,7 @@ type SetPassportElementErrorsRequest struct { Errors []*InputPassportElementError `json:"errors"` } -// Informs the user who some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed +// Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed func (client *Client) SetPassportElementErrors(req *SetPassportElementErrorsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -26444,7 +22975,7 @@ type CheckPremiumGiftCodeRequest struct { Code string `json:"code"` } -// Returns information about a Telegram Premium gift code +// Return information about a Telegram Premium gift code func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -26619,7 +23150,7 @@ func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { } type GetStarGiftPaymentOptionsRequest struct { - // Identifier of the user who will receive Telegram Stars; pass 0 to get options for an unspecified user + // Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user UserId int64 `json:"user_id"` } @@ -26669,7 +23200,7 @@ type GetStarTransactionsRequest struct { // If non-empty, only transactions related to the Star Subscription will be returned SubscriptionId string `json:"subscription_id"` // Direction of the transactions to receive; pass null to get all transactions - Direction TransactionDirection `json:"direction"` + Direction StarTransactionDirection `json:"direction"` // Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` // The maximum number of transactions to return @@ -27030,7 +23561,7 @@ type GetConnectedAffiliateProgramRequest struct { BotUserId int64 `json:"bot_user_id"` } -// Returns an affiliate program that was connected to the given affiliate by identifier of the bot that created the program +// Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program func (client *Client) GetConnectedAffiliateProgram(req *GetConnectedAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) { result, err := client.Send(Request{ meta: meta{ @@ -27502,21 +24033,27 @@ func (client *Client) GetApplicationDownloadLink() (*HttpUrl, error) { } type AddProxyRequest struct { - // The proxy to add - Proxy *Proxy `json:"proxy"` + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` + // Proxy type + Type ProxyType `json:"type"` } // Adds a proxy server for network requests. Can be called before authorization -func (client *Client) AddProxy(req *AddProxyRequest) (*AddedProxy, error) { +func (client *Client) AddProxy(req *AddProxyRequest) (*Proxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "addProxy", }, Data: map[string]interface{}{ - "proxy": req.Proxy, + "server": req.Server, + "port": req.Port, "enable": req.Enable, + "type": req.Type, }, }) if err != nil { @@ -27527,28 +24064,34 @@ func (client *Client) AddProxy(req *AddProxyRequest) (*AddedProxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalAddedProxy(result.Data) + return UnmarshalProxy(result.Data) } type EditProxyRequest struct { // Proxy identifier ProxyId int32 `json:"proxy_id"` - // The new information about the proxy - Proxy *Proxy `json:"proxy"` + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` // Pass true to immediately enable the proxy Enable bool `json:"enable"` + // Proxy type + Type ProxyType `json:"type"` } // Edits an existing proxy server for network requests. Can be called before authorization -func (client *Client) EditProxy(req *EditProxyRequest) (*AddedProxy, error) { +func (client *Client) EditProxy(req *EditProxyRequest) (*Proxy, error) { result, err := client.Send(Request{ meta: meta{ Type: "editProxy", }, Data: map[string]interface{}{ "proxy_id": req.ProxyId, - "proxy": req.Proxy, + "server": req.Server, + "port": req.Port, "enable": req.Enable, + "type": req.Type, }, }) if err != nil { @@ -27559,7 +24102,7 @@ func (client *Client) EditProxy(req *EditProxyRequest) (*AddedProxy, error) { return nil, buildResponseError(result.Data) } - return UnmarshalAddedProxy(result.Data) + return UnmarshalProxy(result.Data) } type EnableProxyRequest struct { @@ -27634,7 +24177,7 @@ func (client *Client) RemoveProxy(req *RemoveProxyRequest) (*Ok, error) { } // Returns the list of proxies that are currently set up. Can be called before authorization -func (client *Client) GetProxies() (*AddedProxies, error) { +func (client *Client) GetProxies() (*Proxies, error) { result, err := client.Send(Request{ meta: meta{ Type: "getProxies", @@ -27649,12 +24192,38 @@ func (client *Client) GetProxies() (*AddedProxies, error) { return nil, buildResponseError(result.Data) } - return UnmarshalAddedProxies(result.Data) + return UnmarshalProxies(result.Data) +} + +type GetProxyLinkRequest struct { + // Proxy identifier + ProxyId int32 `json:"proxy_id"` +} + +// Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization +func (client *Client) GetProxyLink(req *GetProxyLinkRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getProxyLink", + }, + Data: map[string]interface{}{ + "proxy_id": req.ProxyId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) } type PingProxyRequest struct { - // The proxy to test; pass null to ping a Telegram server without a proxy - Proxy *Proxy `json:"proxy"` + // Proxy identifier. Use 0 to ping a Telegram server without a proxy + ProxyId int32 `json:"proxy_id"` } // Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @@ -27664,7 +24233,7 @@ func (client *Client) PingProxy(req *PingProxyRequest) (*Seconds, error) { Type: "pingProxy", }, Data: map[string]interface{}{ - "proxy": req.Proxy, + "proxy_id": req.ProxyId, }, }) if err != nil { @@ -28218,8 +24787,12 @@ func (client *Client) TestNetwork() (*Ok, error) { } type TestProxyRequest struct { - // The proxy to test - Proxy *Proxy `json:"proxy"` + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Proxy type + Type ProxyType `json:"type"` // Identifier of a datacenter with which to test connection DcId int32 `json:"dc_id"` // The maximum overall timeout for the request @@ -28233,7 +24806,9 @@ func (client *Client) TestProxy(req *TestProxyRequest) (*Ok, error) { Type: "testProxy", }, Data: map[string]interface{}{ - "proxy": req.Proxy, + "server": req.Server, + "port": req.Port, + "type": req.Type, "dc_id": req.DcId, "timeout": req.Timeout, }, @@ -28324,9 +24899,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateMessageFactCheck: return UnmarshalUpdateMessageFactCheck(result.Data) - case TypeUpdateMessageSuggestedPostInfo: - return UnmarshalUpdateMessageSuggestedPostInfo(result.Data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(result.Data) @@ -28444,12 +25016,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateSavedMessagesTopicCount: return UnmarshalUpdateSavedMessagesTopicCount(result.Data) - case TypeUpdateDirectMessagesChatTopic: - return UnmarshalUpdateDirectMessagesChatTopic(result.Data) - - case TypeUpdateTopicMessageCount: - return UnmarshalUpdateTopicMessageCount(result.Data) - case TypeUpdateQuickReplyShortcut: return UnmarshalUpdateQuickReplyShortcut(result.Data) @@ -28492,9 +25058,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(result.Data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(result.Data) - case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(result.Data) @@ -28558,36 +25121,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateGroupCallParticipant: return UnmarshalUpdateGroupCallParticipant(result.Data) - case TypeUpdateGroupCallParticipants: - return UnmarshalUpdateGroupCallParticipants(result.Data) - - case TypeUpdateGroupCallVerificationState: - return UnmarshalUpdateGroupCallVerificationState(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) @@ -28603,11 +25139,11 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(result.Data) - case TypeUpdateStoryPostSucceeded: - return UnmarshalUpdateStoryPostSucceeded(result.Data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(result.Data) - case TypeUpdateStoryPostFailed: - return UnmarshalUpdateStoryPostFailed(result.Data) + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(result.Data) case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(result.Data) @@ -28618,9 +25154,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(result.Data) - case TypeUpdateTrustedMiniAppBots: - return UnmarshalUpdateTrustedMiniAppBots(result.Data) - case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) @@ -28648,8 +25181,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(result.Data) - case TypeUpdateEmojiChatThemes: - return UnmarshalUpdateEmojiChatThemes(result.Data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(result.Data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(result.Data) @@ -28666,9 +25199,6 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(result.Data) - case TypeUpdateAgeVerificationParameters: - return UnmarshalUpdateAgeVerificationParameters(result.Data) - case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(result.Data) @@ -28702,30 +25232,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(result.Data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(result.Data) - case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(result.Data) case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(result.Data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(result.Data) - 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/tdlib.go b/client/tdlib.go index dc943a0..c9c07db 100644 --- a/client/tdlib.go +++ b/client/tdlib.go @@ -4,9 +4,9 @@ package client //#cgo freebsd CFLAGS: -I/usr/local/include //#cgo darwin CFLAGS: -I/usr/local/include //#cgo windows CFLAGS: -IE:/src/tdlib -IE:/src/tdlib/build -//#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltde2e -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm -//#cgo freebsd LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltde2e -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm -//#cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltde2e -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm +//#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm +//#cgo freebsd LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm +//#cgo darwin LDFLAGS: -L/usr/local/lib -L/usr/local/opt/openssl/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdmtproto -ltdnet -ltdutils -lstdc++ -lssl -lcrypto -ldl -lz -lm //#cgo windows LDFLAGS: -LE:/src/tdlib/build/Release -ltdjson //#include //#include diff --git a/client/type.go b/client/type.go index feb0c58..22df51f 100755 --- a/client/type.go +++ b/client/type.go @@ -19,32 +19,16 @@ const ( ClassStickerType = "StickerType" ClassStickerFullType = "StickerFullType" ClassPollType = "PollType" - ClassProfileTab = "ProfileTab" ClassUserType = "UserType" ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule" ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" - ClassGiftResalePrice = "GiftResalePrice" - ClassGiftPurchaseOfferState = "GiftPurchaseOfferState" - ClassSuggestedPostPrice = "SuggestedPostPrice" - ClassSuggestedPostState = "SuggestedPostState" - ClassSuggestedPostRefundReason = "SuggestedPostRefundReason" ClassStarSubscriptionType = "StarSubscriptionType" ClassAffiliateType = "AffiliateType" ClassAffiliateProgramSortOrder = "AffiliateProgramSortOrder" - ClassCanSendGiftResult = "CanSendGiftResult" - ClassUpgradedGiftOrigin = "UpgradedGiftOrigin" - ClassUpgradedGiftAttributeRarity = "UpgradedGiftAttributeRarity" - ClassCraftGiftResult = "CraftGiftResult" - ClassUpgradedGiftAttributeId = "UpgradedGiftAttributeId" - ClassGiftForResaleOrder = "GiftForResaleOrder" - ClassGiftResaleResult = "GiftResaleResult" ClassSentGift = "SentGift" - ClassAuctionState = "AuctionState" - ClassTransactionDirection = "TransactionDirection" + ClassStarTransactionDirection = "StarTransactionDirection" ClassStarTransactionType = "StarTransactionType" - ClassTonTransactionType = "TonTransactionType" - ClassActiveStoryState = "ActiveStoryState" ClassGiveawayParticipantStatus = "GiveawayParticipantStatus" ClassGiveawayInfo = "GiveawayInfo" ClassGiveawayPrize = "GiveawayPrize" @@ -59,7 +43,6 @@ const ( ClassMessageOrigin = "MessageOrigin" ClassReactionType = "ReactionType" ClassPaidReactionType = "PaidReactionType" - ClassMessageTopic = "MessageTopic" ClassMessageEffectType = "MessageEffectType" ClassMessageSendingState = "MessageSendingState" ClassMessageReplyTo = "MessageReplyTo" @@ -74,14 +57,12 @@ const ( ClassChatAvailableReactions = "ChatAvailableReactions" ClassPublicChatType = "PublicChatType" ClassChatActionBar = "ChatActionBar" - ClassButtonStyle = "ButtonStyle" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" ClassReplyMarkup = "ReplyMarkup" ClassLoginUrlInfo = "LoginUrlInfo" ClassWebAppOpenMode = "WebAppOpenMode" ClassSavedMessagesTopicType = "SavedMessagesTopicType" - ClassBuiltInTheme = "BuiltInTheme" ClassRichText = "RichText" ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" @@ -114,7 +95,6 @@ const ( ClassEmojiCategoryType = "EmojiCategoryType" ClassStoryAreaType = "StoryAreaType" ClassInputStoryAreaType = "InputStoryAreaType" - ClassStoryContentType = "StoryContentType" ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" @@ -127,9 +107,6 @@ const ( ClassCallServerType = "CallServerType" ClassCallState = "CallState" ClassGroupCallVideoQuality = "GroupCallVideoQuality" - ClassInviteGroupCallParticipantResult = "InviteGroupCallParticipantResult" - ClassGroupCallDataChannel = "GroupCallDataChannel" - ClassInputGroupCall = "InputGroupCall" ClassCallProblem = "CallProblem" ClassFirebaseAuthenticationSettings = "FirebaseAuthenticationSettings" ClassReactionUnavailabilityReason = "ReactionUnavailabilityReason" @@ -155,10 +132,7 @@ const ( ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" ClassInputBackground = "InputBackground" - ClassChatTheme = "ChatTheme" - ClassInputChatTheme = "InputChatTheme" - ClassCanPostStoryResult = "CanPostStoryResult" - ClassStartLiveStoryResult = "StartLiveStoryResult" + ClassCanSendStoryResult = "CanSendStoryResult" ClassCanTransferOwnershipResult = "CanTransferOwnershipResult" ClassCheckChatUsernameResult = "CheckChatUsernameResult" ClassCheckStickerSetNameResult = "CheckStickerSetNameResult" @@ -177,7 +151,6 @@ const ( ClassReportReason = "ReportReason" ClassReportChatResult = "ReportChatResult" ClassReportStoryResult = "ReportStoryResult" - ClassSettingsSection = "SettingsSection" ClassInternalLinkType = "InternalLinkType" ClassBlockList = "BlockList" ClassFileType = "FileType" @@ -208,8 +181,6 @@ const ( ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" ClassTermsOfService = "TermsOfService" - ClassPasskey = "Passkey" - ClassPasskeys = "Passkeys" ClassPasswordState = "PasswordState" ClassRecoveryEmailAddress = "RecoveryEmailAddress" ClassTemporaryPasswordState = "TemporaryPasswordState" @@ -223,13 +194,8 @@ const ( ClassClosedVectorPath = "ClosedVectorPath" ClassOutline = "Outline" ClassPollOption = "PollOption" - ClassChecklistTask = "ChecklistTask" - ClassInputChecklistTask = "InputChecklistTask" - ClassChecklist = "Checklist" - ClassInputChecklist = "InputChecklist" ClassAnimation = "Animation" ClassAudio = "Audio" - ClassAudios = "Audios" ClassDocument = "Document" ClassPhoto = "Photo" ClassSticker = "Sticker" @@ -241,11 +207,9 @@ const ( ClassLocation = "Location" ClassVenue = "Venue" ClassGame = "Game" - ClassStakeDiceState = "StakeDiceState" ClassWebApp = "WebApp" ClassPoll = "Poll" ClassAlternativeVideo = "AlternativeVideo" - ClassVideoStoryboard = "VideoStoryboard" ClassBackground = "Background" ClassBackgrounds = "Backgrounds" ClassChatBackground = "ChatBackground" @@ -281,8 +245,6 @@ const ( ClassChatPhotos = "ChatPhotos" ClassChatPermissions = "ChatPermissions" ClassChatAdministratorRights = "ChatAdministratorRights" - ClassSuggestedPostInfo = "SuggestedPostInfo" - ClassInputSuggestedPostInfo = "InputSuggestedPostInfo" ClassStarAmount = "StarAmount" ClassStarSubscriptionPricing = "StarSubscriptionPricing" ClassStarSubscription = "StarSubscription" @@ -309,51 +271,23 @@ const ( ClassStarGiveawayPaymentOptions = "StarGiveawayPaymentOptions" ClassAcceptedGiftTypes = "AcceptedGiftTypes" ClassGiftSettings = "GiftSettings" - ClassGiftAuction = "GiftAuction" - ClassGiftBackground = "GiftBackground" - ClassGiftPurchaseLimits = "GiftPurchaseLimits" - ClassGiftResaleParameters = "GiftResaleParameters" - ClassGiftCollection = "GiftCollection" - ClassGiftCollections = "GiftCollections" ClassUpgradedGiftModel = "UpgradedGiftModel" ClassUpgradedGiftSymbol = "UpgradedGiftSymbol" ClassUpgradedGiftBackdropColors = "UpgradedGiftBackdropColors" ClassUpgradedGiftBackdrop = "UpgradedGiftBackdrop" ClassUpgradedGiftOriginalDetails = "UpgradedGiftOriginalDetails" - ClassUpgradedGiftColors = "UpgradedGiftColors" ClassGift = "Gift" + ClassGifts = "Gifts" ClassUpgradedGift = "UpgradedGift" - ClassUpgradedGiftValueInfo = "UpgradedGiftValueInfo" ClassUpgradeGiftResult = "UpgradeGiftResult" - ClassAvailableGift = "AvailableGift" - ClassAvailableGifts = "AvailableGifts" - ClassGiftUpgradePrice = "GiftUpgradePrice" - ClassUpgradedGiftModelCount = "UpgradedGiftModelCount" - ClassUpgradedGiftSymbolCount = "UpgradedGiftSymbolCount" - ClassUpgradedGiftBackdropCount = "UpgradedGiftBackdropCount" - ClassGiftForResale = "GiftForResale" - ClassGiftsForResale = "GiftsForResale" ClassReceivedGift = "ReceivedGift" ClassReceivedGifts = "ReceivedGifts" - ClassAttributeCraftPersistenceProbability = "AttributeCraftPersistenceProbability" - ClassGiftsForCrafting = "GiftsForCrafting" ClassGiftUpgradePreview = "GiftUpgradePreview" - ClassGiftUpgradeVariants = "GiftUpgradeVariants" - ClassAuctionBid = "AuctionBid" - ClassUserAuctionBid = "UserAuctionBid" - ClassAuctionRound = "AuctionRound" - ClassGiftAuctionState = "GiftAuctionState" - ClassGiftAuctionAcquiredGift = "GiftAuctionAcquiredGift" - ClassGiftAuctionAcquiredGifts = "GiftAuctionAcquiredGifts" ClassStarTransaction = "StarTransaction" ClassStarTransactions = "StarTransactions" - ClassTonTransaction = "TonTransaction" - ClassTonTransactions = "TonTransactions" ClassAccentColor = "AccentColor" ClassProfileAccentColors = "ProfileAccentColors" ClassProfileAccentColor = "ProfileAccentColor" - ClassUserRating = "UserRating" - ClassRestrictionInfo = "RestrictionInfo" ClassEmojiStatus = "EmojiStatus" ClassEmojiStatuses = "EmojiStatuses" ClassEmojiStatusCustomEmojis = "EmojiStatusCustomEmojis" @@ -383,7 +317,6 @@ const ( ClassSupergroup = "Supergroup" ClassSupergroupFullInfo = "SupergroupFullInfo" ClassSecretChat = "SecretChat" - ClassPublicPostSearchLimits = "PublicPostSearchLimits" ClassMessageSenders = "MessageSenders" ClassChatMessageSender = "ChatMessageSender" ClassChatMessageSenders = "ChatMessageSenders" @@ -391,7 +324,6 @@ const ( ClassMessageViewers = "MessageViewers" ClassForwardSource = "ForwardSource" ClassPaidReactor = "PaidReactor" - ClassLiveStoryDonors = "LiveStoryDonors" ClassMessageForwardInfo = "MessageForwardInfo" ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" @@ -407,20 +339,17 @@ const ( ClassMessages = "Messages" ClassFoundMessages = "FoundMessages" ClassFoundChatMessages = "FoundChatMessages" - ClassFoundPublicPosts = "FoundPublicPosts" ClassMessagePosition = "MessagePosition" ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" ClassBusinessMessage = "BusinessMessage" ClassBusinessMessages = "BusinessMessages" - ClassAdvertisementSponsor = "AdvertisementSponsor" + ClassMessageSponsor = "MessageSponsor" ClassSponsoredMessage = "SponsoredMessage" ClassSponsoredMessages = "SponsoredMessages" ClassSponsoredChat = "SponsoredChat" ClassSponsoredChats = "SponsoredChats" - ClassVideoMessageAdvertisement = "VideoMessageAdvertisement" - ClassVideoMessageAdvertisements = "VideoMessageAdvertisements" ClassReportOption = "ReportOption" ClassFileDownload = "FileDownload" ClassDownloadedFileCounts = "DownloadedFileCounts" @@ -460,7 +389,6 @@ const ( ClassWebAppOpenParameters = "WebAppOpenParameters" ClassMessageThreadInfo = "MessageThreadInfo" ClassSavedMessagesTopic = "SavedMessagesTopic" - ClassDirectMessagesChatTopic = "DirectMessagesChatTopic" ClassForumTopicIcon = "ForumTopicIcon" ClassForumTopicInfo = "ForumTopicInfo" ClassForumTopic = "ForumTopic" @@ -536,8 +464,6 @@ const ( ClassStory = "Story" ClassStories = "Stories" ClassFoundStories = "FoundStories" - ClassStoryAlbum = "StoryAlbum" - ClassStoryAlbums = "StoryAlbums" ClassStoryFullId = "StoryFullId" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" @@ -562,7 +488,6 @@ const ( ClassCallServer = "CallServer" ClassCallId = "CallId" ClassGroupCallId = "GroupCallId" - ClassGroupCallJoinParameters = "GroupCallJoinParameters" ClassGroupCallStream = "GroupCallStream" ClassGroupCallStreams = "GroupCallStreams" ClassRtmpUrl = "RtmpUrl" @@ -571,10 +496,6 @@ const ( ClassGroupCallVideoSourceGroup = "GroupCallVideoSourceGroup" ClassGroupCallParticipantVideoInfo = "GroupCallParticipantVideoInfo" ClassGroupCallParticipant = "GroupCallParticipant" - ClassGroupCallParticipants = "GroupCallParticipants" - ClassGroupCallInfo = "GroupCallInfo" - ClassGroupCallMessage = "GroupCallMessage" - ClassGroupCallMessageLevel = "GroupCallMessageLevel" ClassCall = "Call" ClassPhoneNumberAuthenticationSettings = "PhoneNumberAuthenticationSettings" ClassAddedReaction = "AddedReaction" @@ -583,7 +504,6 @@ const ( ClassAvailableReactions = "AvailableReactions" ClassEmojiReaction = "EmojiReaction" ClassAnimations = "Animations" - ClassImportedContact = "ImportedContact" ClassImportedContacts = "ImportedContacts" ClassBusinessConnection = "BusinessConnection" ClassAttachmentMenuBotColor = "AttachmentMenuBotColor" @@ -614,9 +534,7 @@ const ( ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation" ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" - ClassEmojiChatTheme = "EmojiChatTheme" - ClassGiftChatTheme = "GiftChatTheme" - ClassGiftChatThemes = "GiftChatThemes" + ClassChatTheme = "ChatTheme" ClassTimeZone = "TimeZone" ClassTimeZones = "TimeZones" ClassHashtags = "Hashtags" @@ -624,7 +542,6 @@ const ( ClassNotificationSounds = "NotificationSounds" ClassNotification = "Notification" ClassNotificationGroup = "NotificationGroup" - ClassProxy = "Proxy" ClassJsonObjectMember = "JsonObjectMember" ClassUserPrivacySettingRules = "UserPrivacySettingRules" ClassReadDatePrivacySettings = "ReadDatePrivacySettings" @@ -640,6 +557,7 @@ const ( ClassMessageLinkInfo = "MessageLinkInfo" ClassChatBoostLink = "ChatBoostLink" ClassChatBoostLinkInfo = "ChatBoostLinkInfo" + ClassFilePart = "FilePart" ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" ClassStorageStatisticsByChat = "StorageStatisticsByChat" ClassStorageStatistics = "StorageStatistics" @@ -651,20 +569,18 @@ const ( ClassScopeAutosaveSettings = "ScopeAutosaveSettings" ClassAutosaveSettingsException = "AutosaveSettingsException" ClassAutosaveSettings = "AutosaveSettings" - ClassAgeVerificationParameters = "AgeVerificationParameters" ClassFoundPosition = "FoundPosition" ClassFoundPositions = "FoundPositions" ClassTMeUrl = "TMeUrl" ClassTMeUrls = "TMeUrls" ClassCount = "Count" ClassText = "Text" - ClassData = "Data" ClassSeconds = "Seconds" ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize" ClassStarCount = "StarCount" ClassDeepLinkInfo = "DeepLinkInfo" - ClassAddedProxy = "AddedProxy" - ClassAddedProxies = "AddedProxies" + ClassProxy = "Proxy" + ClassProxies = "Proxies" ClassInputSticker = "InputSticker" ClassDateRange = "DateRange" ClassStatisticalValue = "StatisticalValue" @@ -680,8 +596,6 @@ const ( ClassChatRevenueTransactions = "ChatRevenueTransactions" ClassStarRevenueStatus = "StarRevenueStatus" ClassStarRevenueStatistics = "StarRevenueStatistics" - ClassTonRevenueStatus = "TonRevenueStatus" - ClassTonRevenueStatistics = "TonRevenueStatistics" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -720,8 +634,6 @@ const ( TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" TypeTermsOfService = "termsOfService" - TypePasskey = "passkey" - TypePasskeys = "passkeys" TypeAuthorizationStateWaitTdlibParameters = "authorizationStateWaitTdlibParameters" TypeAuthorizationStateWaitPhoneNumber = "authorizationStateWaitPhoneNumber" TypeAuthorizationStateWaitPremiumPurchase = "authorizationStateWaitPremiumPurchase" @@ -776,13 +688,8 @@ const ( TypePollOption = "pollOption" TypePollTypeRegular = "pollTypeRegular" TypePollTypeQuiz = "pollTypeQuiz" - TypeChecklistTask = "checklistTask" - TypeInputChecklistTask = "inputChecklistTask" - TypeChecklist = "checklist" - TypeInputChecklist = "inputChecklist" TypeAnimation = "animation" TypeAudio = "audio" - TypeAudios = "audios" TypeDocument = "document" TypePhoto = "photo" TypeSticker = "sticker" @@ -794,24 +701,14 @@ const ( TypeLocation = "location" TypeVenue = "venue" TypeGame = "game" - TypeStakeDiceState = "stakeDiceState" TypeWebApp = "webApp" TypePoll = "poll" TypeAlternativeVideo = "alternativeVideo" - TypeVideoStoryboard = "videoStoryboard" TypeBackground = "background" TypeBackgrounds = "backgrounds" TypeChatBackground = "chatBackground" TypeProfilePhoto = "profilePhoto" TypeChatPhotoInfo = "chatPhotoInfo" - TypeProfileTabPosts = "profileTabPosts" - TypeProfileTabGifts = "profileTabGifts" - TypeProfileTabMedia = "profileTabMedia" - TypeProfileTabFiles = "profileTabFiles" - TypeProfileTabLinks = "profileTabLinks" - TypeProfileTabMusic = "profileTabMusic" - TypeProfileTabVoice = "profileTabVoice" - TypeProfileTabGifs = "profileTabGifs" TypeUserTypeRegular = "userTypeRegular" TypeUserTypeDeleted = "userTypeDeleted" TypeUserTypeBot = "userTypeBot" @@ -855,20 +752,6 @@ const ( TypeInputChatPhotoSticker = "inputChatPhotoSticker" TypeChatPermissions = "chatPermissions" TypeChatAdministratorRights = "chatAdministratorRights" - TypeGiftResalePriceStar = "giftResalePriceStar" - TypeGiftResalePriceTon = "giftResalePriceTon" - TypeGiftPurchaseOfferStatePending = "giftPurchaseOfferStatePending" - TypeGiftPurchaseOfferStateAccepted = "giftPurchaseOfferStateAccepted" - TypeGiftPurchaseOfferStateRejected = "giftPurchaseOfferStateRejected" - TypeSuggestedPostPriceStar = "suggestedPostPriceStar" - TypeSuggestedPostPriceTon = "suggestedPostPriceTon" - TypeSuggestedPostStatePending = "suggestedPostStatePending" - TypeSuggestedPostStateApproved = "suggestedPostStateApproved" - TypeSuggestedPostStateDeclined = "suggestedPostStateDeclined" - TypeSuggestedPostInfo = "suggestedPostInfo" - TypeInputSuggestedPostInfo = "inputSuggestedPostInfo" - TypeSuggestedPostRefundReasonPostDeleted = "suggestedPostRefundReasonPostDeleted" - TypeSuggestedPostRefundReasonPaymentRefunded = "suggestedPostRefundReasonPaymentRefunded" TypeStarAmount = "starAmount" TypeStarSubscriptionTypeChannel = "starSubscriptionTypeChannel" TypeStarSubscriptionTypeBot = "starSubscriptionTypeBot" @@ -903,74 +786,22 @@ const ( TypeStarGiveawayPaymentOptions = "starGiveawayPaymentOptions" TypeAcceptedGiftTypes = "acceptedGiftTypes" TypeGiftSettings = "giftSettings" - TypeGiftAuction = "giftAuction" - TypeGiftBackground = "giftBackground" - TypeGiftPurchaseLimits = "giftPurchaseLimits" - TypeGiftResaleParameters = "giftResaleParameters" - TypeGiftCollection = "giftCollection" - TypeGiftCollections = "giftCollections" - TypeCanSendGiftResultOk = "canSendGiftResultOk" - TypeCanSendGiftResultFail = "canSendGiftResultFail" - TypeUpgradedGiftOriginUpgrade = "upgradedGiftOriginUpgrade" - TypeUpgradedGiftOriginTransfer = "upgradedGiftOriginTransfer" - TypeUpgradedGiftOriginResale = "upgradedGiftOriginResale" - TypeUpgradedGiftOriginBlockchain = "upgradedGiftOriginBlockchain" - TypeUpgradedGiftOriginPrepaidUpgrade = "upgradedGiftOriginPrepaidUpgrade" - TypeUpgradedGiftOriginOffer = "upgradedGiftOriginOffer" - TypeUpgradedGiftOriginCraft = "upgradedGiftOriginCraft" - TypeUpgradedGiftAttributeRarityPerMille = "upgradedGiftAttributeRarityPerMille" - TypeUpgradedGiftAttributeRarityUncommon = "upgradedGiftAttributeRarityUncommon" - TypeUpgradedGiftAttributeRarityRare = "upgradedGiftAttributeRarityRare" - TypeUpgradedGiftAttributeRarityEpic = "upgradedGiftAttributeRarityEpic" - TypeUpgradedGiftAttributeRarityLegendary = "upgradedGiftAttributeRarityLegendary" TypeUpgradedGiftModel = "upgradedGiftModel" TypeUpgradedGiftSymbol = "upgradedGiftSymbol" TypeUpgradedGiftBackdropColors = "upgradedGiftBackdropColors" TypeUpgradedGiftBackdrop = "upgradedGiftBackdrop" TypeUpgradedGiftOriginalDetails = "upgradedGiftOriginalDetails" - TypeUpgradedGiftColors = "upgradedGiftColors" TypeGift = "gift" + TypeGifts = "gifts" TypeUpgradedGift = "upgradedGift" - TypeUpgradedGiftValueInfo = "upgradedGiftValueInfo" TypeUpgradeGiftResult = "upgradeGiftResult" - TypeCraftGiftResultSuccess = "craftGiftResultSuccess" - TypeCraftGiftResultTooEarly = "craftGiftResultTooEarly" - TypeCraftGiftResultInvalidGift = "craftGiftResultInvalidGift" - TypeCraftGiftResultFail = "craftGiftResultFail" - TypeAvailableGift = "availableGift" - TypeAvailableGifts = "availableGifts" - TypeGiftUpgradePrice = "giftUpgradePrice" - TypeUpgradedGiftAttributeIdModel = "upgradedGiftAttributeIdModel" - TypeUpgradedGiftAttributeIdSymbol = "upgradedGiftAttributeIdSymbol" - TypeUpgradedGiftAttributeIdBackdrop = "upgradedGiftAttributeIdBackdrop" - TypeUpgradedGiftModelCount = "upgradedGiftModelCount" - TypeUpgradedGiftSymbolCount = "upgradedGiftSymbolCount" - TypeUpgradedGiftBackdropCount = "upgradedGiftBackdropCount" - TypeGiftForResaleOrderPrice = "giftForResaleOrderPrice" - TypeGiftForResaleOrderPriceChangeDate = "giftForResaleOrderPriceChangeDate" - TypeGiftForResaleOrderNumber = "giftForResaleOrderNumber" - TypeGiftForResale = "giftForResale" - TypeGiftsForResale = "giftsForResale" - TypeGiftResaleResultOk = "giftResaleResultOk" - TypeGiftResaleResultPriceIncreased = "giftResaleResultPriceIncreased" TypeSentGiftRegular = "sentGiftRegular" TypeSentGiftUpgraded = "sentGiftUpgraded" TypeReceivedGift = "receivedGift" TypeReceivedGifts = "receivedGifts" - TypeAttributeCraftPersistenceProbability = "attributeCraftPersistenceProbability" - TypeGiftsForCrafting = "giftsForCrafting" TypeGiftUpgradePreview = "giftUpgradePreview" - TypeGiftUpgradeVariants = "giftUpgradeVariants" - TypeAuctionBid = "auctionBid" - TypeUserAuctionBid = "userAuctionBid" - TypeAuctionRound = "auctionRound" - TypeAuctionStateActive = "auctionStateActive" - TypeAuctionStateFinished = "auctionStateFinished" - TypeGiftAuctionState = "giftAuctionState" - TypeGiftAuctionAcquiredGift = "giftAuctionAcquiredGift" - TypeGiftAuctionAcquiredGifts = "giftAuctionAcquiredGifts" - TypeTransactionDirectionIncoming = "transactionDirectionIncoming" - TypeTransactionDirectionOutgoing = "transactionDirectionOutgoing" + TypeStarTransactionDirectionIncoming = "starTransactionDirectionIncoming" + TypeStarTransactionDirectionOutgoing = "starTransactionDirectionOutgoing" TypeStarTransactionTypePremiumBotDeposit = "starTransactionTypePremiumBotDeposit" TypeStarTransactionTypeAppStoreDeposit = "starTransactionTypeAppStoreDeposit" TypeStarTransactionTypeGooglePlayDeposit = "starTransactionTypeGooglePlayDeposit" @@ -990,48 +821,21 @@ const ( TypeStarTransactionTypeBotSubscriptionSale = "starTransactionTypeBotSubscriptionSale" TypeStarTransactionTypeChannelSubscriptionPurchase = "starTransactionTypeChannelSubscriptionPurchase" TypeStarTransactionTypeChannelSubscriptionSale = "starTransactionTypeChannelSubscriptionSale" - TypeStarTransactionTypeGiftAuctionBid = "starTransactionTypeGiftAuctionBid" TypeStarTransactionTypeGiftPurchase = "starTransactionTypeGiftPurchase" - TypeStarTransactionTypeGiftPurchaseOffer = "starTransactionTypeGiftPurchaseOffer" TypeStarTransactionTypeGiftTransfer = "starTransactionTypeGiftTransfer" - TypeStarTransactionTypeGiftOriginalDetailsDrop = "starTransactionTypeGiftOriginalDetailsDrop" TypeStarTransactionTypeGiftSale = "starTransactionTypeGiftSale" TypeStarTransactionTypeGiftUpgrade = "starTransactionTypeGiftUpgrade" - TypeStarTransactionTypeGiftUpgradePurchase = "starTransactionTypeGiftUpgradePurchase" - TypeStarTransactionTypeUpgradedGiftPurchase = "starTransactionTypeUpgradedGiftPurchase" - TypeStarTransactionTypeUpgradedGiftSale = "starTransactionTypeUpgradedGiftSale" TypeStarTransactionTypeChannelPaidReactionSend = "starTransactionTypeChannelPaidReactionSend" TypeStarTransactionTypeChannelPaidReactionReceive = "starTransactionTypeChannelPaidReactionReceive" TypeStarTransactionTypeAffiliateProgramCommission = "starTransactionTypeAffiliateProgramCommission" TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend" TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive" - TypeStarTransactionTypePaidGroupCallMessageSend = "starTransactionTypePaidGroupCallMessageSend" - TypeStarTransactionTypePaidGroupCallMessageReceive = "starTransactionTypePaidGroupCallMessageReceive" - TypeStarTransactionTypePaidGroupCallReactionSend = "starTransactionTypePaidGroupCallReactionSend" - TypeStarTransactionTypePaidGroupCallReactionReceive = "starTransactionTypePaidGroupCallReactionReceive" - TypeStarTransactionTypeSuggestedPostPaymentSend = "starTransactionTypeSuggestedPostPaymentSend" - TypeStarTransactionTypeSuggestedPostPaymentReceive = "starTransactionTypeSuggestedPostPaymentReceive" TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase" TypeStarTransactionTypeBusinessBotTransferSend = "starTransactionTypeBusinessBotTransferSend" TypeStarTransactionTypeBusinessBotTransferReceive = "starTransactionTypeBusinessBotTransferReceive" - TypeStarTransactionTypePublicPostSearch = "starTransactionTypePublicPostSearch" TypeStarTransactionTypeUnsupported = "starTransactionTypeUnsupported" TypeStarTransaction = "starTransaction" TypeStarTransactions = "starTransactions" - TypeTonTransactionTypeFragmentDeposit = "tonTransactionTypeFragmentDeposit" - TypeTonTransactionTypeFragmentWithdrawal = "tonTransactionTypeFragmentWithdrawal" - TypeTonTransactionTypeSuggestedPostPayment = "tonTransactionTypeSuggestedPostPayment" - TypeTonTransactionTypeGiftPurchaseOffer = "tonTransactionTypeGiftPurchaseOffer" - TypeTonTransactionTypeUpgradedGiftPurchase = "tonTransactionTypeUpgradedGiftPurchase" - TypeTonTransactionTypeUpgradedGiftSale = "tonTransactionTypeUpgradedGiftSale" - TypeTonTransactionTypeStakeDiceStake = "tonTransactionTypeStakeDiceStake" - TypeTonTransactionTypeStakeDicePayout = "tonTransactionTypeStakeDicePayout" - TypeTonTransactionTypeUnsupported = "tonTransactionTypeUnsupported" - TypeTonTransaction = "tonTransaction" - TypeTonTransactions = "tonTransactions" - TypeActiveStoryStateLive = "activeStoryStateLive" - TypeActiveStoryStateUnread = "activeStoryStateUnread" - TypeActiveStoryStateRead = "activeStoryStateRead" TypeGiveawayParticipantStatusEligible = "giveawayParticipantStatusEligible" TypeGiveawayParticipantStatusParticipating = "giveawayParticipantStatusParticipating" TypeGiveawayParticipantStatusAlreadyWasMember = "giveawayParticipantStatusAlreadyWasMember" @@ -1044,8 +848,6 @@ const ( TypeAccentColor = "accentColor" TypeProfileAccentColors = "profileAccentColors" TypeProfileAccentColor = "profileAccentColor" - TypeUserRating = "userRating" - TypeRestrictionInfo = "restrictionInfo" TypeEmojiStatusTypeCustomEmoji = "emojiStatusTypeCustomEmoji" TypeEmojiStatusTypeUpgradedGift = "emojiStatusTypeUpgradedGift" TypeEmojiStatus = "emojiStatus" @@ -1104,7 +906,6 @@ const ( TypeSecretChatStateReady = "secretChatStateReady" TypeSecretChatStateClosed = "secretChatStateClosed" TypeSecretChat = "secretChat" - TypePublicPostSearchLimits = "publicPostSearchLimits" TypeMessageSenderUser = "messageSenderUser" TypeMessageSenderChat = "messageSenderChat" TypeMessageSenders = "messageSenders" @@ -1129,7 +930,6 @@ const ( TypePaidReactionTypeAnonymous = "paidReactionTypeAnonymous" TypePaidReactionTypeChat = "paidReactionTypeChat" TypePaidReactor = "paidReactor" - TypeLiveStoryDonors = "liveStoryDonors" TypeMessageForwardInfo = "messageForwardInfo" TypeMessageImportInfo = "messageImportInfo" TypeMessageReplyInfo = "messageReplyInfo" @@ -1137,10 +937,6 @@ const ( TypeMessageReactions = "messageReactions" TypeMessageInteractionInfo = "messageInteractionInfo" TypeUnreadReaction = "unreadReaction" - TypeMessageTopicThread = "messageTopicThread" - TypeMessageTopicForum = "messageTopicForum" - TypeMessageTopicDirectMessages = "messageTopicDirectMessages" - TypeMessageTopicSavedMessages = "messageTopicSavedMessages" TypeMessageEffectTypeEmojiReaction = "messageEffectTypeEmojiReaction" TypeMessageEffectTypePremiumSticker = "messageEffectTypePremiumSticker" TypeMessageEffect = "messageEffect" @@ -1158,7 +954,6 @@ const ( TypeMessages = "messages" TypeFoundMessages = "foundMessages" TypeFoundChatMessages = "foundChatMessages" - TypeFoundPublicPosts = "foundPublicPosts" TypeMessagePosition = "messagePosition" TypeMessagePositions = "messagePositions" TypeMessageCalendarDay = "messageCalendarDay" @@ -1168,7 +963,6 @@ const ( TypeMessageSourceChatHistory = "messageSourceChatHistory" TypeMessageSourceMessageThreadHistory = "messageSourceMessageThreadHistory" TypeMessageSourceForumTopicHistory = "messageSourceForumTopicHistory" - TypeMessageSourceDirectMessagesChatTopicHistory = "messageSourceDirectMessagesChatTopicHistory" TypeMessageSourceHistoryPreview = "messageSourceHistoryPreview" TypeMessageSourceChatList = "messageSourceChatList" TypeMessageSourceSearch = "messageSourceSearch" @@ -1176,13 +970,11 @@ const ( TypeMessageSourceNotification = "messageSourceNotification" TypeMessageSourceScreenshot = "messageSourceScreenshot" TypeMessageSourceOther = "messageSourceOther" - TypeAdvertisementSponsor = "advertisementSponsor" + TypeMessageSponsor = "messageSponsor" TypeSponsoredMessage = "sponsoredMessage" TypeSponsoredMessages = "sponsoredMessages" TypeSponsoredChat = "sponsoredChat" TypeSponsoredChats = "sponsoredChats" - TypeVideoMessageAdvertisement = "videoMessageAdvertisement" - TypeVideoMessageAdvertisements = "videoMessageAdvertisements" TypeReportOption = "reportOption" TypeReportSponsoredResultOk = "reportSponsoredResultOk" TypeReportSponsoredResultFailed = "reportSponsoredResultFailed" @@ -1243,10 +1035,6 @@ const ( TypeChatActionBarAddContact = "chatActionBarAddContact" TypeChatActionBarSharePhoneNumber = "chatActionBarSharePhoneNumber" TypeChatActionBarJoinRequest = "chatActionBarJoinRequest" - TypeButtonStyleDefault = "buttonStyleDefault" - TypeButtonStylePrimary = "buttonStylePrimary" - TypeButtonStyleDanger = "buttonStyleDanger" - TypeButtonStyleSuccess = "buttonStyleSuccess" TypeKeyboardButtonTypeText = "keyboardButtonTypeText" TypeKeyboardButtonTypeRequestPhoneNumber = "keyboardButtonTypeRequestPhoneNumber" TypeKeyboardButtonTypeRequestLocation = "keyboardButtonTypeRequestLocation" @@ -1285,7 +1073,6 @@ const ( TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden" TypeSavedMessagesTopicTypeSavedFromChat = "savedMessagesTopicTypeSavedFromChat" TypeSavedMessagesTopic = "savedMessagesTopic" - TypeDirectMessagesChatTopic = "directMessagesChatTopic" TypeForumTopicIcon = "forumTopicIcon" TypeForumTopicInfo = "forumTopicInfo" TypeForumTopic = "forumTopic" @@ -1293,11 +1080,6 @@ const ( TypeLinkPreviewOptions = "linkPreviewOptions" TypeSharedUser = "sharedUser" TypeSharedChat = "sharedChat" - TypeBuiltInThemeClassic = "builtInThemeClassic" - TypeBuiltInThemeDay = "builtInThemeDay" - TypeBuiltInThemeNight = "builtInThemeNight" - TypeBuiltInThemeTinted = "builtInThemeTinted" - TypeBuiltInThemeArctic = "builtInThemeArctic" TypeThemeSettings = "themeSettings" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" @@ -1366,18 +1148,13 @@ const ( TypeLinkPreviewTypeBackground = "linkPreviewTypeBackground" TypeLinkPreviewTypeChannelBoost = "linkPreviewTypeChannelBoost" TypeLinkPreviewTypeChat = "linkPreviewTypeChat" - TypeLinkPreviewTypeDirectMessagesChat = "linkPreviewTypeDirectMessagesChat" TypeLinkPreviewTypeDocument = "linkPreviewTypeDocument" TypeLinkPreviewTypeEmbeddedAnimationPlayer = "linkPreviewTypeEmbeddedAnimationPlayer" TypeLinkPreviewTypeEmbeddedAudioPlayer = "linkPreviewTypeEmbeddedAudioPlayer" TypeLinkPreviewTypeEmbeddedVideoPlayer = "linkPreviewTypeEmbeddedVideoPlayer" TypeLinkPreviewTypeExternalAudio = "linkPreviewTypeExternalAudio" TypeLinkPreviewTypeExternalVideo = "linkPreviewTypeExternalVideo" - TypeLinkPreviewTypeGiftAuction = "linkPreviewTypeGiftAuction" - TypeLinkPreviewTypeGiftCollection = "linkPreviewTypeGiftCollection" - TypeLinkPreviewTypeGroupCall = "linkPreviewTypeGroupCall" TypeLinkPreviewTypeInvoice = "linkPreviewTypeInvoice" - TypeLinkPreviewTypeLiveStory = "linkPreviewTypeLiveStory" TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" @@ -1385,7 +1162,6 @@ const ( TypeLinkPreviewTypeSticker = "linkPreviewTypeSticker" TypeLinkPreviewTypeStickerSet = "linkPreviewTypeStickerSet" TypeLinkPreviewTypeStory = "linkPreviewTypeStory" - TypeLinkPreviewTypeStoryAlbum = "linkPreviewTypeStoryAlbum" TypeLinkPreviewTypeSupergroupBoost = "linkPreviewTypeSupergroupBoost" TypeLinkPreviewTypeTheme = "linkPreviewTypeTheme" TypeLinkPreviewTypeUnsupported = "linkPreviewTypeUnsupported" @@ -1531,12 +1307,9 @@ const ( TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" - TypeMessageStakeDice = "messageStakeDice" TypeMessageStory = "messageStory" - TypeMessageChecklist = "messageChecklist" TypeMessageInvoice = "messageInvoice" TypeMessageCall = "messageCall" - TypeMessageGroupCall = "messageGroupCall" TypeMessageVideoChatScheduled = "messageVideoChatScheduled" TypeMessageVideoChatStarted = "messageVideoChatStarted" TypeMessageVideoChatEnded = "messageVideoChatEnded" @@ -1546,8 +1319,6 @@ const ( TypeMessageChatChangeTitle = "messageChatChangeTitle" TypeMessageChatChangePhoto = "messageChatChangePhoto" TypeMessageChatDeletePhoto = "messageChatDeletePhoto" - TypeMessageChatOwnerLeft = "messageChatOwnerLeft" - TypeMessageChatOwnerChanged = "messageChatOwnerChanged" TypeMessageChatAddMembers = "messageChatAddMembers" TypeMessageChatJoinByLink = "messageChatJoinByLink" TypeMessageChatJoinByRequest = "messageChatJoinByRequest" @@ -1565,7 +1336,6 @@ const ( TypeMessageForumTopicIsClosedToggled = "messageForumTopicIsClosedToggled" TypeMessageForumTopicIsHiddenToggled = "messageForumTopicIsHiddenToggled" TypeMessageSuggestProfilePhoto = "messageSuggestProfilePhoto" - TypeMessageSuggestBirthdate = "messageSuggestBirthdate" TypeMessageCustomServiceAction = "messageCustomServiceAction" TypeMessageGameScore = "messageGameScore" TypeMessagePaymentSuccessful = "messagePaymentSuccessful" @@ -1578,23 +1348,12 @@ const ( TypeMessageGiveawayCompleted = "messageGiveawayCompleted" TypeMessageGiveawayWinners = "messageGiveawayWinners" TypeMessageGiftedStars = "messageGiftedStars" - TypeMessageGiftedTon = "messageGiftedTon" TypeMessageGiveawayPrizeStars = "messageGiveawayPrizeStars" TypeMessageGift = "messageGift" TypeMessageUpgradedGift = "messageUpgradedGift" TypeMessageRefundedUpgradedGift = "messageRefundedUpgradedGift" - TypeMessageUpgradedGiftPurchaseOffer = "messageUpgradedGiftPurchaseOffer" - TypeMessageUpgradedGiftPurchaseOfferRejected = "messageUpgradedGiftPurchaseOfferRejected" TypeMessagePaidMessagesRefunded = "messagePaidMessagesRefunded" TypeMessagePaidMessagePriceChanged = "messagePaidMessagePriceChanged" - TypeMessageDirectMessagePriceChanged = "messageDirectMessagePriceChanged" - TypeMessageChecklistTasksDone = "messageChecklistTasksDone" - TypeMessageChecklistTasksAdded = "messageChecklistTasksAdded" - TypeMessageSuggestedPostApprovalFailed = "messageSuggestedPostApprovalFailed" - TypeMessageSuggestedPostApproved = "messageSuggestedPostApproved" - TypeMessageSuggestedPostDeclined = "messageSuggestedPostDeclined" - TypeMessageSuggestedPostPaid = "messageSuggestedPostPaid" - TypeMessageSuggestedPostRefunded = "messageSuggestedPostRefunded" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageUsersShared = "messageUsersShared" TypeMessageChatShared = "messageChatShared" @@ -1655,9 +1414,7 @@ const ( TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" - TypeInputMessageStakeDice = "inputMessageStakeDice" TypeInputMessageStory = "inputMessageStory" - TypeInputMessageChecklist = "inputMessageChecklist" TypeInputMessageForwarded = "inputMessageForwarded" TypeMessageProperties = "messageProperties" TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" @@ -1738,13 +1495,8 @@ const ( TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" - TypeStoryContentTypePhoto = "storyContentTypePhoto" - TypeStoryContentTypeVideo = "storyContentTypeVideo" - TypeStoryContentTypeLive = "storyContentTypeLive" - TypeStoryContentTypeUnsupported = "storyContentTypeUnsupported" TypeStoryContentPhoto = "storyContentPhoto" TypeStoryContentVideo = "storyContentVideo" - TypeStoryContentLive = "storyContentLive" TypeStoryContentUnsupported = "storyContentUnsupported" TypeInputStoryContentPhoto = "inputStoryContentPhoto" TypeInputStoryContentVideo = "inputStoryContentVideo" @@ -1757,8 +1509,6 @@ const ( TypeStory = "story" TypeStories = "stories" TypeFoundStories = "foundStories" - TypeStoryAlbum = "storyAlbum" - TypeStoryAlbums = "storyAlbums" TypeStoryFullId = "storyFullId" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" @@ -1794,7 +1544,7 @@ const ( TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" TypeCallDiscardReasonDisconnected = "callDiscardReasonDisconnected" TypeCallDiscardReasonHungUp = "callDiscardReasonHungUp" - TypeCallDiscardReasonUpgradeToGroupCall = "callDiscardReasonUpgradeToGroupCall" + TypeCallDiscardReasonAllowGroupCall = "callDiscardReasonAllowGroupCall" TypeCallProtocol = "callProtocol" TypeCallServerTypeTelegramReflector = "callServerTypeTelegramReflector" TypeCallServerTypeWebrtc = "callServerTypeWebrtc" @@ -1807,7 +1557,6 @@ const ( TypeCallStateHangingUp = "callStateHangingUp" TypeCallStateDiscarded = "callStateDiscarded" TypeCallStateError = "callStateError" - TypeGroupCallJoinParameters = "groupCallJoinParameters" TypeGroupCallVideoQualityThumbnail = "groupCallVideoQualityThumbnail" TypeGroupCallVideoQualityMedium = "groupCallVideoQualityMedium" TypeGroupCallVideoQualityFull = "groupCallVideoQualityFull" @@ -1819,18 +1568,6 @@ const ( TypeGroupCallVideoSourceGroup = "groupCallVideoSourceGroup" TypeGroupCallParticipantVideoInfo = "groupCallParticipantVideoInfo" TypeGroupCallParticipant = "groupCallParticipant" - TypeGroupCallParticipants = "groupCallParticipants" - TypeGroupCallInfo = "groupCallInfo" - TypeGroupCallMessage = "groupCallMessage" - TypeGroupCallMessageLevel = "groupCallMessageLevel" - TypeInviteGroupCallParticipantResultUserPrivacyRestricted = "inviteGroupCallParticipantResultUserPrivacyRestricted" - TypeInviteGroupCallParticipantResultUserAlreadyParticipant = "inviteGroupCallParticipantResultUserAlreadyParticipant" - TypeInviteGroupCallParticipantResultUserWasBanned = "inviteGroupCallParticipantResultUserWasBanned" - TypeInviteGroupCallParticipantResultSuccess = "inviteGroupCallParticipantResultSuccess" - TypeGroupCallDataChannelMain = "groupCallDataChannelMain" - TypeGroupCallDataChannelScreenSharing = "groupCallDataChannelScreenSharing" - TypeInputGroupCallLink = "inputGroupCallLink" - TypeInputGroupCallMessage = "inputGroupCallMessage" TypeCallProblemEcho = "callProblemEcho" TypeCallProblemNoise = "callProblemNoise" TypeCallProblemInterruptions = "callProblemInterruptions" @@ -1854,7 +1591,6 @@ const ( TypeAnimations = "animations" TypeDiceStickersRegular = "diceStickersRegular" TypeDiceStickersSlotMachine = "diceStickersSlotMachine" - TypeImportedContact = "importedContact" TypeImportedContacts = "importedContacts" TypeSpeechRecognitionResultPending = "speechRecognitionResultPending" TypeSpeechRecognitionResultText = "speechRecognitionResultText" @@ -1946,7 +1682,6 @@ const ( TypeChatEventHasAggressiveAntiSpamEnabledToggled = "chatEventHasAggressiveAntiSpamEnabledToggled" TypeChatEventSignMessagesToggled = "chatEventSignMessagesToggled" TypeChatEventShowMessageSenderToggled = "chatEventShowMessageSenderToggled" - TypeChatEventAutomaticTranslationToggled = "chatEventAutomaticTranslationToggled" TypeChatEventInviteLinkEdited = "chatEventInviteLinkEdited" TypeChatEventInviteLinkRevoked = "chatEventInviteLinkRevoked" TypeChatEventInviteLinkDeleted = "chatEventInviteLinkDeleted" @@ -1986,8 +1721,8 @@ const ( TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount" TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount" - TypePremiumLimitTypeWeeklyPostedStoryCount = "premiumLimitTypeWeeklyPostedStoryCount" - TypePremiumLimitTypeMonthlyPostedStoryCount = "premiumLimitTypeMonthlyPostedStoryCount" + TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount" + TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount" @@ -2015,8 +1750,6 @@ const ( TypePremiumFeatureLastSeenTimes = "premiumFeatureLastSeenTimes" TypePremiumFeatureBusiness = "premiumFeatureBusiness" TypePremiumFeatureMessageEffects = "premiumFeatureMessageEffects" - TypePremiumFeatureChecklists = "premiumFeatureChecklists" - TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -2086,25 +1819,16 @@ const ( TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" TypeInputBackgroundPrevious = "inputBackgroundPrevious" - TypeEmojiChatTheme = "emojiChatTheme" - TypeGiftChatTheme = "giftChatTheme" - TypeGiftChatThemes = "giftChatThemes" - TypeChatThemeEmoji = "chatThemeEmoji" - TypeChatThemeGift = "chatThemeGift" - TypeInputChatThemeEmoji = "inputChatThemeEmoji" - TypeInputChatThemeGift = "inputChatThemeGift" + TypeChatTheme = "chatTheme" TypeTimeZone = "timeZone" TypeTimeZones = "timeZones" TypeHashtags = "hashtags" - TypeCanPostStoryResultOk = "canPostStoryResultOk" - TypeCanPostStoryResultPremiumNeeded = "canPostStoryResultPremiumNeeded" - TypeCanPostStoryResultBoostNeeded = "canPostStoryResultBoostNeeded" - TypeCanPostStoryResultActiveStoryLimitExceeded = "canPostStoryResultActiveStoryLimitExceeded" - TypeCanPostStoryResultWeeklyLimitExceeded = "canPostStoryResultWeeklyLimitExceeded" - TypeCanPostStoryResultMonthlyLimitExceeded = "canPostStoryResultMonthlyLimitExceeded" - TypeCanPostStoryResultLiveStoryIsActive = "canPostStoryResultLiveStoryIsActive" - TypeStartLiveStoryResultOk = "startLiveStoryResultOk" - TypeStartLiveStoryResultFail = "startLiveStoryResultFail" + TypeCanSendStoryResultOk = "canSendStoryResultOk" + TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded" + TypeCanSendStoryResultBoostNeeded = "canSendStoryResultBoostNeeded" + TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded" + TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded" + TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded" TypeCanTransferOwnershipResultOk = "canTransferOwnershipResultOk" TypeCanTransferOwnershipResultPasswordNeeded = "canTransferOwnershipResultPasswordNeeded" TypeCanTransferOwnershipResultPasswordTooFresh = "canTransferOwnershipResultPasswordTooFresh" @@ -2145,7 +1869,6 @@ const ( TypePushMessageContentSticker = "pushMessageContentSticker" TypePushMessageContentStory = "pushMessageContentStory" TypePushMessageContentText = "pushMessageContentText" - TypePushMessageContentChecklist = "pushMessageContentChecklist" TypePushMessageContentVideo = "pushMessageContentVideo" TypePushMessageContentVideoNote = "pushMessageContentVideoNote" TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote" @@ -2163,10 +1886,7 @@ const ( TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest" TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment" TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto" - TypePushMessageContentSuggestBirthdate = "pushMessageContentSuggestBirthdate" TypePushMessageContentProximityAlertTriggered = "pushMessageContentProximityAlertTriggered" - TypePushMessageContentChecklistTasksAdded = "pushMessageContentChecklistTasksAdded" - TypePushMessageContentChecklistTasksDone = "pushMessageContentChecklistTasksDone" TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" TypeNotificationTypeNewMessage = "notificationTypeNewMessage" @@ -2181,7 +1901,6 @@ const ( TypeNotificationSounds = "notificationSounds" TypeNotification = "notification" TypeNotificationGroup = "notificationGroup" - TypeProxy = "proxy" TypeOptionValueBoolean = "optionValueBoolean" TypeOptionValueEmpty = "optionValueEmpty" TypeOptionValueInteger = "optionValueInteger" @@ -2215,7 +1934,6 @@ const ( TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" TypeUserPrivacySettingShowBirthdate = "userPrivacySettingShowBirthdate" - TypeUserPrivacySettingShowProfileAudio = "userPrivacySettingShowProfileAudio" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -2270,27 +1988,7 @@ const ( TypeReportStoryResultOk = "reportStoryResultOk" TypeReportStoryResultOptionRequired = "reportStoryResultOptionRequired" TypeReportStoryResultTextRequired = "reportStoryResultTextRequired" - TypeSettingsSectionAppearance = "settingsSectionAppearance" - TypeSettingsSectionAskQuestion = "settingsSectionAskQuestion" - TypeSettingsSectionBusiness = "settingsSectionBusiness" - TypeSettingsSectionChatFolders = "settingsSectionChatFolders" - TypeSettingsSectionDataAndStorage = "settingsSectionDataAndStorage" - TypeSettingsSectionDevices = "settingsSectionDevices" - TypeSettingsSectionEditProfile = "settingsSectionEditProfile" - TypeSettingsSectionFaq = "settingsSectionFaq" - TypeSettingsSectionFeatures = "settingsSectionFeatures" - TypeSettingsSectionInAppBrowser = "settingsSectionInAppBrowser" - TypeSettingsSectionLanguage = "settingsSectionLanguage" - TypeSettingsSectionMyStars = "settingsSectionMyStars" - TypeSettingsSectionMyToncoins = "settingsSectionMyToncoins" - TypeSettingsSectionNotifications = "settingsSectionNotifications" - TypeSettingsSectionPowerSaving = "settingsSectionPowerSaving" - TypeSettingsSectionPremium = "settingsSectionPremium" - TypeSettingsSectionPrivacyAndSecurity = "settingsSectionPrivacyAndSecurity" - TypeSettingsSectionPrivacyPolicy = "settingsSectionPrivacyPolicy" - TypeSettingsSectionQrCode = "settingsSectionQrCode" - TypeSettingsSectionSearch = "settingsSectionSearch" - TypeSettingsSectionSendGift = "settingsSectionSendGift" + TypeInternalLinkTypeActiveSessions = "internalLinkTypeActiveSessions" TypeInternalLinkTypeAttachmentMenuBot = "internalLinkTypeAttachmentMenuBot" TypeInternalLinkTypeAuthenticationCode = "internalLinkTypeAuthenticationCode" TypeInternalLinkTypeBackground = "internalLinkTypeBackground" @@ -2298,48 +1996,40 @@ const ( TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" TypeInternalLinkTypeBusinessChat = "internalLinkTypeBusinessChat" - TypeInternalLinkTypeCallsPage = "internalLinkTypeCallsPage" + TypeInternalLinkTypeBuyStars = "internalLinkTypeBuyStars" + TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" TypeInternalLinkTypeChatAffiliateProgram = "internalLinkTypeChatAffiliateProgram" TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" + TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" - TypeInternalLinkTypeChatSelection = "internalLinkTypeChatSelection" - TypeInternalLinkTypeContactsPage = "internalLinkTypeContactsPage" - TypeInternalLinkTypeDirectMessagesChat = "internalLinkTypeDirectMessagesChat" + TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" + TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" - TypeInternalLinkTypeGiftAuction = "internalLinkTypeGiftAuction" - TypeInternalLinkTypeGiftCollection = "internalLinkTypeGiftCollection" - TypeInternalLinkTypeGroupCall = "internalLinkTypeGroupCall" TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" - TypeInternalLinkTypeLiveStory = "internalLinkTypeLiveStory" + TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" TypeInternalLinkTypeMainWebApp = "internalLinkTypeMainWebApp" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" - TypeInternalLinkTypeMyProfilePage = "internalLinkTypeMyProfilePage" - TypeInternalLinkTypeNewChannelChat = "internalLinkTypeNewChannelChat" - TypeInternalLinkTypeNewGroupChat = "internalLinkTypeNewGroupChat" - TypeInternalLinkTypeNewPrivateChat = "internalLinkTypeNewPrivateChat" - TypeInternalLinkTypeNewStory = "internalLinkTypeNewStory" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" - TypeInternalLinkTypePremiumFeaturesPage = "internalLinkTypePremiumFeaturesPage" + TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePremiumGift = "internalLinkTypePremiumGift" TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" - TypeInternalLinkTypePremiumGiftPurchase = "internalLinkTypePremiumGiftPurchase" + TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" - TypeInternalLinkTypeSavedMessages = "internalLinkTypeSavedMessages" - TypeInternalLinkTypeSearch = "internalLinkTypeSearch" TypeInternalLinkTypeSettings = "internalLinkTypeSettings" - TypeInternalLinkTypeStarPurchase = "internalLinkTypeStarPurchase" TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" TypeInternalLinkTypeStory = "internalLinkTypeStory" - TypeInternalLinkTypeStoryAlbum = "internalLinkTypeStoryAlbum" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" + TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" + TypeInternalLinkTypeUnsupportedProxy = "internalLinkTypeUnsupportedProxy" TypeInternalLinkTypeUpgradedGift = "internalLinkTypeUpgradedGift" TypeInternalLinkTypeUserPhoneNumber = "internalLinkTypeUserPhoneNumber" TypeInternalLinkTypeUserToken = "internalLinkTypeUserToken" @@ -2351,6 +2041,7 @@ const ( TypeChatBoostLinkInfo = "chatBoostLinkInfo" TypeBlockListMain = "blockListMain" TypeBlockListStories = "blockListStories" + TypeFilePart = "filePart" TypeFileTypeNone = "fileTypeNone" TypeFileTypeAnimation = "fileTypeAnimation" TypeFileTypeAudio = "fileTypeAudio" @@ -2401,7 +2092,6 @@ const ( TypeConnectionStateConnecting = "connectionStateConnecting" TypeConnectionStateUpdating = "connectionStateUpdating" TypeConnectionStateReady = "connectionStateReady" - TypeAgeVerificationParameters = "ageVerificationParameters" TypeTopChatCategoryUsers = "topChatCategoryUsers" TypeTopChatCategoryBots = "topChatCategoryBots" TypeTopChatCategoryGroups = "topChatCategoryGroups" @@ -2432,12 +2122,8 @@ const ( TypeSuggestedActionSetProfilePhoto = "suggestedActionSetProfilePhoto" TypeSuggestedActionExtendPremium = "suggestedActionExtendPremium" TypeSuggestedActionExtendStarSubscriptions = "suggestedActionExtendStarSubscriptions" - TypeSuggestedActionCustom = "suggestedActionCustom" - TypeSuggestedActionSetLoginEmailAddress = "suggestedActionSetLoginEmailAddress" - TypeSuggestedActionAddLoginPasskey = "suggestedActionAddLoginPasskey" TypeCount = "count" TypeText = "text" - TypeData = "data" TypeSeconds = "seconds" TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize" TypeStarCount = "starCount" @@ -2447,8 +2133,8 @@ const ( TypeProxyTypeSocks5 = "proxyTypeSocks5" TypeProxyTypeHttp = "proxyTypeHttp" TypeProxyTypeMtproto = "proxyTypeMtproto" - TypeAddedProxy = "addedProxy" - TypeAddedProxies = "addedProxies" + TypeProxy = "proxy" + TypeProxies = "proxies" TypeInputSticker = "inputSticker" TypeDateRange = "dateRange" TypeStatisticalValue = "statisticalValue" @@ -2470,17 +2156,13 @@ const ( TypeRevenueWithdrawalStatePending = "revenueWithdrawalStatePending" TypeRevenueWithdrawalStateSucceeded = "revenueWithdrawalStateSucceeded" TypeRevenueWithdrawalStateFailed = "revenueWithdrawalStateFailed" - TypeChatRevenueTransactionTypeUnsupported = "chatRevenueTransactionTypeUnsupported" - TypeChatRevenueTransactionTypeSponsoredMessageEarnings = "chatRevenueTransactionTypeSponsoredMessageEarnings" - TypeChatRevenueTransactionTypeSuggestedPostEarnings = "chatRevenueTransactionTypeSuggestedPostEarnings" - TypeChatRevenueTransactionTypeFragmentWithdrawal = "chatRevenueTransactionTypeFragmentWithdrawal" - TypeChatRevenueTransactionTypeFragmentRefund = "chatRevenueTransactionTypeFragmentRefund" + TypeChatRevenueTransactionTypeEarnings = "chatRevenueTransactionTypeEarnings" + TypeChatRevenueTransactionTypeWithdrawal = "chatRevenueTransactionTypeWithdrawal" + TypeChatRevenueTransactionTypeRefund = "chatRevenueTransactionTypeRefund" TypeChatRevenueTransaction = "chatRevenueTransaction" TypeChatRevenueTransactions = "chatRevenueTransactions" TypeStarRevenueStatus = "starRevenueStatus" TypeStarRevenueStatistics = "starRevenueStatistics" - TypeTonRevenueStatus = "tonRevenueStatus" - TypeTonRevenueStatistics = "tonRevenueStatistics" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -2507,7 +2189,6 @@ const ( TypeUpdateMessageMentionRead = "updateMessageMentionRead" TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions" TypeUpdateMessageFactCheck = "updateMessageFactCheck" - TypeUpdateMessageSuggestedPostInfo = "updateMessageSuggestedPostInfo" TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed" TypeUpdateVideoPublished = "updateVideoPublished" TypeUpdateNewChat = "updateNewChat" @@ -2547,8 +2228,6 @@ const ( TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" TypeUpdateSavedMessagesTopic = "updateSavedMessagesTopic" TypeUpdateSavedMessagesTopicCount = "updateSavedMessagesTopicCount" - TypeUpdateDirectMessagesChatTopic = "updateDirectMessagesChatTopic" - TypeUpdateTopicMessageCount = "updateTopicMessageCount" TypeUpdateQuickReplyShortcut = "updateQuickReplyShortcut" TypeUpdateQuickReplyShortcutDeleted = "updateQuickReplyShortcutDeleted" TypeUpdateQuickReplyShortcuts = "updateQuickReplyShortcuts" @@ -2563,7 +2242,6 @@ const ( TypeUpdateHavePendingNotifications = "updateHavePendingNotifications" TypeUpdateDeleteMessages = "updateDeleteMessages" TypeUpdateChatAction = "updateChatAction" - TypeUpdatePendingTextMessage = "updatePendingTextMessage" TypeUpdateUserStatus = "updateUserStatus" TypeUpdateUser = "updateUser" TypeUpdateBasicGroup = "updateBasicGroup" @@ -2585,27 +2263,17 @@ const ( TypeUpdateCall = "updateCall" TypeUpdateGroupCall = "updateGroupCall" TypeUpdateGroupCallParticipant = "updateGroupCallParticipant" - TypeUpdateGroupCallParticipants = "updateGroupCallParticipants" - TypeUpdateGroupCallVerificationState = "updateGroupCallVerificationState" - TypeUpdateNewGroupCallMessage = "updateNewGroupCallMessage" - TypeUpdateNewGroupCallPaidReaction = "updateNewGroupCallPaidReaction" - TypeUpdateGroupCallMessageSendFailed = "updateGroupCallMessageSendFailed" - TypeUpdateGroupCallMessagesDeleted = "updateGroupCallMessagesDeleted" - TypeUpdateLiveStoryTopDonors = "updateLiveStoryTopDonors" TypeUpdateNewCallSignalingData = "updateNewCallSignalingData" - TypeUpdateGiftAuctionState = "updateGiftAuctionState" - TypeUpdateActiveGiftAuctions = "updateActiveGiftAuctions" TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" TypeUpdateStory = "updateStory" TypeUpdateStoryDeleted = "updateStoryDeleted" - TypeUpdateStoryPostSucceeded = "updateStoryPostSucceeded" - TypeUpdateStoryPostFailed = "updateStoryPostFailed" + TypeUpdateStorySendSucceeded = "updateStorySendSucceeded" + TypeUpdateStorySendFailed = "updateStorySendFailed" TypeUpdateChatActiveStories = "updateChatActiveStories" TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateStoryStealthMode = "updateStoryStealthMode" - TypeUpdateTrustedMiniAppBots = "updateTrustedMiniAppBots" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -2615,13 +2283,12 @@ const ( TypeUpdateSavedAnimations = "updateSavedAnimations" TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" TypeUpdateDefaultBackground = "updateDefaultBackground" - TypeUpdateEmojiChatThemes = "updateEmojiChatThemes" + TypeUpdateChatThemes = "updateChatThemes" TypeUpdateAccentColors = "updateAccentColors" TypeUpdateProfileAccentColors = "updateProfileAccentColors" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateFreezeState = "updateFreezeState" - TypeUpdateAgeVerificationParameters = "updateAgeVerificationParameters" TypeUpdateTermsOfService = "updateTermsOfService" TypeUpdateUnconfirmedSession = "updateUnconfirmedSession" TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots" @@ -2633,14 +2300,10 @@ const ( TypeUpdateSavedMessagesTags = "updateSavedMessagesTags" TypeUpdateActiveLiveLocationMessages = "updateActiveLiveLocationMessages" TypeUpdateOwnedStarCount = "updateOwnedStarCount" - TypeUpdateOwnedTonCount = "updateOwnedTonCount" TypeUpdateChatRevenueAmount = "updateChatRevenueAmount" TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" - TypeUpdateTonRevenueStatus = "updateTonRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" - TypeUpdateGroupCallMessageLevels = "updateGroupCallMessageLevels" TypeUpdateDiceEmojis = "updateDiceEmojis" - TypeUpdateStakeDiceState = "updateStakeDiceState" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" TypeUpdateSuggestedActions = "updateSuggestedActions" @@ -2744,11 +2407,6 @@ type PollType interface { PollTypeType() string } -// Describes a tab shown in a user or a chat profile -type ProfileTab interface { - ProfileTabType() string -} - // Represents the type of user. The following types are possible: regular users, deleted users and bots type UserType interface { UserTypeType() string @@ -2769,31 +2427,6 @@ type InputChatPhoto interface { InputChatPhotoType() string } -// Describes price of a resold gift -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 -} - -// Describes state of a suggested post -type SuggestedPostState interface { - SuggestedPostStateType() string -} - -// Describes reason for refund of the payment for a suggested post -type SuggestedPostRefundReason interface { - SuggestedPostRefundReasonType() string -} - // Describes type of subscription paid in Telegram Stars type StarSubscriptionType interface { StarSubscriptionTypeType() string @@ -2809,54 +2442,14 @@ type AffiliateProgramSortOrder interface { AffiliateProgramSortOrderType() string } -// Describes whether a gift can be sent now by the current user -type CanSendGiftResult interface { - CanSendGiftResultType() string -} - -// Describes origin from which the upgraded gift was obtained -type UpgradedGiftOrigin interface { - UpgradedGiftOriginType() string -} - -// Describes rarity of an upgraded gift attribute -type UpgradedGiftAttributeRarity interface { - UpgradedGiftAttributeRarityType() string -} - -// Contains result of gift crafting -type CraftGiftResult interface { - CraftGiftResultType() string -} - -// Contains identifier of an upgraded gift attribute to search for -type UpgradedGiftAttributeId interface { - UpgradedGiftAttributeIdType() string -} - -// Describes order in which upgraded gifts for resale will be sorted -type GiftForResaleOrder interface { - GiftForResaleOrderType() string -} - -// Describes result of sending a resold gift -type GiftResaleResult interface { - GiftResaleResultType() string -} - // Represents content of a gift received by a user or a channel chat 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 +// Describes direction of a transaction with Telegram Stars +type StarTransactionDirection interface { + StarTransactionDirectionType() string } // Describes type of transaction with Telegram Stars @@ -2864,16 +2457,6 @@ type StarTransactionType interface { StarTransactionTypeType() string } -// Describes type of transaction with Toncoins -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 @@ -2944,11 +2527,6 @@ type PaidReactionType interface { PaidReactionTypeType() string } -// Describes a topic of messages in a chat -type MessageTopic interface { - MessageTopicType() string -} - // Describes type of emoji effect type MessageEffectType interface { MessageEffectTypeType() string @@ -3019,11 +2597,6 @@ type ChatActionBar interface { ChatActionBarType() string } -// Describes style of a button -type ButtonStyle interface { - ButtonStyleType() string -} - // Describes a keyboard button type type KeyboardButtonType interface { KeyboardButtonTypeType() string @@ -3054,11 +2627,6 @@ type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string } -// Describes a built-in theme of an official app -type BuiltInTheme interface { - BuiltInThemeType() string -} - // Describes a formatted text object type RichText interface { RichTextType() string @@ -3219,17 +2787,12 @@ type InputStoryAreaType interface { InputStoryAreaTypeType() string } -// Contains the type of the content of a story -type StoryContentType interface { - StoryContentTypeType() string -} - // Contains the content of a story type StoryContent interface { StoryContentType() string } -// The content of a story to post +// The content of a story to send type InputStoryContent interface { InputStoryContentType() string } @@ -3284,21 +2847,6 @@ type GroupCallVideoQuality interface { GroupCallVideoQualityType() string } -// Describes result of group call participant invitation -type InviteGroupCallParticipantResult interface { - InviteGroupCallParticipantResultType() string -} - -// Describes data channel for a group call -type GroupCallDataChannel interface { - GroupCallDataChannelType() string -} - -// Describes a non-joined group call that isn't bound to a chat -type InputGroupCall interface { - InputGroupCallType() string -} - // Describes the exact type of problem with a call type CallProblem interface { CallProblemType() string @@ -3424,24 +2972,9 @@ type InputBackground interface { InputBackgroundType() string } -// Describes a chat theme -type ChatTheme interface { - ChatThemeType() string -} - -// Describes a chat theme to set -type InputChatTheme interface { - InputChatThemeType() string -} - -// Represents result of checking whether the current user can post a story on behalf of the specific chat -type CanPostStoryResult interface { - CanPostStoryResultType() string -} - -// Represents result of starting a live story -type StartLiveStoryResult interface { - StartLiveStoryResultType() string +// Represents result of checking whether the current user can send a story in the specific chat +type CanSendStoryResult interface { + CanSendStoryResultType() string } // Represents result of checking whether the current session can be used to transfer a chat ownership to another user @@ -3534,11 +3067,6 @@ type ReportStoryResult interface { ReportStoryResultType() string } -// Describes a section of the application settings -type SettingsSection interface { - SettingsSectionType() string -} - // Describes an internal https://t.me or tg: link, which must be processed by the application in a special way type InternalLinkType interface { InternalLinkTypeType() string @@ -4331,60 +3859,6 @@ 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 @@ -4410,7 +3884,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, getAuthenticationPasskeyParameters, 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 or checkAuthenticationBotToken for other authentication options type AuthorizationStateWaitPhoneNumber struct{ meta } @@ -4440,10 +3914,6 @@ type AuthorizationStateWaitPremiumPurchase struct { meta // Identifier of the store product that must be bought StoreProductId string `json:"store_product_id"` - // Email address to use for support if the user has issues with Telegram Premium purchase - SupportEmailAddress string `json:"support_email_address"` - // Subject for the email sent to the support email address - SupportEmailSubject string `json:"support_email_subject"` } func (entity *AuthorizationStateWaitPremiumPurchase) MarshalJSON() ([]byte, error) { @@ -5936,145 +5406,6 @@ func (*PollTypeQuiz) PollTypeType() string { return TypePollTypeQuiz } -// Describes a task in a checklist -type ChecklistTask struct { - meta - // Unique identifier of the task - 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 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"` -} - -func (entity *ChecklistTask) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChecklistTask - - return json.Marshal((*stub)(entity)) -} - -func (*ChecklistTask) GetClass() string { - return ClassChecklistTask -} - -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 - // Unique identifier of the task; must be positive - Id int32 `json:"id"` - // Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities - Text *FormattedText `json:"text"` -} - -func (entity *InputChecklistTask) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChecklistTask - - return json.Marshal((*stub)(entity)) -} - -func (*InputChecklistTask) GetClass() string { - return ClassInputChecklistTask -} - -func (*InputChecklistTask) GetType() string { - return TypeInputChecklistTask -} - -// Describes a checklist -type Checklist struct { - meta - // Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities - Title *FormattedText `json:"title"` - // List of tasks in the checklist - Tasks []*ChecklistTask `json:"tasks"` - // True, if users other than creator of the list can add tasks to the list - OthersCanAddTasks bool `json:"others_can_add_tasks"` - // True, if the current user can add tasks to the list if they have Telegram Premium subscription - CanAddTasks bool `json:"can_add_tasks"` - // True, if users other than creator of the list can mark tasks as done or not done. If true, then the checklist is called "group checklist" - OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done"` - // True, if the current user can mark tasks as done or not done if they have Telegram Premium subscription - CanMarkTasksAsDone bool `json:"can_mark_tasks_as_done"` -} - -func (entity *Checklist) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Checklist - - return json.Marshal((*stub)(entity)) -} - -func (*Checklist) GetClass() string { - return ClassChecklist -} - -func (*Checklist) GetType() string { - return TypeChecklist -} - -// Describes a checklist to be sent -type InputChecklist struct { - meta - // Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities - Title *FormattedText `json:"title"` - // List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks - Tasks []*InputChecklistTask `json:"tasks"` - // True, if other users can add tasks to the list - OthersCanAddTasks bool `json:"others_can_add_tasks"` - // True, if other users can mark tasks as done or not done - OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done"` -} - -func (entity *InputChecklist) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChecklist - - return json.Marshal((*stub)(entity)) -} - -func (*InputChecklist) GetClass() string { - return ClassInputChecklist -} - -func (*InputChecklist) GetType() string { - return TypeInputChecklist -} - // Describes an animation file. The animation must be encoded in GIF or MPEG4 format type Animation struct { meta @@ -6153,31 +5484,6 @@ func (*Audio) GetType() string { return TypeAudio } -// Contains a list of audio files -type Audios struct { - meta - // Approximate total number of audio files found - TotalCount int32 `json:"total_count"` - // List of audio files - Audios []*Audio `json:"audios"` -} - -func (entity *Audios) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Audios - - return json.Marshal((*stub)(entity)) -} - -func (*Audios) GetClass() string { - return ClassAudios -} - -func (*Audios) GetType() string { - return TypeAudios -} - // Describes a document of any type type Document struct { meta @@ -6247,7 +5553,7 @@ type Sticker struct { Width int32 `json:"width"` // Sticker height; as defined by the sender Height int32 `json:"height"` - // Emoji corresponding to the sticker; may be empty if unknown + // Emoji corresponding to the sticker Emoji string `json:"emoji"` // Sticker format Format StickerFormat `json:"format"` @@ -6502,14 +5808,14 @@ func (*AnimatedEmoji) GetType() string { return TypeAnimatedEmoji } -// Describes a contact of a user +// Describes a user contact type Contact struct { meta // Phone number of the user PhoneNumber string `json:"phone_number"` - // First name of the user; 1-64 characters + // First name of the user; 1-255 characters in length FirstName string `json:"first_name"` - // Last name of the user; 0-64 characters + // Last name of the user LastName string `json:"last_name"` // Additional data about the user in a form of vCard; 0-2048 bytes in length Vcard string `json:"vcard"` @@ -6628,39 +5934,6 @@ 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 Toncoin amount that was staked in the previous roll; in the smallest units of the currency - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // The amounts of Toncoins that are suggested to be staked; in the smallest units of the currency - SuggestedStakeToncoinAmounts []int64 `json:"suggested_stake_toncoin_amounts"` - // 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 @@ -6779,7 +6052,7 @@ type AlternativeVideo struct { Width int32 `json:"width"` // Video height Height int32 `json:"height"` - // Codec used for video file encoding, for example, "h264", "h265", "av1", or "av01" + // Codec used for video file encoding, for example, "h264", "h265", or "av1" Codec string `json:"codec"` // HLS file describing the video HlsFile *File `json:"hls_file"` @@ -6803,35 +6076,6 @@ func (*AlternativeVideo) GetType() string { return TypeAlternativeVideo } -// Describes a storyboard for a video -type VideoStoryboard struct { - meta - // A JPEG file that contains tiled previews of video - StoryboardFile *File `json:"storyboard_file"` - // Width of a tile - Width int32 `json:"width"` - // Height of a tile - Height int32 `json:"height"` - // File that describes mapping of position in the video to a tile in the JPEG file - MapFile *File `json:"map_file"` -} - -func (entity *VideoStoryboard) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub VideoStoryboard - - return json.Marshal((*stub)(entity)) -} - -func (*VideoStoryboard) GetClass() string { - return ClassVideoStoryboard -} - -func (*VideoStoryboard) GetType() string { - return TypeVideoStoryboard -} - // Describes a chat background type Background struct { meta @@ -7004,206 +6248,6 @@ func (*ChatPhotoInfo) GetType() string { return TypeChatPhotoInfo } -// A tab with stories posted by the user or the channel chat and saved to profile -type ProfileTabPosts struct{ - meta -} - -func (entity *ProfileTabPosts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabPosts - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabPosts) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabPosts) GetType() string { - return TypeProfileTabPosts -} - -func (*ProfileTabPosts) ProfileTabType() string { - return TypeProfileTabPosts -} - -// A tab with gifts received by the user or the channel chat -type ProfileTabGifts struct{ - meta -} - -func (entity *ProfileTabGifts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabGifts - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabGifts) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabGifts) GetType() string { - return TypeProfileTabGifts -} - -func (*ProfileTabGifts) ProfileTabType() string { - return TypeProfileTabGifts -} - -// A tab with photos and videos posted by the channel -type ProfileTabMedia struct{ - meta -} - -func (entity *ProfileTabMedia) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabMedia - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabMedia) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabMedia) GetType() string { - return TypeProfileTabMedia -} - -func (*ProfileTabMedia) ProfileTabType() string { - return TypeProfileTabMedia -} - -// A tab with documents posted by the channel -type ProfileTabFiles struct{ - meta -} - -func (entity *ProfileTabFiles) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabFiles - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabFiles) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabFiles) GetType() string { - return TypeProfileTabFiles -} - -func (*ProfileTabFiles) ProfileTabType() string { - return TypeProfileTabFiles -} - -// A tab with messages posted by the channel and containing links -type ProfileTabLinks struct{ - meta -} - -func (entity *ProfileTabLinks) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabLinks - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabLinks) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabLinks) GetType() string { - return TypeProfileTabLinks -} - -func (*ProfileTabLinks) ProfileTabType() string { - return TypeProfileTabLinks -} - -// A tab with audio messages posted by the channel -type ProfileTabMusic struct{ - meta -} - -func (entity *ProfileTabMusic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabMusic - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabMusic) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabMusic) GetType() string { - return TypeProfileTabMusic -} - -func (*ProfileTabMusic) ProfileTabType() string { - return TypeProfileTabMusic -} - -// A tab with voice notes posted by the channel -type ProfileTabVoice struct{ - meta -} - -func (entity *ProfileTabVoice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabVoice - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabVoice) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabVoice) GetType() string { - return TypeProfileTabVoice -} - -func (*ProfileTabVoice) ProfileTabType() string { - return TypeProfileTabVoice -} - -// A tab with animations posted by the channel -type ProfileTabGifs struct{ - meta -} - -func (entity *ProfileTabGifs) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ProfileTabGifs - - return json.Marshal((*stub)(entity)) -} - -func (*ProfileTabGifs) GetClass() string { - return ClassProfileTab -} - -func (*ProfileTabGifs) GetType() string { - return TypeProfileTabGifs -} - -func (*ProfileTabGifs) ProfileTabType() string { - return TypeProfileTabGifs -} - // A regular user type UserTypeRegular struct{ meta @@ -7265,10 +6309,6 @@ type UserTypeBot struct { CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` // True, if the bot has the main Web App HasMainWebApp bool `json:"has_main_web_app"` - // True, if the bot has topics - HasTopics bool `json:"has_topics"` - // True, if users can create and delete topics in the chat with the bot - AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` // Placeholder for inline queries (displayed on the application input field) @@ -7540,7 +6580,7 @@ func (*Birthdate) GetType() string { return TypeBirthdate } -// Describes a user who had or will have a birthday soon +// Describes a user that had or will have a birthday soon type CloseBirthdayUser struct { meta // User identifier @@ -7802,7 +6842,7 @@ type BusinessBotRights struct { CanEditProfilePhoto bool `json:"can_edit_profile_photo"` // True, if the bot can edit username of the business account CanEditUsername bool `json:"can_edit_username"` - // True, if the bot can view gifts and Telegram Star amount owned by the business account + // True, if the bot can view gifts and amount of Telegram Stars owned by the business account CanViewGiftsAndStars bool `json:"can_view_gifts_and_stars"` // True, if the bot can sell regular gifts received by the business account CanSellGifts bool `json:"can_sell_gifts"` @@ -7812,7 +6852,7 @@ type BusinessBotRights struct { CanTransferAndUpgradeGifts bool `json:"can_transfer_and_upgrade_gifts"` // True, if the bot can transfer Telegram Stars received by the business account to account of the bot, or use them to upgrade and transfer gifts CanTransferStars bool `json:"can_transfer_stars"` - // True, if the bot can post, edit and delete stories + // True, if the bot can send, edit and delete stories CanManageStories bool `json:"can_manage_stories"` } @@ -8264,7 +7304,7 @@ type ChatPhoto struct { Sizes []*PhotoSize `json:"sizes"` // A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null Animation *AnimatedChatPhoto `json:"animation"` - // A small (160x160) animated variant of the photo in MPEG4 format; may be null even if the big animation is available + // A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available SmallAnimation *AnimatedChatPhoto `json:"small_animation"` // Sticker-based version of the chat photo; may be null Sticker *ChatPhotoSticker `json:"sticker"` @@ -8473,7 +7513,7 @@ type ChatPermissions struct { CanSendVideoNotes bool `json:"can_send_video_notes"` // True, if the user can send voice notes CanSendVoiceNotes bool `json:"can_send_voice_notes"` - // True, if the user can send polls and checklists + // True, if the user can send polls CanSendPolls bool `json:"can_send_polls"` // True, if the user can send stickers. Implies can_send_messages permissions CanSendStickers bool `json:"can_send_stickers"` @@ -8514,11 +7554,11 @@ func (*ChatPermissions) GetType() string { // Describes rights of the administrator type ChatAdministratorRights struct { meta - // True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other privilege; applicable to supergroups and channels only + // True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can change the chat title, photo, and other settings CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts, approve suggested channel posts, or view channel statistics; applicable to channels only + // True, if the administrator can create channel posts or view channel statistics; applicable to channels only CanPostMessages bool `json:"can_post_messages"` // True, if the administrator can edit messages of other users and pin messages; applicable to channels only CanEditMessages bool `json:"can_edit_messages"` @@ -8526,7 +7566,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 + // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels 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"` @@ -8542,8 +7582,6 @@ type ChatAdministratorRights struct { CanEditStories bool `json:"can_edit_stories"` // True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only CanDeleteStories bool `json:"can_delete_stories"` - // True, if the administrator can answer to channel direct messages; applicable to channels only - CanManageDirectMessages bool `json:"can_manage_direct_messages"` // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only IsAnonymous bool `json:"is_anonymous"` } @@ -8564,420 +7602,10 @@ func (*ChatAdministratorRights) GetType() string { return TypeChatAdministratorRights } -// Describes price of a resold gift in Telegram Stars -type GiftResalePriceStar struct { - meta - // The Telegram Star amount expected to be paid for the gift. Must be in the range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale - StarCount int64 `json:"star_count"` -} - -func (entity *GiftResalePriceStar) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftResalePriceStar - - return json.Marshal((*stub)(entity)) -} - -func (*GiftResalePriceStar) GetClass() string { - return ClassGiftResalePrice -} - -func (*GiftResalePriceStar) GetType() string { - return TypeGiftResalePriceStar -} - -func (*GiftResalePriceStar) GiftResalePriceType() string { - return TypeGiftResalePriceStar -} - -// 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 the range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max") - ToncoinCentCount int64 `json:"toncoin_cent_count"` -} - -func (entity *GiftResalePriceTon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftResalePriceTon - - return json.Marshal((*stub)(entity)) -} - -func (*GiftResalePriceTon) GetClass() string { - return ClassGiftResalePrice -} - -func (*GiftResalePriceTon) GetType() string { - return TypeGiftResalePriceTon -} - -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 - // The Telegram Star amount expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max") - StarCount int64 `json:"star_count"` -} - -func (entity *SuggestedPostPriceStar) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostPriceStar - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostPriceStar) GetClass() string { - return ClassSuggestedPostPrice -} - -func (*SuggestedPostPriceStar) GetType() string { - return TypeSuggestedPostPriceStar -} - -func (*SuggestedPostPriceStar) SuggestedPostPriceType() string { - return TypeSuggestedPostPriceStar -} - -// Describes price of a suggested post in Toncoins -type SuggestedPostPriceTon struct { - meta - // The amount of 1/100 of Toncoin expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max") - ToncoinCentCount int64 `json:"toncoin_cent_count"` -} - -func (entity *SuggestedPostPriceTon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostPriceTon - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostPriceTon) GetClass() string { - return ClassSuggestedPostPrice -} - -func (*SuggestedPostPriceTon) GetType() string { - return TypeSuggestedPostPriceTon -} - -func (*SuggestedPostPriceTon) SuggestedPostPriceType() string { - return TypeSuggestedPostPriceTon -} - -// The post must be approved or declined -type SuggestedPostStatePending struct{ - meta -} - -func (entity *SuggestedPostStatePending) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostStatePending - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostStatePending) GetClass() string { - return ClassSuggestedPostState -} - -func (*SuggestedPostStatePending) GetType() string { - return TypeSuggestedPostStatePending -} - -func (*SuggestedPostStatePending) SuggestedPostStateType() string { - return TypeSuggestedPostStatePending -} - -// The post was approved -type SuggestedPostStateApproved struct{ - meta -} - -func (entity *SuggestedPostStateApproved) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostStateApproved - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostStateApproved) GetClass() string { - return ClassSuggestedPostState -} - -func (*SuggestedPostStateApproved) GetType() string { - return TypeSuggestedPostStateApproved -} - -func (*SuggestedPostStateApproved) SuggestedPostStateType() string { - return TypeSuggestedPostStateApproved -} - -// The post was declined -type SuggestedPostStateDeclined struct{ - meta -} - -func (entity *SuggestedPostStateDeclined) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostStateDeclined - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostStateDeclined) GetClass() string { - return ClassSuggestedPostState -} - -func (*SuggestedPostStateDeclined) GetType() string { - return TypeSuggestedPostStateDeclined -} - -func (*SuggestedPostStateDeclined) SuggestedPostStateType() string { - return TypeSuggestedPostStateDeclined -} - -// Contains information about a suggested post. If the post can be approved or declined, then changes to the post can be also suggested. Use sendMessage with reply to the message and suggested post information to suggest message changes. Use addOffer to suggest price or time changes -type SuggestedPostInfo struct { - meta - // Price of the suggested post; may be null if the post is non-paid - Price SuggestedPostPrice `json:"price"` - // Point in time (Unix timestamp) when the post is expected to be published; 0 if the specific date isn't set yet - SendDate int32 `json:"send_date"` - // State of the post - State SuggestedPostState `json:"state"` - // True, if the suggested post can be approved by the current user using approveSuggestedPost; updates aren't sent when value of this field changes - CanBeApproved bool `json:"can_be_approved"` - // True, if the suggested post can be declined by the current user using declineSuggestedPost; updates aren't sent when value of this field changes - CanBeDeclined bool `json:"can_be_declined"` -} - -func (entity *SuggestedPostInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostInfo - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostInfo) GetClass() string { - return ClassSuggestedPostInfo -} - -func (*SuggestedPostInfo) GetType() string { - return TypeSuggestedPostInfo -} - -func (suggestedPostInfo *SuggestedPostInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - Price json.RawMessage `json:"price"` - SendDate int32 `json:"send_date"` - State json.RawMessage `json:"state"` - CanBeApproved bool `json:"can_be_approved"` - CanBeDeclined bool `json:"can_be_declined"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - suggestedPostInfo.SendDate = tmp.SendDate - suggestedPostInfo.CanBeApproved = tmp.CanBeApproved - suggestedPostInfo.CanBeDeclined = tmp.CanBeDeclined - - fieldPrice, _ := UnmarshalSuggestedPostPrice(tmp.Price) - suggestedPostInfo.Price = fieldPrice - - fieldState, _ := UnmarshalSuggestedPostState(tmp.State) - suggestedPostInfo.State = fieldState - - return nil -} - -// Contains information about a post to suggest -type InputSuggestedPostInfo struct { - meta - // Price of the suggested post; pass null to suggest a post without payment. If the current user isn't an administrator of the channel direct messages chat and has no enough funds to pay for the post, then the error "BALANCE_TOO_LOW" will be returned immediately - Price SuggestedPostPrice `json:"price"` - // Point in time (Unix timestamp) when the post is expected to be published; pass 0 if the date isn't restricted. If specified, then the date must be getOption("suggested_post_send_delay_min")-getOption("suggested_post_send_delay_max") seconds in the future - SendDate int32 `json:"send_date"` -} - -func (entity *InputSuggestedPostInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputSuggestedPostInfo - - return json.Marshal((*stub)(entity)) -} - -func (*InputSuggestedPostInfo) GetClass() string { - return ClassInputSuggestedPostInfo -} - -func (*InputSuggestedPostInfo) GetType() string { - return TypeInputSuggestedPostInfo -} - -func (inputSuggestedPostInfo *InputSuggestedPostInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - Price json.RawMessage `json:"price"` - SendDate int32 `json:"send_date"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - inputSuggestedPostInfo.SendDate = tmp.SendDate - - fieldPrice, _ := UnmarshalSuggestedPostPrice(tmp.Price) - inputSuggestedPostInfo.Price = fieldPrice - - return nil -} - -// The post was refunded, because it was deleted by channel administrators in less than getOption("suggested_post_lifetime_min") seconds -type SuggestedPostRefundReasonPostDeleted struct{ - meta -} - -func (entity *SuggestedPostRefundReasonPostDeleted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostRefundReasonPostDeleted - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostRefundReasonPostDeleted) GetClass() string { - return ClassSuggestedPostRefundReason -} - -func (*SuggestedPostRefundReasonPostDeleted) GetType() string { - return TypeSuggestedPostRefundReasonPostDeleted -} - -func (*SuggestedPostRefundReasonPostDeleted) SuggestedPostRefundReasonType() string { - return TypeSuggestedPostRefundReasonPostDeleted -} - -// The post was refunded, because the payment for the post was refunded -type SuggestedPostRefundReasonPaymentRefunded struct{ - meta -} - -func (entity *SuggestedPostRefundReasonPaymentRefunded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedPostRefundReasonPaymentRefunded - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedPostRefundReasonPaymentRefunded) GetClass() string { - return ClassSuggestedPostRefundReason -} - -func (*SuggestedPostRefundReasonPaymentRefunded) GetType() string { - return TypeSuggestedPostRefundReasonPaymentRefunded -} - -func (*SuggestedPostRefundReasonPaymentRefunded) SuggestedPostRefundReasonType() string { - return TypeSuggestedPostRefundReasonPaymentRefunded -} - -// Describes a possibly non-integer Telegram Star amount +// Describes a possibly non-integer amount of Telegram Stars type StarAmount struct { meta - // The integer Telegram Star amount rounded to 0 + // The integer amount of Telegram Stars rounded to 0 StarCount int64 `json:"star_count"` // The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999 NanostarCount int32 `json:"nanostar_count"` @@ -9066,7 +7694,7 @@ type StarSubscriptionPricing struct { meta // The number of seconds between consecutive Telegram Star debiting Period int32 `json:"period"` - // The Telegram Star amount that must be paid for each period + // The amount of Telegram Stars that must be paid for each period StarCount int64 `json:"star_count"` } @@ -9392,7 +8020,7 @@ type AffiliateInfo struct { CommissionPerMille int32 `json:"commission_per_mille"` // Identifier of the chat which received the commission AffiliateChatId int64 `json:"affiliate_chat_id"` - // The Telegram Star amount that was received by the affiliate; can be negative for refunds + // The amount of Telegram Stars that were received by the affiliate; can be negative for refunds StarAmount *StarAmount `json:"star_amount"` } @@ -9480,7 +8108,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 int64 `json:"revenue_star_count"` + RevenueStarCount JsonInt64 `json:"revenue_star_count"` } func (entity *ConnectedAffiliateProgram) MarshalJSON() ([]byte, error) { @@ -9649,7 +8277,7 @@ type PremiumGiftPaymentOption struct { Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // The alternative Telegram Star amount to pay; 0 if payment in Telegram Stars is not possible + // The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible StarCount int64 `json:"star_count"` // The discount associated with this option, as a percentage DiscountPercentage int32 `json:"discount_percentage"` @@ -9759,18 +8387,16 @@ func (*PremiumGiveawayPaymentOptions) GetType() string { // Contains information about a Telegram Premium gift code type PremiumGiftCodeInfo struct { meta - // Identifier of a chat or a user who created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used + // 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 CreatorId MessageSender `json:"creator_id"` // Point in time (Unix timestamp) when the code was created 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; may be 0 or an identifier of a deleted message + // Identifier of the corresponding giveaway message in the creator_id chat; can 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; 0 if the number of months isn't integer + // Number of months the Telegram Premium subscription will be active after code activation 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 @@ -9800,7 +8426,6 @@ 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"` } @@ -9814,7 +8439,6 @@ 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 @@ -9974,8 +8598,6 @@ 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"` } @@ -10021,556 +8643,6 @@ 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 - // The maximum number of times the gifts can be purchased - TotalCount int32 `json:"total_count"` - // Number of remaining times the gift can be purchased - RemainingCount int32 `json:"remaining_count"` -} - -func (entity *GiftPurchaseLimits) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftPurchaseLimits - - return json.Marshal((*stub)(entity)) -} - -func (*GiftPurchaseLimits) GetClass() string { - return ClassGiftPurchaseLimits -} - -func (*GiftPurchaseLimits) GetType() string { - return TypeGiftPurchaseLimits -} - -// Describes parameters of a unique gift available for resale -type GiftResaleParameters struct { - meta - // Resale price of the gift in Telegram Stars - StarCount int64 `json:"star_count"` - // Resale price of the gift in 1/100 of Toncoin - ToncoinCentCount int64 `json:"toncoin_cent_count"` - // True, if the gift can be bought only using Toncoins - ToncoinOnly bool `json:"toncoin_only"` -} - -func (entity *GiftResaleParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftResaleParameters - - return json.Marshal((*stub)(entity)) -} - -func (*GiftResaleParameters) GetClass() string { - return ClassGiftResaleParameters -} - -func (*GiftResaleParameters) GetType() string { - return TypeGiftResaleParameters -} - -// Describes collection of gifts -type GiftCollection struct { - meta - // Unique identifier of the collection - Id int32 `json:"id"` - // Name of the collection - Name string `json:"name"` - // Icon of the collection; may be null if none - Icon *Sticker `json:"icon"` - // Total number of gifts in the collection - GiftCount int32 `json:"gift_count"` -} - -func (entity *GiftCollection) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftCollection - - return json.Marshal((*stub)(entity)) -} - -func (*GiftCollection) GetClass() string { - return ClassGiftCollection -} - -func (*GiftCollection) GetType() string { - return TypeGiftCollection -} - -// Contains a list of gift collections -type GiftCollections struct { - meta - // List of gift collections - Collections []*GiftCollection `json:"collections"` -} - -func (entity *GiftCollections) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftCollections - - return json.Marshal((*stub)(entity)) -} - -func (*GiftCollections) GetClass() string { - return ClassGiftCollections -} - -func (*GiftCollections) GetType() string { - return TypeGiftCollections -} - -// The gift can be sent now by the current user -type CanSendGiftResultOk struct{ - meta -} - -func (entity *CanSendGiftResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CanSendGiftResultOk - - return json.Marshal((*stub)(entity)) -} - -func (*CanSendGiftResultOk) GetClass() string { - return ClassCanSendGiftResult -} - -func (*CanSendGiftResultOk) GetType() string { - return TypeCanSendGiftResultOk -} - -func (*CanSendGiftResultOk) CanSendGiftResultType() string { - return TypeCanSendGiftResultOk -} - -// The gift can't be sent now by the current user -type CanSendGiftResultFail struct { - meta - // Reason to be shown to the user - Reason *FormattedText `json:"reason"` -} - -func (entity *CanSendGiftResultFail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CanSendGiftResultFail - - return json.Marshal((*stub)(entity)) -} - -func (*CanSendGiftResultFail) GetClass() string { - return ClassCanSendGiftResult -} - -func (*CanSendGiftResultFail) GetType() string { - return TypeCanSendGiftResultFail -} - -func (*CanSendGiftResultFail) CanSendGiftResultType() string { - return TypeCanSendGiftResultFail -} - -// 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; may be 0 or an identifier of a deleted message - GiftMessageId int64 `json:"gift_message_id"` -} - -func (entity *UpgradedGiftOriginUpgrade) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginUpgrade - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginUpgrade) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginUpgrade) GetType() string { - return TypeUpgradedGiftOriginUpgrade -} - -func (*UpgradedGiftOriginUpgrade) UpgradedGiftOriginType() string { - return TypeUpgradedGiftOriginUpgrade -} - -// The gift was transferred from another owner -type UpgradedGiftOriginTransfer struct{ - meta -} - -func (entity *UpgradedGiftOriginTransfer) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginTransfer - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginTransfer) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginTransfer) GetType() string { - return TypeUpgradedGiftOriginTransfer -} - -func (*UpgradedGiftOriginTransfer) UpgradedGiftOriginType() string { - return TypeUpgradedGiftOriginTransfer -} - -// The gift was bought from another user -type UpgradedGiftOriginResale struct { - meta - // Price paid for the gift - Price GiftResalePrice `json:"price"` -} - -func (entity *UpgradedGiftOriginResale) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginResale - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginResale) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginResale) GetType() string { - return TypeUpgradedGiftOriginResale -} - -func (*UpgradedGiftOriginResale) UpgradedGiftOriginType() string { - return TypeUpgradedGiftOriginResale -} - -func (upgradedGiftOriginResale *UpgradedGiftOriginResale) 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) - upgradedGiftOriginResale.Price = fieldPrice - - return nil -} - -// 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 -type UpgradedGiftOriginBlockchain struct{ - meta -} - -func (entity *UpgradedGiftOriginBlockchain) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginBlockchain - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginBlockchain) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginBlockchain) GetType() string { - return TypeUpgradedGiftOriginBlockchain -} - -func (*UpgradedGiftOriginBlockchain) UpgradedGiftOriginType() string { - return TypeUpgradedGiftOriginBlockchain -} - -// The sender or receiver of the message has paid for upgraid of the gift, which has been completed -type UpgradedGiftOriginPrepaidUpgrade struct{ - meta -} - -func (entity *UpgradedGiftOriginPrepaidUpgrade) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginPrepaidUpgrade - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginPrepaidUpgrade) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginPrepaidUpgrade) GetType() string { - return TypeUpgradedGiftOriginPrepaidUpgrade -} - -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 -} - -// The gift was crafted from other gifts -type UpgradedGiftOriginCraft struct{ - meta -} - -func (entity *UpgradedGiftOriginCraft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftOriginCraft - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftOriginCraft) GetClass() string { - return ClassUpgradedGiftOrigin -} - -func (*UpgradedGiftOriginCraft) GetType() string { - return TypeUpgradedGiftOriginCraft -} - -func (*UpgradedGiftOriginCraft) UpgradedGiftOriginType() string { - return TypeUpgradedGiftOriginCraft -} - -// The rarity is represented as the numeric frequence of the model -type UpgradedGiftAttributeRarityPerMille struct { - meta - // The number of upgraded gifts that receive this attribute for each 1000 gifts upgraded; if 0, then it can be shown as "<0.1%" - PerMille int32 `json:"per_mille"` -} - -func (entity *UpgradedGiftAttributeRarityPerMille) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeRarityPerMille - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeRarityPerMille) GetClass() string { - return ClassUpgradedGiftAttributeRarity -} - -func (*UpgradedGiftAttributeRarityPerMille) GetType() string { - return TypeUpgradedGiftAttributeRarityPerMille -} - -func (*UpgradedGiftAttributeRarityPerMille) UpgradedGiftAttributeRarityType() string { - return TypeUpgradedGiftAttributeRarityPerMille -} - -// The attribute is uncommon -type UpgradedGiftAttributeRarityUncommon struct{ - meta -} - -func (entity *UpgradedGiftAttributeRarityUncommon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeRarityUncommon - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeRarityUncommon) GetClass() string { - return ClassUpgradedGiftAttributeRarity -} - -func (*UpgradedGiftAttributeRarityUncommon) GetType() string { - return TypeUpgradedGiftAttributeRarityUncommon -} - -func (*UpgradedGiftAttributeRarityUncommon) UpgradedGiftAttributeRarityType() string { - return TypeUpgradedGiftAttributeRarityUncommon -} - -// The attribute is rare -type UpgradedGiftAttributeRarityRare struct{ - meta -} - -func (entity *UpgradedGiftAttributeRarityRare) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeRarityRare - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeRarityRare) GetClass() string { - return ClassUpgradedGiftAttributeRarity -} - -func (*UpgradedGiftAttributeRarityRare) GetType() string { - return TypeUpgradedGiftAttributeRarityRare -} - -func (*UpgradedGiftAttributeRarityRare) UpgradedGiftAttributeRarityType() string { - return TypeUpgradedGiftAttributeRarityRare -} - -// The attribute is epic -type UpgradedGiftAttributeRarityEpic struct{ - meta -} - -func (entity *UpgradedGiftAttributeRarityEpic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeRarityEpic - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeRarityEpic) GetClass() string { - return ClassUpgradedGiftAttributeRarity -} - -func (*UpgradedGiftAttributeRarityEpic) GetType() string { - return TypeUpgradedGiftAttributeRarityEpic -} - -func (*UpgradedGiftAttributeRarityEpic) UpgradedGiftAttributeRarityType() string { - return TypeUpgradedGiftAttributeRarityEpic -} - -// The attribute is legendary -type UpgradedGiftAttributeRarityLegendary struct{ - meta -} - -func (entity *UpgradedGiftAttributeRarityLegendary) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeRarityLegendary - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeRarityLegendary) GetClass() string { - return ClassUpgradedGiftAttributeRarity -} - -func (*UpgradedGiftAttributeRarityLegendary) GetType() string { - return TypeUpgradedGiftAttributeRarityLegendary -} - -func (*UpgradedGiftAttributeRarityLegendary) UpgradedGiftAttributeRarityType() string { - return TypeUpgradedGiftAttributeRarityLegendary -} - // Describes a model of an upgraded gift type UpgradedGiftModel struct { meta @@ -10578,10 +8650,8 @@ type UpgradedGiftModel struct { Name string `json:"name"` // The sticker representing the upgraded gift Sticker *Sticker `json:"sticker"` - // The rarity of the model - Rarity UpgradedGiftAttributeRarity `json:"rarity"` - // True, if the model can be obtained only through gift crafting - IsCrafted bool `json:"is_crafted"` + // The number of upgraded gifts that receive this model for each 1000 gifts upgraded + RarityPerMille int32 `json:"rarity_per_mille"` } func (entity *UpgradedGiftModel) MarshalJSON() ([]byte, error) { @@ -10600,29 +8670,6 @@ func (*UpgradedGiftModel) GetType() string { return TypeUpgradedGiftModel } -func (upgradedGiftModel *UpgradedGiftModel) UnmarshalJSON(data []byte) error { - var tmp struct { - Name string `json:"name"` - Sticker *Sticker `json:"sticker"` - Rarity json.RawMessage `json:"rarity"` - IsCrafted bool `json:"is_crafted"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - upgradedGiftModel.Name = tmp.Name - upgradedGiftModel.Sticker = tmp.Sticker - upgradedGiftModel.IsCrafted = tmp.IsCrafted - - fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) - upgradedGiftModel.Rarity = fieldRarity - - return nil -} - // Describes a symbol shown on the pattern of an upgraded gift type UpgradedGiftSymbol struct { meta @@ -10630,8 +8677,8 @@ type UpgradedGiftSymbol struct { Name string `json:"name"` // The sticker representing the symbol Sticker *Sticker `json:"sticker"` - // The rarity of the symbol - Rarity UpgradedGiftAttributeRarity `json:"rarity"` + // The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded + RarityPerMille int32 `json:"rarity_per_mille"` } func (entity *UpgradedGiftSymbol) MarshalJSON() ([]byte, error) { @@ -10650,27 +8697,6 @@ func (*UpgradedGiftSymbol) GetType() string { return TypeUpgradedGiftSymbol } -func (upgradedGiftSymbol *UpgradedGiftSymbol) UnmarshalJSON(data []byte) error { - var tmp struct { - Name string `json:"name"` - Sticker *Sticker `json:"sticker"` - Rarity json.RawMessage `json:"rarity"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - upgradedGiftSymbol.Name = tmp.Name - upgradedGiftSymbol.Sticker = tmp.Sticker - - fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) - upgradedGiftSymbol.Rarity = fieldRarity - - return nil -} - // Describes colors of a backdrop of an upgraded gift type UpgradedGiftBackdropColors struct { meta @@ -10703,14 +8729,12 @@ func (*UpgradedGiftBackdropColors) GetType() string { // Describes a backdrop of an upgraded gift type UpgradedGiftBackdrop struct { meta - // Unique identifier of the backdrop - Id int32 `json:"id"` // Name of the backdrop Name string `json:"name"` // Colors of the backdrop Colors *UpgradedGiftBackdropColors `json:"colors"` - // The rarity of the backdrop - Rarity UpgradedGiftAttributeRarity `json:"rarity"` + // The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded + RarityPerMille int32 `json:"rarity_per_mille"` } func (entity *UpgradedGiftBackdrop) MarshalJSON() ([]byte, error) { @@ -10729,29 +8753,6 @@ func (*UpgradedGiftBackdrop) GetType() string { return TypeUpgradedGiftBackdrop } -func (upgradedGiftBackdrop *UpgradedGiftBackdrop) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int32 `json:"id"` - Name string `json:"name"` - Colors *UpgradedGiftBackdropColors `json:"colors"` - Rarity json.RawMessage `json:"rarity"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - upgradedGiftBackdrop.Id = tmp.Id - upgradedGiftBackdrop.Name = tmp.Name - upgradedGiftBackdrop.Colors = tmp.Colors - - fieldRarity, _ := UnmarshalUpgradedGiftAttributeRarity(tmp.Rarity) - upgradedGiftBackdrop.Rarity = fieldRarity - - return nil -} - // Describes the original details about the gift type UpgradedGiftOriginalDetails struct { meta @@ -10806,48 +8807,11 @@ func (upgradedGiftOriginalDetails *UpgradedGiftOriginalDetails) UnmarshalJSON(da return nil } -// Contains information about color scheme for user's name, background of empty chat photo, replies to messages and link previews -type UpgradedGiftColors struct { - meta - // Unique identifier of the upgraded gift colors - Id JsonInt64 `json:"id"` - // Custom emoji identifier of the model of the upgraded gift - ModelCustomEmojiId JsonInt64 `json:"model_custom_emoji_id"` - // Custom emoji identifier of the symbol of the upgraded gift - SymbolCustomEmojiId JsonInt64 `json:"symbol_custom_emoji_id"` - // Accent color to use in light themes in RGB format - LightThemeAccentColor int32 `json:"light_theme_accent_color"` - // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes - LightThemeColors []int32 `json:"light_theme_colors"` - // Accent color to use in dark themes in RGB format - DarkThemeAccentColor int32 `json:"dark_theme_accent_color"` - // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes - DarkThemeColors []int32 `json:"dark_theme_colors"` -} - -func (entity *UpgradedGiftColors) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftColors - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftColors) GetClass() string { - return ClassUpgradedGiftColors -} - -func (*UpgradedGiftColors) GetType() string { - return TypeUpgradedGiftColors -} - // Describes a gift that can be sent to another user or channel chat type Gift struct { meta // Unique identifier of the gift Id JsonInt64 `json:"id"` - // Identifier of the chat that published the gift; 0 if none - PublisherChatId int64 `json:"publisher_chat_id"` // The sticker representing the gift Sticker *Sticker `json:"sticker"` // Number of Telegram Stars that must be paid for the gift @@ -10856,24 +8820,12 @@ 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"` - // 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"` + // Number of remaining times the gift can be purchased; 0 if not limited or the gift was sold out + RemainingCount int32 `json:"remaining_count"` + // Number of total times the gift can be purchased; 0 if not limited + TotalCount int32 `json:"total_count"` // 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 @@ -10896,18 +8848,37 @@ func (*Gift) GetType() string { return TypeGift } +// Contains a list of gifts that can be sent to another user or channel chat +type Gifts struct { + meta + // The list of gifts + Gifts []*Gift `json:"gifts"` +} + +func (entity *Gifts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Gifts + + return json.Marshal((*stub)(entity)) +} + +func (*Gifts) GetClass() string { + return ClassGifts +} + +func (*Gifts) GetType() string { + return TypeGifts +} + // Describes an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT type UpgradedGift struct { meta // Unique identifier of the gift Id JsonInt64 `json:"id"` - // Unique identifier of the regular gift from which the gift was upgraded; may be 0 for short period of time for old gifts from database - RegularGiftId JsonInt64 `json:"regular_gift_id"` - // Identifier of the chat that published the gift; 0 if none - PublisherChatId int64 `json:"publisher_chat_id"` // The title of the upgraded gift Title string `json:"title"` - // Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift or sendResoldGift + // Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift Name string `json:"name"` // Unique number of the upgraded gift among gifts upgraded from the same gift Number int32 `json:"number"` @@ -10915,18 +8886,6 @@ type UpgradedGift struct { TotalUpgradedCount int32 `json:"total_upgraded_count"` // The maximum number of gifts that can be upgraded from the same gift MaxUpgradedCount int32 `json:"max_upgraded_count"` - // True, if the gift was used to craft another gift - IsBurned bool `json:"is_burned"` - // True, if the gift was craft from another gifts - IsCrafted bool `json:"is_crafted"` - // True, if the original gift could have been bought only by Telegram Premium subscribers - IsPremium bool `json:"is_premium"` - // True, if the gift can be used to set a theme in a chat - IsThemeAvailable bool `json:"is_theme_available"` - // Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn't owned by the current user - UsedThemeChatId int64 `json:"used_theme_chat_id"` - // Identifier of the user or the chat to which the upgraded gift was assigned from blockchain; may be null if none or unknown - HostId MessageSender `json:"host_id"` // Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown OwnerId MessageSender `json:"owner_id"` // Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address @@ -10943,20 +8902,6 @@ type UpgradedGift struct { Backdrop *UpgradedGiftBackdrop `json:"backdrop"` // Information about the originally sent gift; may be null if unknown OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` - // Colors that can be set for user's name, background of empty chat photo, replies to messages and link previews; may be null if none or unknown - Colors *UpgradedGiftColors `json:"colors"` - // Resale parameters of the gift; may be null if resale isn't possible - ResaleParameters *GiftResaleParameters `json:"resale_parameters"` - // True, if an offer to purchase the gift can be sent using sendGiftPurchaseOffer - CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` - // Probability that the gift adds to the chance of successful crafting of a new gift; 0 if the gift can't be used for crafting - CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` - // ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable - ValueCurrency string `json:"value_currency"` - // Estimated value of the gift; in the smallest units of the currency; 0 if unavailable - 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) { @@ -10978,19 +8923,11 @@ func (*UpgradedGift) GetType() string { func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { var tmp struct { Id JsonInt64 `json:"id"` - RegularGiftId JsonInt64 `json:"regular_gift_id"` - PublisherChatId int64 `json:"publisher_chat_id"` Title string `json:"title"` Name string `json:"name"` Number int32 `json:"number"` TotalUpgradedCount int32 `json:"total_upgraded_count"` MaxUpgradedCount int32 `json:"max_upgraded_count"` - IsBurned bool `json:"is_burned"` - IsCrafted bool `json:"is_crafted"` - IsPremium bool `json:"is_premium"` - IsThemeAvailable bool `json:"is_theme_available"` - UsedThemeChatId int64 `json:"used_theme_chat_id"` - HostId json.RawMessage `json:"host_id"` OwnerId json.RawMessage `json:"owner_id"` OwnerAddress string `json:"owner_address"` OwnerName string `json:"owner_name"` @@ -10999,13 +8936,6 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { Symbol *UpgradedGiftSymbol `json:"symbol"` Backdrop *UpgradedGiftBackdrop `json:"backdrop"` OriginalDetails *UpgradedGiftOriginalDetails `json:"original_details"` - Colors *UpgradedGiftColors `json:"colors"` - ResaleParameters *GiftResaleParameters `json:"resale_parameters"` - CanSendPurchaseOffer bool `json:"can_send_purchase_offer"` - CraftProbabilityPerMille int32 `json:"craft_probability_per_mille"` - ValueCurrency string `json:"value_currency"` - ValueAmount int64 `json:"value_amount"` - ValueUsdAmount int64 `json:"value_usd_amount"` } err := json.Unmarshal(data, &tmp) @@ -11014,18 +8944,11 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { } upgradedGift.Id = tmp.Id - upgradedGift.RegularGiftId = tmp.RegularGiftId - upgradedGift.PublisherChatId = tmp.PublisherChatId upgradedGift.Title = tmp.Title upgradedGift.Name = tmp.Name upgradedGift.Number = tmp.Number upgradedGift.TotalUpgradedCount = tmp.TotalUpgradedCount upgradedGift.MaxUpgradedCount = tmp.MaxUpgradedCount - upgradedGift.IsBurned = tmp.IsBurned - upgradedGift.IsCrafted = tmp.IsCrafted - upgradedGift.IsPremium = tmp.IsPremium - upgradedGift.IsThemeAvailable = tmp.IsThemeAvailable - upgradedGift.UsedThemeChatId = tmp.UsedThemeChatId upgradedGift.OwnerAddress = tmp.OwnerAddress upgradedGift.OwnerName = tmp.OwnerName upgradedGift.GiftAddress = tmp.GiftAddress @@ -11033,16 +8956,6 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { upgradedGift.Symbol = tmp.Symbol upgradedGift.Backdrop = tmp.Backdrop upgradedGift.OriginalDetails = tmp.OriginalDetails - upgradedGift.Colors = tmp.Colors - upgradedGift.ResaleParameters = tmp.ResaleParameters - upgradedGift.CanSendPurchaseOffer = tmp.CanSendPurchaseOffer - upgradedGift.CraftProbabilityPerMille = tmp.CraftProbabilityPerMille - upgradedGift.ValueCurrency = tmp.ValueCurrency - upgradedGift.ValueAmount = tmp.ValueAmount - upgradedGift.ValueUsdAmount = tmp.ValueUsdAmount - - fieldHostId, _ := UnmarshalMessageSender(tmp.HostId) - upgradedGift.HostId = fieldHostId fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) upgradedGift.OwnerId = fieldOwnerId @@ -11050,55 +8963,6 @@ func (upgradedGift *UpgradedGift) UnmarshalJSON(data []byte) error { return nil } -// Contains information about value of an upgraded gift -type UpgradedGiftValueInfo struct { - meta - // ISO 4217 currency code of the currency in which the prices are represented - Currency string `json:"currency"` - // Estimated value of the gift; in the smallest units of the currency - Value int64 `json:"value"` - // True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift - IsValueAverage bool `json:"is_value_average"` - // Point in time (Unix timestamp) when the corresponding regular gift was originally purchased - InitialSaleDate int32 `json:"initial_sale_date"` - // The Telegram Star amount that was paid for the gift - InitialSaleStarCount int64 `json:"initial_sale_star_count"` - // Initial price of the gift; in the smallest units of the currency - InitialSalePrice int64 `json:"initial_sale_price"` - // Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never - LastSaleDate int32 `json:"last_sale_date"` - // Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold - LastSalePrice int64 `json:"last_sale_price"` - // True, if the last sale was completed on Fragment - IsLastSaleOnFragment bool `json:"is_last_sale_on_fragment"` - // The current minimum price of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there are no such gifts - MinimumPrice int64 `json:"minimum_price"` - // The average sale price in the last month of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there were no such sales - AverageSalePrice int64 `json:"average_sale_price"` - // Number of gifts upgraded from the same gift being resold on Telegram - TelegramListedGiftCount int32 `json:"telegram_listed_gift_count"` - // Number of gifts upgraded from the same gift being resold on Fragment - FragmentListedGiftCount int32 `json:"fragment_listed_gift_count"` - // The HTTPS link to the Fragment for the gift; may be empty if there are no such gifts being sold on Fragment - FragmentUrl string `json:"fragment_url"` -} - -func (entity *UpgradedGiftValueInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftValueInfo - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftValueInfo) GetClass() string { - return ClassUpgradedGiftValueInfo -} - -func (*UpgradedGiftValueInfo) GetType() string { - return TypeUpgradedGiftValueInfo -} - // Contains result of gift upgrading type UpgradeGiftResult struct { meta @@ -11112,13 +8976,7 @@ type UpgradeGiftResult struct { CanBeTransferred bool `json:"can_be_transferred"` // Number of Telegram Stars that must be paid to transfer the upgraded gift TransferStarCount int64 `json:"transfer_star_count"` - // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available - DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible - NextTransferDate int32 `json:"next_transfer_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 - NextResaleDate int32 `json:"next_resale_date"` - // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past + // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT ExportDate int32 `json:"export_date"` } @@ -11138,548 +8996,6 @@ func (*UpgradeGiftResult) GetType() string { return TypeUpgradeGiftResult } -// Crafting was successful -type CraftGiftResultSuccess struct { - meta - // The created gift - Gift *UpgradedGift `json:"gift"` - // Unique identifier of the received gift for the current user - ReceivedGiftId string `json:"received_gift_id"` -} - -func (entity *CraftGiftResultSuccess) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CraftGiftResultSuccess - - return json.Marshal((*stub)(entity)) -} - -func (*CraftGiftResultSuccess) GetClass() string { - return ClassCraftGiftResult -} - -func (*CraftGiftResultSuccess) GetType() string { - return TypeCraftGiftResultSuccess -} - -func (*CraftGiftResultSuccess) CraftGiftResultType() string { - return TypeCraftGiftResultSuccess -} - -// Crafting isn't possible because one of the gifts can't be used for crafting yet -type CraftGiftResultTooEarly struct { - meta - // Time left before the gift can be used for crafting - RetryAfter int32 `json:"retry_after"` -} - -func (entity *CraftGiftResultTooEarly) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CraftGiftResultTooEarly - - return json.Marshal((*stub)(entity)) -} - -func (*CraftGiftResultTooEarly) GetClass() string { - return ClassCraftGiftResult -} - -func (*CraftGiftResultTooEarly) GetType() string { - return TypeCraftGiftResultTooEarly -} - -func (*CraftGiftResultTooEarly) CraftGiftResultType() string { - return TypeCraftGiftResultTooEarly -} - -// Crafting isn't possible because one of the gifts isn't suitable for crafting -type CraftGiftResultInvalidGift struct{ - meta -} - -func (entity *CraftGiftResultInvalidGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CraftGiftResultInvalidGift - - return json.Marshal((*stub)(entity)) -} - -func (*CraftGiftResultInvalidGift) GetClass() string { - return ClassCraftGiftResult -} - -func (*CraftGiftResultInvalidGift) GetType() string { - return TypeCraftGiftResultInvalidGift -} - -func (*CraftGiftResultInvalidGift) CraftGiftResultType() string { - return TypeCraftGiftResultInvalidGift -} - -// Crafting has failed -type CraftGiftResultFail struct{ - meta -} - -func (entity *CraftGiftResultFail) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub CraftGiftResultFail - - return json.Marshal((*stub)(entity)) -} - -func (*CraftGiftResultFail) GetClass() string { - return ClassCraftGiftResult -} - -func (*CraftGiftResultFail) GetType() string { - return TypeCraftGiftResultFail -} - -func (*CraftGiftResultFail) CraftGiftResultType() string { - return TypeCraftGiftResultFail -} - -// Describes a gift that is available for purchase -type AvailableGift struct { - meta - // The gift - Gift *Gift `json:"gift"` - // Number of gifts that are available for resale - ResaleCount int32 `json:"resale_count"` - // The minimum price for the gifts available for resale in Telegram Star equivalent; 0 if there are no such gifts - MinResaleStarCount int64 `json:"min_resale_star_count"` - // The title of the upgraded gift; empty if the gift isn't available for resale - Title string `json:"title"` -} - -func (entity *AvailableGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AvailableGift - - return json.Marshal((*stub)(entity)) -} - -func (*AvailableGift) GetClass() string { - return ClassAvailableGift -} - -func (*AvailableGift) GetType() string { - return TypeAvailableGift -} - -// Contains a list of gifts that can be sent to another user or channel chat -type AvailableGifts struct { - meta - // The list of gifts - Gifts []*AvailableGift `json:"gifts"` -} - -func (entity *AvailableGifts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AvailableGifts - - return json.Marshal((*stub)(entity)) -} - -func (*AvailableGifts) GetClass() string { - return ClassAvailableGifts -} - -func (*AvailableGifts) GetType() string { - return TypeAvailableGifts -} - -// Describes a price required to pay to upgrade a gift -type GiftUpgradePrice struct { - meta - // Point in time (Unix timestamp) when the price will be in effect - Date int32 `json:"date"` - // The Telegram Star amount required to pay to upgrade the gift - StarCount int64 `json:"star_count"` -} - -func (entity *GiftUpgradePrice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftUpgradePrice - - return json.Marshal((*stub)(entity)) -} - -func (*GiftUpgradePrice) GetClass() string { - return ClassGiftUpgradePrice -} - -func (*GiftUpgradePrice) GetType() string { - return TypeGiftUpgradePrice -} - -// Identifier of a gift model -type UpgradedGiftAttributeIdModel struct { - meta - // Identifier of the sticker representing the model - StickerId JsonInt64 `json:"sticker_id"` -} - -func (entity *UpgradedGiftAttributeIdModel) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeIdModel - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeIdModel) GetClass() string { - return ClassUpgradedGiftAttributeId -} - -func (*UpgradedGiftAttributeIdModel) GetType() string { - return TypeUpgradedGiftAttributeIdModel -} - -func (*UpgradedGiftAttributeIdModel) UpgradedGiftAttributeIdType() string { - return TypeUpgradedGiftAttributeIdModel -} - -// Identifier of a gift symbol -type UpgradedGiftAttributeIdSymbol struct { - meta - // Identifier of the sticker representing the symbol - StickerId JsonInt64 `json:"sticker_id"` -} - -func (entity *UpgradedGiftAttributeIdSymbol) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeIdSymbol - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeIdSymbol) GetClass() string { - return ClassUpgradedGiftAttributeId -} - -func (*UpgradedGiftAttributeIdSymbol) GetType() string { - return TypeUpgradedGiftAttributeIdSymbol -} - -func (*UpgradedGiftAttributeIdSymbol) UpgradedGiftAttributeIdType() string { - return TypeUpgradedGiftAttributeIdSymbol -} - -// Identifier of a gift backdrop -type UpgradedGiftAttributeIdBackdrop struct { - meta - // Identifier of the backdrop - BackdropId int32 `json:"backdrop_id"` -} - -func (entity *UpgradedGiftAttributeIdBackdrop) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftAttributeIdBackdrop - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftAttributeIdBackdrop) GetClass() string { - return ClassUpgradedGiftAttributeId -} - -func (*UpgradedGiftAttributeIdBackdrop) GetType() string { - return TypeUpgradedGiftAttributeIdBackdrop -} - -func (*UpgradedGiftAttributeIdBackdrop) UpgradedGiftAttributeIdType() string { - return TypeUpgradedGiftAttributeIdBackdrop -} - -// Describes a model of an upgraded gift with the number of gifts found -type UpgradedGiftModelCount struct { - meta - // The model - Model *UpgradedGiftModel `json:"model"` - // Total number of gifts with the model - TotalCount int32 `json:"total_count"` -} - -func (entity *UpgradedGiftModelCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftModelCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftModelCount) GetClass() string { - return ClassUpgradedGiftModelCount -} - -func (*UpgradedGiftModelCount) GetType() string { - return TypeUpgradedGiftModelCount -} - -// Describes a symbol shown on the pattern of an upgraded gift -type UpgradedGiftSymbolCount struct { - meta - // The symbol - Symbol *UpgradedGiftSymbol `json:"symbol"` - // Total number of gifts with the symbol - TotalCount int32 `json:"total_count"` -} - -func (entity *UpgradedGiftSymbolCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftSymbolCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftSymbolCount) GetClass() string { - return ClassUpgradedGiftSymbolCount -} - -func (*UpgradedGiftSymbolCount) GetType() string { - return TypeUpgradedGiftSymbolCount -} - -// Describes a backdrop of an upgraded gift -type UpgradedGiftBackdropCount struct { - meta - // The backdrop - Backdrop *UpgradedGiftBackdrop `json:"backdrop"` - // Total number of gifts with the symbol - TotalCount int32 `json:"total_count"` -} - -func (entity *UpgradedGiftBackdropCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpgradedGiftBackdropCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpgradedGiftBackdropCount) GetClass() string { - return ClassUpgradedGiftBackdropCount -} - -func (*UpgradedGiftBackdropCount) GetType() string { - return TypeUpgradedGiftBackdropCount -} - -// The gifts will be sorted by their price from the lowest to the highest -type GiftForResaleOrderPrice struct{ - meta -} - -func (entity *GiftForResaleOrderPrice) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftForResaleOrderPrice - - return json.Marshal((*stub)(entity)) -} - -func (*GiftForResaleOrderPrice) GetClass() string { - return ClassGiftForResaleOrder -} - -func (*GiftForResaleOrderPrice) GetType() string { - return TypeGiftForResaleOrderPrice -} - -func (*GiftForResaleOrderPrice) GiftForResaleOrderType() string { - return TypeGiftForResaleOrderPrice -} - -// The gifts will be sorted by the last date when their price was changed from the newest to the oldest -type GiftForResaleOrderPriceChangeDate struct{ - meta -} - -func (entity *GiftForResaleOrderPriceChangeDate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftForResaleOrderPriceChangeDate - - return json.Marshal((*stub)(entity)) -} - -func (*GiftForResaleOrderPriceChangeDate) GetClass() string { - return ClassGiftForResaleOrder -} - -func (*GiftForResaleOrderPriceChangeDate) GetType() string { - return TypeGiftForResaleOrderPriceChangeDate -} - -func (*GiftForResaleOrderPriceChangeDate) GiftForResaleOrderType() string { - return TypeGiftForResaleOrderPriceChangeDate -} - -// The gifts will be sorted by their number from the smallest to the largest -type GiftForResaleOrderNumber struct{ - meta -} - -func (entity *GiftForResaleOrderNumber) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftForResaleOrderNumber - - return json.Marshal((*stub)(entity)) -} - -func (*GiftForResaleOrderNumber) GetClass() string { - return ClassGiftForResaleOrder -} - -func (*GiftForResaleOrderNumber) GetType() string { - return TypeGiftForResaleOrderNumber -} - -func (*GiftForResaleOrderNumber) GiftForResaleOrderType() string { - return TypeGiftForResaleOrderNumber -} - -// Describes a gift available for resale -type GiftForResale struct { - meta - // The gift - Gift *UpgradedGift `json:"gift"` - // Unique identifier of the received gift for the current user; only for the gifts owned by the current user - ReceivedGiftId string `json:"received_gift_id"` -} - -func (entity *GiftForResale) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftForResale - - return json.Marshal((*stub)(entity)) -} - -func (*GiftForResale) GetClass() string { - return ClassGiftForResale -} - -func (*GiftForResale) GetType() string { - return TypeGiftForResale -} - -// Describes gifts available for resale -type GiftsForResale struct { - meta - // Total number of gifts found - TotalCount int32 `json:"total_count"` - // The gifts - Gifts []*GiftForResale `json:"gifts"` - // Available models; for searchGiftsForResale requests without offset and attributes only - Models []*UpgradedGiftModelCount `json:"models"` - // Available symbols; for searchGiftsForResale requests without offset and attributes only - Symbols []*UpgradedGiftSymbolCount `json:"symbols"` - // Available backdrops; for searchGiftsForResale requests without offset and attributes only - Backdrops []*UpgradedGiftBackdropCount `json:"backdrops"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *GiftsForResale) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftsForResale - - return json.Marshal((*stub)(entity)) -} - -func (*GiftsForResale) GetClass() string { - return ClassGiftsForResale -} - -func (*GiftsForResale) GetType() string { - return TypeGiftsForResale -} - -// Operation was successfully completed -type GiftResaleResultOk struct { - meta - // Unique identifier of the received gift; only for the gifts sent to the current user - ReceivedGiftId string `json:"received_gift_id"` -} - -func (entity *GiftResaleResultOk) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftResaleResultOk - - return json.Marshal((*stub)(entity)) -} - -func (*GiftResaleResultOk) GetClass() string { - return ClassGiftResaleResult -} - -func (*GiftResaleResultOk) GetType() string { - return TypeGiftResaleResultOk -} - -func (*GiftResaleResultOk) GiftResaleResultType() string { - return TypeGiftResaleResultOk -} - -// Operation has failed, because price has increased. If the price has decreased, then the buying will succeed anyway -type GiftResaleResultPriceIncreased struct { - meta - // New price for the gift - Price GiftResalePrice `json:"price"` -} - -func (entity *GiftResaleResultPriceIncreased) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftResaleResultPriceIncreased - - return json.Marshal((*stub)(entity)) -} - -func (*GiftResaleResultPriceIncreased) GetClass() string { - return ClassGiftResaleResult -} - -func (*GiftResaleResultPriceIncreased) GetType() string { - return TypeGiftResaleResultPriceIncreased -} - -func (*GiftResaleResultPriceIncreased) GiftResaleResultType() string { - return TypeGiftResaleResultPriceIncreased -} - -func (giftResaleResultPriceIncreased *GiftResaleResultPriceIncreased) 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) - giftResaleResultPriceIncreased.Price = fieldPrice - - return nil -} - // Regular gift type SentGiftRegular struct { meta @@ -11743,8 +9059,6 @@ 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 @@ -11761,28 +9075,14 @@ type ReceivedGift struct { Date int32 `json:"date"` // The gift Gift SentGift `json:"gift"` - // Identifiers of collections to which the gift is added; only for the receiver of the gift - CollectionIds []int32 `json:"collection_ids"` // 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 current user 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"` // Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift TransferStarCount int64 `json:"transfer_star_count"` - // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available; only for the receiver of the gift - DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift - NextTransferDate int32 `json:"next_transfer_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 - NextResaleDate int32 `json:"next_resale_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 + // Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` - // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade - PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift - CraftDate int32 `json:"craft_date"` } func (entity *ReceivedGift) MarshalJSON() ([]byte, error) { @@ -11806,7 +9106,6 @@ 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"` @@ -11815,17 +9114,10 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { WasRefunded bool `json:"was_refunded"` Date int32 `json:"date"` Gift json.RawMessage `json:"gift"` - CollectionIds []int32 `json:"collection_ids"` SellStarCount int64 `json:"sell_star_count"` PrepaidUpgradeStarCount int64 `json:"prepaid_upgrade_star_count"` - IsUpgradeSeparate bool `json:"is_upgrade_separate"` TransferStarCount int64 `json:"transfer_star_count"` - DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` - NextTransferDate int32 `json:"next_transfer_date"` - NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` - PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` - CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -11835,7 +9127,6 @@ 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 @@ -11843,17 +9134,10 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error { receivedGift.CanBeTransferred = tmp.CanBeTransferred receivedGift.WasRefunded = tmp.WasRefunded receivedGift.Date = tmp.Date - receivedGift.CollectionIds = tmp.CollectionIds receivedGift.SellStarCount = tmp.SellStarCount receivedGift.PrepaidUpgradeStarCount = tmp.PrepaidUpgradeStarCount - receivedGift.IsUpgradeSeparate = tmp.IsUpgradeSeparate receivedGift.TransferStarCount = tmp.TransferStarCount - receivedGift.DropOriginalDetailsStarCount = tmp.DropOriginalDetailsStarCount - receivedGift.NextTransferDate = tmp.NextTransferDate - receivedGift.NextResaleDate = tmp.NextResaleDate receivedGift.ExportDate = tmp.ExportDate - receivedGift.PrepaidUpgradeHash = tmp.PrepaidUpgradeHash - receivedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) receivedGift.SenderId = fieldSenderId @@ -11893,58 +9177,6 @@ func (*ReceivedGifts) GetType() string { return TypeReceivedGifts } -// Describes chance of the crafted gift to have the backdrop or symbol of one of the original gifts -type AttributeCraftPersistenceProbability struct { - meta - // The 4 numbers that describe probability of the craft result to have the same attribute as one of the original gifts if 1, 2, 3, or 4 gifts with the attribute are used in the craft. Each number represents the number of crafted gifts with the original attribute per 1000 successful craftings - PersistenceChancePerMille []int32 `json:"persistence_chance_per_mille"` -} - -func (entity *AttributeCraftPersistenceProbability) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AttributeCraftPersistenceProbability - - return json.Marshal((*stub)(entity)) -} - -func (*AttributeCraftPersistenceProbability) GetClass() string { - return ClassAttributeCraftPersistenceProbability -} - -func (*AttributeCraftPersistenceProbability) GetType() string { - return TypeAttributeCraftPersistenceProbability -} - -// Represents a list of gifts received by a user or a chat -type GiftsForCrafting struct { - meta - // The total number of received gifts - TotalCount int32 `json:"total_count"` - // The list of gifts - Gifts []*ReceivedGift `json:"gifts"` - // The 4 objects that describe probabilities of the crafted gift to have the backdrop or symbol of one of the original gifts for the cases when 1, 2, 3 or 4 gifts are used in the craft correspondingly - AttributePersistenceProbabilities []*AttributeCraftPersistenceProbability `json:"attribute_persistence_probabilities"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *GiftsForCrafting) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftsForCrafting - - return json.Marshal((*stub)(entity)) -} - -func (*GiftsForCrafting) GetClass() string { - return ClassGiftsForCrafting -} - -func (*GiftsForCrafting) GetType() string { - return TypeGiftsForCrafting -} - // Contains examples of possible upgraded gifts for the given regular gift type GiftUpgradePreview struct { meta @@ -11954,10 +9186,6 @@ type GiftUpgradePreview struct { Symbols []*UpgradedGiftSymbol `json:"symbols"` // Examples of possible backdrops that can be chosen for the gift after upgrade Backdrops []*UpgradedGiftBackdrop `json:"backdrops"` - // Examples of price for gift upgrade from the maximum price to the minimum price - Prices []*GiftUpgradePrice `json:"prices"` - // Next changes for the price for gift upgrade with more granularity than in prices - NextPrices []*GiftUpgradePrice `json:"next_prices"` } func (entity *GiftUpgradePreview) MarshalJSON() ([]byte, error) { @@ -11976,421 +9204,57 @@ func (*GiftUpgradePreview) GetType() string { return TypeGiftUpgradePreview } -// Contains all possible variants of upgraded gifts for the given regular gift -type GiftUpgradeVariants struct { +// The transaction is incoming and increases the number of owned Telegram Stars +type StarTransactionDirectionIncoming 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) { +func (entity *StarTransactionDirectionIncoming) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub GiftUpgradeVariants + type stub StarTransactionDirectionIncoming return json.Marshal((*stub)(entity)) } -func (*GiftUpgradeVariants) GetClass() string { - return ClassGiftUpgradeVariants +func (*StarTransactionDirectionIncoming) GetClass() string { + return ClassStarTransactionDirection } -func (*GiftUpgradeVariants) GetType() string { - return TypeGiftUpgradeVariants +func (*StarTransactionDirectionIncoming) GetType() string { + return TypeStarTransactionDirectionIncoming } -// Describes a bid in an auction -type AuctionBid struct { +func (*StarTransactionDirectionIncoming) StarTransactionDirectionType() string { + return TypeStarTransactionDirectionIncoming +} + +// The transaction is outgoing and decreases the number of owned Telegram Stars +type StarTransactionDirectionOutgoing 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) { +func (entity *StarTransactionDirectionOutgoing) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub AuctionBid + type stub StarTransactionDirectionOutgoing return json.Marshal((*stub)(entity)) } -func (*AuctionBid) GetClass() string { - return ClassAuctionBid +func (*StarTransactionDirectionOutgoing) GetClass() string { + return ClassStarTransactionDirection } -func (*AuctionBid) GetType() string { - return TypeAuctionBid +func (*StarTransactionDirectionOutgoing) GetType() string { + return TypeStarTransactionDirectionOutgoing } -// 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 (*StarTransactionDirectionOutgoing) StarTransactionDirectionType() string { + return TypeStarTransactionDirectionOutgoing } -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 -} - -func (entity *TransactionDirectionIncoming) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TransactionDirectionIncoming - - return json.Marshal((*stub)(entity)) -} - -func (*TransactionDirectionIncoming) GetClass() string { - return ClassTransactionDirection -} - -func (*TransactionDirectionIncoming) GetType() string { - return TypeTransactionDirectionIncoming -} - -func (*TransactionDirectionIncoming) TransactionDirectionType() string { - return TypeTransactionDirectionIncoming -} - -// The transaction is outgoing and decreases the amount of owned currency -type TransactionDirectionOutgoing struct{ - meta -} - -func (entity *TransactionDirectionOutgoing) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TransactionDirectionOutgoing - - return json.Marshal((*stub)(entity)) -} - -func (*TransactionDirectionOutgoing) GetClass() string { - return ClassTransactionDirection -} - -func (*TransactionDirectionOutgoing) GetType() string { - return TypeTransactionDirectionOutgoing -} - -func (*TransactionDirectionOutgoing) TransactionDirectionType() string { - return TypeTransactionDirectionOutgoing -} - -// The transaction is a deposit of Telegram Stars from the Premium bot; relevant for regular users only +// The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only type StarTransactionTypePremiumBotDeposit struct{ meta } @@ -12415,7 +9279,7 @@ func (*StarTransactionTypePremiumBotDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumBotDeposit } -// The transaction is a deposit of Telegram Stars from App Store; relevant for regular users only +// The transaction is a deposit of Telegram Stars from App Store; for regular users only type StarTransactionTypeAppStoreDeposit struct{ meta } @@ -12440,7 +9304,7 @@ func (*StarTransactionTypeAppStoreDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeAppStoreDeposit } -// The transaction is a deposit of Telegram Stars from Google Play; relevant for regular users only +// The transaction is a deposit of Telegram Stars from Google Play; for regular users only type StarTransactionTypeGooglePlayDeposit struct{ meta } @@ -12465,7 +9329,7 @@ func (*StarTransactionTypeGooglePlayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGooglePlayDeposit } -// The transaction is a deposit of Telegram Stars from Fragment; relevant for regular users and bots only +// The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only type StarTransactionTypeFragmentDeposit struct{ meta } @@ -12490,10 +9354,10 @@ func (*StarTransactionTypeFragmentDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeFragmentDeposit } -// The transaction is a deposit of Telegram Stars by another user; relevant for regular users only +// The transaction is a deposit of Telegram Stars by another user; for regular users only type StarTransactionTypeUserDeposit struct { meta - // Identifier of the user who gifted Telegram Stars; 0 if the user was anonymous + // Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous UserId int64 `json:"user_id"` // The sticker to be shown in the transaction information; may be null if unknown Sticker *Sticker `json:"sticker"` @@ -12519,12 +9383,12 @@ func (*StarTransactionTypeUserDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeUserDeposit } -// The transaction is a deposit of Telegram Stars from a giveaway; relevant for regular users only +// The transaction is a deposit of Telegram Stars from a giveaway; 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; may be 0 or an identifier of a deleted message + // Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message GiveawayMessageId int64 `json:"giveaway_message_id"` } @@ -12548,7 +9412,7 @@ func (*StarTransactionTypeGiveawayDeposit) StarTransactionTypeType() string { return TypeStarTransactionTypeGiveawayDeposit } -// The transaction is a withdrawal of earned Telegram Stars to Fragment; relevant for regular users, bots, supergroup and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only type StarTransactionTypeFragmentWithdrawal struct { meta // State of the withdrawal; may be null for refunds from Fragment @@ -12591,7 +9455,7 @@ func (starTransactionTypeFragmentWithdrawal *StarTransactionTypeFragmentWithdraw return nil } -// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; relevant for bots and channel chats only +// The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only type StarTransactionTypeTelegramAdsWithdrawal struct{ meta } @@ -12616,7 +9480,7 @@ func (*StarTransactionTypeTelegramAdsWithdrawal) StarTransactionTypeType() strin return TypeStarTransactionTypeTelegramAdsWithdrawal } -// The transaction is a payment for Telegram API usage; relevant for bots only +// The transaction is a payment for Telegram API usage; for bots only type StarTransactionTypeTelegramApiUsage struct { meta // The number of billed requests @@ -12643,10 +9507,10 @@ 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; relevant for regular users only +// The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only type StarTransactionTypeBotPaidMediaPurchase struct { meta - // Identifier of the bot or the business account user who sent the paid media + // Identifier of the bot or the business account user that sent the paid media UserId int64 `json:"user_id"` // The bought media if the transaction wasn't refunded Media []PaidMedia `json:"media"` @@ -12691,10 +9555,10 @@ func (starTransactionTypeBotPaidMediaPurchase *StarTransactionTypeBotPaidMediaPu return nil } -// The transaction is a sale of paid media by the bot or a business account managed by the bot; relevant for bots only +// The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only type StarTransactionTypeBotPaidMediaSale struct { meta - // Identifier of the user who bought the media + // Identifier of the user that bought the media UserId int64 `json:"user_id"` // The bought media Media []PaidMedia `json:"media"` @@ -12747,12 +9611,12 @@ func (starTransactionTypeBotPaidMediaSale *StarTransactionTypeBotPaidMediaSale) return nil } -// The transaction is a purchase of paid media from a channel by the current user; relevant for regular users only +// The transaction is a purchase of paid media from a channel by the current user; 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; may be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; can 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"` @@ -12799,12 +9663,12 @@ func (starTransactionTypeChannelPaidMediaPurchase *StarTransactionTypeChannelPai return nil } -// The transaction is a sale of paid media by the channel chat; relevant for channel chats only +// The transaction is a sale of paid media by the channel chat; for channel chats only type StarTransactionTypeChannelPaidMediaSale struct { meta - // Identifier of the user who bought the media + // Identifier of the user that bought the media UserId int64 `json:"user_id"` - // Identifier of the corresponding message with paid media; may be 0 or an identifier of a deleted message + // Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` // The bought media Media []PaidMedia `json:"media"` @@ -12851,10 +9715,10 @@ func (starTransactionTypeChannelPaidMediaSale *StarTransactionTypeChannelPaidMed return nil } -// The transaction is a purchase of a product from a bot or a business account by the current user; relevant for regular users only +// The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only type StarTransactionTypeBotInvoicePurchase struct { meta - // Identifier of the bot or the business account user who created the invoice + // Identifier of the bot or the business account user that created the invoice UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -12880,10 +9744,10 @@ func (*StarTransactionTypeBotInvoicePurchase) StarTransactionTypeType() string { return TypeStarTransactionTypeBotInvoicePurchase } -// The transaction is a sale of a product by the bot; relevant for bots only +// The transaction is a sale of a product by the bot; for bots only type StarTransactionTypeBotInvoiceSale struct { meta - // Identifier of the user who bought the product + // Identifier of the user that bought the product UserId int64 `json:"user_id"` // Information about the bought product ProductInfo *ProductInfo `json:"product_info"` @@ -12913,10 +9777,10 @@ 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; relevant for regular users only +// The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only type StarTransactionTypeBotSubscriptionPurchase struct { meta - // Identifier of the bot or the business account user who created the subscription link + // Identifier of the bot or the business account user that created the subscription link UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -12944,10 +9808,10 @@ func (*StarTransactionTypeBotSubscriptionPurchase) StarTransactionTypeType() str return TypeStarTransactionTypeBotSubscriptionPurchase } -// The transaction is a sale of a subscription by the bot; relevant for bots only +// The transaction is a sale of a subscription by the bot; for bots only type StarTransactionTypeBotSubscriptionSale struct { meta - // Identifier of the user who bought the subscription + // Identifier of the user that bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -12979,7 +9843,7 @@ func (*StarTransactionTypeBotSubscriptionSale) StarTransactionTypeType() string return TypeStarTransactionTypeBotSubscriptionSale } -// The transaction is a purchase of a subscription to a channel chat by the current user; relevant for regular users only +// The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only type StarTransactionTypeChannelSubscriptionPurchase struct { meta // Identifier of the channel chat that created the subscription @@ -13008,10 +9872,10 @@ func (*StarTransactionTypeChannelSubscriptionPurchase) StarTransactionTypeType() return TypeStarTransactionTypeChannelSubscriptionPurchase } -// The transaction is a sale of a subscription by the channel chat; relevant for channel chats only +// The transaction is a sale of a subscription by the channel chat; for channel chats only type StarTransactionTypeChannelSubscriptionSale struct { meta - // Identifier of the user who bought the subscription + // Identifier of the user that bought the subscription UserId int64 `json:"user_id"` // The number of seconds between consecutive Telegram Star debitings SubscriptionPeriod int32 `json:"subscription_period"` @@ -13037,55 +9901,7 @@ func (*StarTransactionTypeChannelSubscriptionSale) StarTransactionTypeType() str return TypeStarTransactionTypeChannelSubscriptionSale } -// The transaction is a bid on a gift auction; relevant for regular users only -type StarTransactionTypeGiftAuctionBid struct { - meta - // Identifier of the user who 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 +// The transaction is a purchase of a regular gift; for regular users and bots only type StarTransactionTypeGiftPurchase struct { meta // Identifier of the user or the channel that received the gift @@ -13133,34 +9949,7 @@ func (starTransactionTypeGiftPurchase *StarTransactionTypeGiftPurchase) Unmarsha return nil } -// 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 +// The transaction is a transfer of an upgraded gift; for regular users only type StarTransactionTypeGiftTransfer struct { meta // Identifier of the user or the channel that received the gift @@ -13208,58 +9997,10 @@ func (starTransactionTypeGiftTransfer *StarTransactionTypeGiftTransfer) Unmarsha return nil } -// 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 - OwnerId MessageSender `json:"owner_id"` - // The gift - Gift *UpgradedGift `json:"gift"` -} - -func (entity *StarTransactionTypeGiftOriginalDetailsDrop) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeGiftOriginalDetailsDrop - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeGiftOriginalDetailsDrop) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeGiftOriginalDetailsDrop) GetType() string { - return TypeStarTransactionTypeGiftOriginalDetailsDrop -} - -func (*StarTransactionTypeGiftOriginalDetailsDrop) StarTransactionTypeType() string { - return TypeStarTransactionTypeGiftOriginalDetailsDrop -} - -func (starTransactionTypeGiftOriginalDetailsDrop *StarTransactionTypeGiftOriginalDetailsDrop) UnmarshalJSON(data []byte) error { - var tmp struct { - OwnerId json.RawMessage `json:"owner_id"` - Gift *UpgradedGift `json:"gift"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - starTransactionTypeGiftOriginalDetailsDrop.Gift = tmp.Gift - - fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) - starTransactionTypeGiftOriginalDetailsDrop.OwnerId = fieldOwnerId - - return nil -} - -// The transaction is a sale of a received gift; relevant for regular users and channel chats only +// The transaction is a sale of a received gift; for regular users and channel chats only type StarTransactionTypeGiftSale struct { meta - // Identifier of the user who sent the gift + // Identifier of the user that sent the gift UserId int64 `json:"user_id"` // The gift Gift *Gift `json:"gift"` @@ -13285,10 +10026,10 @@ func (*StarTransactionTypeGiftSale) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftSale } -// The transaction is an upgrade of a gift; relevant for regular users only +// The transaction is an upgrade of a gift; for regular users only type StarTransactionTypeGiftUpgrade struct { meta - // Identifier of the user who initially sent the gift + // Identifier of the user that initially sent the gift UserId int64 `json:"user_id"` // The upgraded gift Gift *UpgradedGift `json:"gift"` @@ -13314,124 +10055,12 @@ func (*StarTransactionTypeGiftUpgrade) StarTransactionTypeType() string { return TypeStarTransactionTypeGiftUpgrade } -// 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 - OwnerId MessageSender `json:"owner_id"` - // The gift - Gift *Gift `json:"gift"` -} - -func (entity *StarTransactionTypeGiftUpgradePurchase) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeGiftUpgradePurchase - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeGiftUpgradePurchase) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeGiftUpgradePurchase) GetType() string { - return TypeStarTransactionTypeGiftUpgradePurchase -} - -func (*StarTransactionTypeGiftUpgradePurchase) StarTransactionTypeType() string { - return TypeStarTransactionTypeGiftUpgradePurchase -} - -func (starTransactionTypeGiftUpgradePurchase *StarTransactionTypeGiftUpgradePurchase) 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 - } - - starTransactionTypeGiftUpgradePurchase.Gift = tmp.Gift - - fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) - starTransactionTypeGiftUpgradePurchase.OwnerId = fieldOwnerId - - return nil -} - -// 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 who sold the gift - UserId int64 `json:"user_id"` - // The gift - Gift *UpgradedGift `json:"gift"` -} - -func (entity *StarTransactionTypeUpgradedGiftPurchase) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeUpgradedGiftPurchase - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeUpgradedGiftPurchase) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeUpgradedGiftPurchase) GetType() string { - return TypeStarTransactionTypeUpgradedGiftPurchase -} - -func (*StarTransactionTypeUpgradedGiftPurchase) StarTransactionTypeType() string { - return TypeStarTransactionTypeUpgradedGiftPurchase -} - -// The transaction is a sale of an upgraded gift; relevant for regular users only -type StarTransactionTypeUpgradedGiftSale struct { - meta - // Identifier of the user who bought the gift - UserId int64 `json:"user_id"` - // The gift - Gift *UpgradedGift `json:"gift"` - // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift - CommissionPerMille int32 `json:"commission_per_mille"` - // The Telegram Star amount that was received by Telegram; can be negative for refunds - CommissionStarAmount *StarAmount `json:"commission_star_amount"` - // True, if the gift was sold through a purchase offer - ViaOffer bool `json:"via_offer"` -} - -func (entity *StarTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeUpgradedGiftSale - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeUpgradedGiftSale) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeUpgradedGiftSale) GetType() string { - return TypeStarTransactionTypeUpgradedGiftSale -} - -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; relevant for regular users only +// The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only type StarTransactionTypeChannelPaidReactionSend struct { meta // Identifier of the channel chat ChatId int64 `json:"chat_id"` - // Identifier of the reacted message; may be 0 or an identifier of a deleted message + // Identifier of the reacted message; can be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -13455,12 +10084,12 @@ func (*StarTransactionTypeChannelPaidReactionSend) StarTransactionTypeType() str return TypeStarTransactionTypeChannelPaidReactionSend } -// The transaction is a receiving of a paid reaction to a message by the channel chat; relevant for channel chats only +// The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only type StarTransactionTypeChannelPaidReactionReceive struct { meta - // Identifier of the user who added the paid reaction + // Identifier of the user that added the paid reaction UserId int64 `json:"user_id"` - // Identifier of the reacted message; may be 0 or an identifier of a deleted message + // Identifier of the reacted message; can be 0 or an identifier of a deleted message MessageId int64 `json:"message_id"` } @@ -13484,7 +10113,7 @@ func (*StarTransactionTypeChannelPaidReactionReceive) StarTransactionTypeType() return TypeStarTransactionTypeChannelPaidReactionReceive } -// The transaction is a receiving of a commission from an affiliate program; relevant for regular users, bots and channel chats only +// The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only type StarTransactionTypeAffiliateProgramCommission struct { meta // Identifier of the chat that created the affiliate program @@ -13513,7 +10142,7 @@ func (*StarTransactionTypeAffiliateProgramCommission) StarTransactionTypeType() return TypeStarTransactionTypeAffiliateProgramCommission } -// The transaction is a sending of a paid message; relevant for regular users only +// The transaction is a sending of a paid message; for regular users only type StarTransactionTypePaidMessageSend struct { meta // Identifier of the chat that received the payment @@ -13542,7 +10171,7 @@ func (*StarTransactionTypePaidMessageSend) StarTransactionTypeType() string { return TypeStarTransactionTypePaidMessageSend } -// The transaction is a receiving of a paid message; relevant for regular users, supergroup and channel chats only +// The transaction is a receiving of a paid message; for regular users and supergroup chats only type StarTransactionTypePaidMessageReceive struct { meta // Identifier of the sender of the message @@ -13551,7 +10180,7 @@ type StarTransactionTypePaidMessageReceive struct { MessageCount int32 `json:"message_count"` // The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending CommissionPerMille int32 `json:"commission_per_mille"` - // The Telegram Star amount that was received by Telegram; can be negative for refunds + // The amount of Telegram Stars that were received by Telegram; can be negative for refunds CommissionStarAmount *StarAmount `json:"commission_star_amount"` } @@ -13598,222 +10227,10 @@ func (starTransactionTypePaidMessageReceive *StarTransactionTypePaidMessageRecei return nil } -// 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 Telegram Star amount that was 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 Telegram Star amount that was 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 - ChatId int64 `json:"chat_id"` -} - -func (entity *StarTransactionTypeSuggestedPostPaymentSend) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeSuggestedPostPaymentSend - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeSuggestedPostPaymentSend) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeSuggestedPostPaymentSend) GetType() string { - return TypeStarTransactionTypeSuggestedPostPaymentSend -} - -func (*StarTransactionTypeSuggestedPostPaymentSend) StarTransactionTypeType() string { - return TypeStarTransactionTypeSuggestedPostPaymentSend -} - -// 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 who paid for the suggested post - UserId int64 `json:"user_id"` -} - -func (entity *StarTransactionTypeSuggestedPostPaymentReceive) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypeSuggestedPostPaymentReceive - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypeSuggestedPostPaymentReceive) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypeSuggestedPostPaymentReceive) GetType() string { - return TypeStarTransactionTypeSuggestedPostPaymentReceive -} - -func (*StarTransactionTypeSuggestedPostPaymentReceive) StarTransactionTypeType() string { - return TypeStarTransactionTypeSuggestedPostPaymentReceive -} - -// The transaction is a purchase of Telegram Premium subscription; relevant for regular users and bots only +// The transaction is a purchase of Telegram Premium subscription; for regular users and bots only type StarTransactionTypePremiumPurchase struct { meta - // Identifier of the user who received the Telegram Premium subscription + // Identifier of the user that received the Telegram Premium subscription UserId int64 `json:"user_id"` // Number of months the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` @@ -13841,7 +10258,7 @@ func (*StarTransactionTypePremiumPurchase) StarTransactionTypeType() string { return TypeStarTransactionTypePremiumPurchase } -// The transaction is a transfer of Telegram Stars to a business bot; relevant for regular users only +// The transaction is a transfer of Telegram Stars to a business bot; for regular users only type StarTransactionTypeBusinessBotTransferSend struct { meta // Identifier of the bot that received Telegram Stars @@ -13868,10 +10285,10 @@ func (*StarTransactionTypeBusinessBotTransferSend) StarTransactionTypeType() str return TypeStarTransactionTypeBusinessBotTransferSend } -// The transaction is a transfer of Telegram Stars from a business account; relevant for bots only +// The transaction is a transfer of Telegram Stars from a business account; for bots only type StarTransactionTypeBusinessBotTransferReceive struct { meta - // Identifier of the user who sent Telegram Stars + // Identifier of the user that sent Telegram Stars UserId int64 `json:"user_id"` } @@ -13895,31 +10312,6 @@ func (*StarTransactionTypeBusinessBotTransferReceive) StarTransactionTypeType() return TypeStarTransactionTypeBusinessBotTransferReceive } -// The transaction is a payment for search of posts in public Telegram channels; relevant for regular users only -type StarTransactionTypePublicPostSearch struct{ - meta -} - -func (entity *StarTransactionTypePublicPostSearch) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StarTransactionTypePublicPostSearch - - return json.Marshal((*stub)(entity)) -} - -func (*StarTransactionTypePublicPostSearch) GetClass() string { - return ClassStarTransactionType -} - -func (*StarTransactionTypePublicPostSearch) GetType() string { - return TypeStarTransactionTypePublicPostSearch -} - -func (*StarTransactionTypePublicPostSearch) StarTransactionTypeType() string { - return TypeStarTransactionTypePublicPostSearch -} - // The transaction is a transaction of an unsupported type type StarTransactionTypeUnsupported struct{ meta @@ -14028,431 +10420,6 @@ func (*StarTransactions) GetType() string { return TypeStarTransactions } -// The transaction is a deposit of Toncoins from Fragment -type TonTransactionTypeFragmentDeposit struct { - meta - // True, if the transaction is a gift from another user - IsGift bool `json:"is_gift"` - // The sticker to be shown in the transaction information; may be null if unknown - Sticker *Sticker `json:"sticker"` -} - -func (entity *TonTransactionTypeFragmentDeposit) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeFragmentDeposit - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeFragmentDeposit) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeFragmentDeposit) GetType() string { - return TypeTonTransactionTypeFragmentDeposit -} - -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 - // Identifier of the channel chat that posted the post - ChatId int64 `json:"chat_id"` -} - -func (entity *TonTransactionTypeSuggestedPostPayment) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeSuggestedPostPayment - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeSuggestedPostPayment) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeSuggestedPostPayment) GetType() string { - return TypeTonTransactionTypeSuggestedPostPayment -} - -func (*TonTransactionTypeSuggestedPostPayment) TonTransactionTypeType() string { - return TypeTonTransactionTypeSuggestedPostPayment -} - -// 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 who sold the gift - UserId int64 `json:"user_id"` - // The gift - Gift *UpgradedGift `json:"gift"` -} - -func (entity *TonTransactionTypeUpgradedGiftPurchase) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeUpgradedGiftPurchase - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeUpgradedGiftPurchase) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeUpgradedGiftPurchase) GetType() string { - return TypeTonTransactionTypeUpgradedGiftPurchase -} - -func (*TonTransactionTypeUpgradedGiftPurchase) TonTransactionTypeType() string { - return TypeTonTransactionTypeUpgradedGiftPurchase -} - -// The transaction is a sale of an upgraded gift -type TonTransactionTypeUpgradedGiftSale struct { - meta - // Identifier of the user who bought the gift - UserId int64 `json:"user_id"` - // The gift - Gift *UpgradedGift `json:"gift"` - // The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift - CommissionPerMille int32 `json:"commission_per_mille"` - // The Toncoin amount that was received by the Telegram; in the smallest units of the currency - CommissionToncoinAmount int64 `json:"commission_toncoin_amount"` - // True, if the gift was sold through a purchase offer - ViaOffer bool `json:"via_offer"` -} - -func (entity *TonTransactionTypeUpgradedGiftSale) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeUpgradedGiftSale - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeUpgradedGiftSale) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeUpgradedGiftSale) GetType() string { - return TypeTonTransactionTypeUpgradedGiftSale -} - -func (*TonTransactionTypeUpgradedGiftSale) TonTransactionTypeType() string { - return TypeTonTransactionTypeUpgradedGiftSale -} - -// The transaction is a payment for stake dice throw -type TonTransactionTypeStakeDiceStake struct{ - meta -} - -func (entity *TonTransactionTypeStakeDiceStake) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeStakeDiceStake - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeStakeDiceStake) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeStakeDiceStake) GetType() string { - return TypeTonTransactionTypeStakeDiceStake -} - -func (*TonTransactionTypeStakeDiceStake) TonTransactionTypeType() string { - return TypeTonTransactionTypeStakeDiceStake -} - -// The transaction is a payment for successful stake dice throw -type TonTransactionTypeStakeDicePayout struct{ - meta -} - -func (entity *TonTransactionTypeStakeDicePayout) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeStakeDicePayout - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeStakeDicePayout) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeStakeDicePayout) GetType() string { - return TypeTonTransactionTypeStakeDicePayout -} - -func (*TonTransactionTypeStakeDicePayout) TonTransactionTypeType() string { - return TypeTonTransactionTypeStakeDicePayout -} - -// The transaction is a transaction of an unsupported type -type TonTransactionTypeUnsupported struct{ - meta -} - -func (entity *TonTransactionTypeUnsupported) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactionTypeUnsupported - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactionTypeUnsupported) GetClass() string { - return ClassTonTransactionType -} - -func (*TonTransactionTypeUnsupported) GetType() string { - return TypeTonTransactionTypeUnsupported -} - -func (*TonTransactionTypeUnsupported) TonTransactionTypeType() string { - return TypeTonTransactionTypeUnsupported -} - -// Represents a transaction changing the amount of owned Toncoins -type TonTransaction struct { - meta - // Unique identifier of the transaction - Id string `json:"id"` - // The amount of added owned Toncoins; negative for outgoing transactions - TonAmount int64 `json:"ton_amount"` - // True, if the transaction is a refund of a previous transaction - IsRefund bool `json:"is_refund"` - // Point in time (Unix timestamp) when the transaction was completed - Date int32 `json:"date"` - // Type of the transaction - Type TonTransactionType `json:"type"` -} - -func (entity *TonTransaction) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransaction - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransaction) GetClass() string { - return ClassTonTransaction -} - -func (*TonTransaction) GetType() string { - return TypeTonTransaction -} - -func (tonTransaction *TonTransaction) UnmarshalJSON(data []byte) error { - var tmp struct { - Id string `json:"id"` - TonAmount int64 `json:"ton_amount"` - IsRefund bool `json:"is_refund"` - Date int32 `json:"date"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - tonTransaction.Id = tmp.Id - tonTransaction.TonAmount = tmp.TonAmount - tonTransaction.IsRefund = tmp.IsRefund - tonTransaction.Date = tmp.Date - - fieldType, _ := UnmarshalTonTransactionType(tmp.Type) - tonTransaction.Type = fieldType - - return nil -} - -// Represents a list of Toncoin transactions -type TonTransactions struct { - meta - // The total amount of owned Toncoins - TonAmount int64 `json:"ton_amount"` - // List of Toncoin transactions - Transactions []*TonTransaction `json:"transactions"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *TonTransactions) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonTransactions - - return json.Marshal((*stub)(entity)) -} - -func (*TonTransactions) GetClass() string { - return ClassTonTransactions -} - -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 @@ -14653,7 +10620,7 @@ type GiveawayInfoCompleted struct { ActivationCount int32 `json:"activation_count"` // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway GiftCode string `json:"gift_code"` - // The Telegram Star amount won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway + // The amount of Telegram Stars won by the current user; 0 if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Star giveaway WonStarCount int64 `json:"won_star_count"` } @@ -14820,62 +10787,6 @@ func (*ProfileAccentColor) GetType() string { return TypeProfileAccentColor } -// Contains description of user rating -type UserRating struct { - meta - // The level of the user; may be negative - Level int32 `json:"level"` - // True, if the maximum level is reached - IsMaximumLevelReached bool `json:"is_maximum_level_reached"` - // Numerical value of the rating - Rating int64 `json:"rating"` - // The rating required for the current level - CurrentLevelRating int64 `json:"current_level_rating"` - // The rating required for the next level; 0 if the maximum level is reached - NextLevelRating int64 `json:"next_level_rating"` -} - -func (entity *UserRating) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UserRating - - return json.Marshal((*stub)(entity)) -} - -func (*UserRating) GetClass() string { - return ClassUserRating -} - -func (*UserRating) GetType() string { - return TypeUserRating -} - -// Contains information about restrictions that must be applied to a chat or a message -type RestrictionInfo struct { - meta - // A human-readable description of the reason why access to the content must be restricted. If empty, then the content can be accessed, but may be covered by hidden with 18+ spoiler anyway - RestrictionReason string `json:"restriction_reason"` - // True, if media content of the messages must be hidden with 18+ spoiler. Use value of the option "can_ignore_sensitive_content_restrictions" to check whether the current user can ignore the restriction. If age verification parameters were received in updateAgeVerificationParameters, then the user must complete age verification to ignore the restriction. Set the option "ignore_sensitive_content_restrictions" to true if the user passes age verification - HasSensitiveContent bool `json:"has_sensitive_content"` -} - -func (entity *RestrictionInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub RestrictionInfo - - return json.Marshal((*stub)(entity)) -} - -func (*RestrictionInfo) GetClass() string { - return ClassRestrictionInfo -} - -func (*RestrictionInfo) GetType() string { - return TypeRestrictionInfo -} - // A custom emoji set as emoji status type EmojiStatusTypeCustomEmoji struct { meta @@ -15037,10 +10948,8 @@ 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 + // The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo EditableUsername string `json:"editable_username"` - // 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) { @@ -15082,8 +10991,6 @@ type User struct { AccentColorId int32 `json:"accent_color_id"` // Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - // Color scheme based on an upgraded gift to be used for the user instead of accent_color_id and background_custom_emoji_id; may be null if none - UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // Identifier of the accent color for the user's profile; -1 if none ProfileAccentColorId int32 `json:"profile_accent_color_id"` // Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none @@ -15102,10 +11009,12 @@ type User struct { IsPremium bool `json:"is_premium"` // True, if the user is Telegram support account 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"` - // State of active stories of the user; may be null if the user has no active stories - ActiveStoryState ActiveStoryState `json:"active_story_state"` + // If non-empty, it contains a human-readable description of the reason why access to this user must be restricted + RestrictionReason string `json:"restriction_reason"` + // 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"` // 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 @@ -15148,7 +11057,6 @@ func (user *User) UnmarshalJSON(data []byte) error { ProfilePhoto *ProfilePhoto `json:"profile_photo"` AccentColorId int32 `json:"accent_color_id"` BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` ProfileAccentColorId int32 `json:"profile_accent_color_id"` ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` EmojiStatus *EmojiStatus `json:"emoji_status"` @@ -15158,8 +11066,9 @@ func (user *User) UnmarshalJSON(data []byte) error { VerificationStatus *VerificationStatus `json:"verification_status"` IsPremium bool `json:"is_premium"` IsSupport bool `json:"is_support"` - RestrictionInfo *RestrictionInfo `json:"restriction_info"` - ActiveStoryState json.RawMessage `json:"active_story_state"` + RestrictionReason string `json:"restriction_reason"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` RestrictsNewChats bool `json:"restricts_new_chats"` PaidMessageStarCount int64 `json:"paid_message_star_count"` HaveAccess bool `json:"have_access"` @@ -15182,7 +11091,6 @@ func (user *User) UnmarshalJSON(data []byte) error { user.ProfilePhoto = tmp.ProfilePhoto user.AccentColorId = tmp.AccentColorId user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId - user.UpgradedGiftColors = tmp.UpgradedGiftColors user.ProfileAccentColorId = tmp.ProfileAccentColorId user.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId user.EmojiStatus = tmp.EmojiStatus @@ -15192,7 +11100,9 @@ func (user *User) UnmarshalJSON(data []byte) error { user.VerificationStatus = tmp.VerificationStatus user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport - user.RestrictionInfo = tmp.RestrictionInfo + user.RestrictionReason = tmp.RestrictionReason + user.HasActiveStories = tmp.HasActiveStories + user.HasUnreadActiveStories = tmp.HasUnreadActiveStories user.RestrictsNewChats = tmp.RestrictsNewChats user.PaidMessageStarCount = tmp.PaidMessageStarCount user.HaveAccess = tmp.HaveAccess @@ -15202,9 +11112,6 @@ 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 @@ -15388,18 +11295,6 @@ type UserFullInfo struct { GiftSettings *GiftSettings `json:"gift_settings"` // Information about verification status of the user provided by a bot; may be null if none or unknown BotVerification *BotVerification `json:"bot_verification"` - // The main tab chosen by the user; may be null if not chosen manually - MainProfileTab ProfileTab `json:"main_profile_tab"` - // The first audio file added to the user's profile; may be null if none - FirstProfileAudio *Audio `json:"first_profile_audio"` - // The current rating of the user; may be null if none - Rating *UserRating `json:"rating"` - // The rating of the user after the next change; may be null if the user isn't the current user or there are no pending rating changes - PendingRating *UserRating `json:"pending_rating"` - // Unix timestamp when rating of the user will change to pending_rating; 0 if the user isn't the current user or there are no pending rating changes - PendingRatingDate int32 `json:"pending_rating_date"` - // Note added to the user's contact; may be null if none - Note *FormattedText `json:"note"` // Information about business settings for Telegram Business accounts; may be null if none BusinessInfo *BusinessInfo `json:"business_info"` // For bots, information about the bot; may be null if the user isn't a bot @@ -15446,12 +11341,6 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` GiftSettings *GiftSettings `json:"gift_settings"` BotVerification *BotVerification `json:"bot_verification"` - MainProfileTab json.RawMessage `json:"main_profile_tab"` - FirstProfileAudio *Audio `json:"first_profile_audio"` - Rating *UserRating `json:"rating"` - PendingRating *UserRating `json:"pending_rating"` - PendingRatingDate int32 `json:"pending_rating_date"` - Note *FormattedText `json:"note"` BusinessInfo *BusinessInfo `json:"business_info"` BotInfo *BotInfo `json:"bot_info"` } @@ -15482,20 +11371,12 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount userFullInfo.GiftSettings = tmp.GiftSettings userFullInfo.BotVerification = tmp.BotVerification - userFullInfo.FirstProfileAudio = tmp.FirstProfileAudio - userFullInfo.Rating = tmp.Rating - userFullInfo.PendingRating = tmp.PendingRating - userFullInfo.PendingRatingDate = tmp.PendingRatingDate - userFullInfo.Note = tmp.Note userFullInfo.BusinessInfo = tmp.BusinessInfo userFullInfo.BotInfo = tmp.BotInfo fieldBlockList, _ := UnmarshalBlockList(tmp.BlockList) userFullInfo.BlockList = fieldBlockList - fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) - userFullInfo.MainProfileTab = fieldMainProfileTab - return nil } @@ -15776,7 +11657,7 @@ type ChatMember struct { meta // Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels MemberId MessageSender `json:"member_id"` - // Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown + // Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown InviterUserId int64 `json:"inviter_user_id"` // Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat JoinedChatDate int32 `json:"joined_chat_date"` @@ -15928,8 +11809,8 @@ func (*ChatMembersFilterMembers) ChatMembersFilterType() string { // Returns users which can be mentioned in the chat type ChatMembersFilterMention struct { meta - // Identifier of the topic in which the users will be mentioned; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If non-zero, the identifier of the current message thread + MessageThreadId int64 `json:"message_thread_id"` } func (entity *ChatMembersFilterMention) MarshalJSON() ([]byte, error) { @@ -15952,22 +11833,6 @@ func (*ChatMembersFilterMention) ChatMembersFilterType() string { return TypeChatMembersFilterMention } -func (chatMembersFilterMention *ChatMembersFilterMention) UnmarshalJSON(data []byte) error { - var tmp struct { - TopicId json.RawMessage `json:"topic_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - chatMembersFilterMention.TopicId = fieldTopicId - - return nil -} - // Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup type ChatMembersFilterRestricted struct{ meta @@ -16206,8 +12071,8 @@ type SupergroupMembersFilterMention struct { meta // Query to search for Query string `json:"query"` - // Identifier of the topic in which the users will be mentioned; pass null if none - TopicId MessageTopic `json:"topic_id"` + // If non-zero, the identifier of the current message thread + MessageThreadId int64 `json:"message_thread_id"` } func (entity *SupergroupMembersFilterMention) MarshalJSON() ([]byte, error) { @@ -16230,25 +12095,6 @@ func (*SupergroupMembersFilterMention) SupergroupMembersFilterType() string { return TypeSupergroupMembersFilterMention } -func (supergroupMembersFilterMention *SupergroupMembersFilterMention) UnmarshalJSON(data []byte) error { - var tmp struct { - Query string `json:"query"` - TopicId json.RawMessage `json:"topic_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - supergroupMembersFilterMention.Query = tmp.Query - - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - supergroupMembersFilterMention.TopicId = fieldTopicId - - return nil -} - // Returns bot members of the supergroup or channel type SupergroupMembersFilterBots struct{ meta @@ -16642,7 +12488,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { return nil } -// Describes a user who sent a join request and waits for administrator approval +// Describes a user that sent a join request and waits for administrator approval type ChatJoinRequest struct { meta // User identifier @@ -16825,12 +12671,10 @@ type Supergroup struct { Date int32 `json:"date"` // Status of the current user in the supergroup or channel; custom title will always be empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToPostStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories MemberCount int32 `json:"member_count"` // Approximate boost level for the chat BoostLevel int32 `json:"boost_level"` - // True, if automatic translation of messages is enabled in the channel - HasAutomaticTranslation bool `json:"has_automatic_translation"` // True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel HasLinkedChat bool `json:"has_linked_chat"` // True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup @@ -16839,9 +12683,9 @@ type Supergroup struct { SignMessages bool `json:"sign_messages"` // True, if messages sent to the channel have information about the sender user. This field is only applicable to channels 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 + // True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups JoinToSendMessages bool `json:"join_to_send_messages"` - // 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 + // True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without 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"` @@ -16851,22 +12695,18 @@ type Supergroup struct { IsBroadcastGroup bool `json:"is_broadcast_group"` // True, if the supergroup is a forum with topics IsForum bool `json:"is_forum"` - // True, if the supergroup is a direct message group for a channel chat - IsDirectMessagesGroup bool `json:"is_direct_messages_group"` - // True, if the supergroup is a direct messages group for a channel chat that is administered by the current user - IsAdministeredDirectMessagesGroup bool `json:"is_administered_direct_messages_group"` // Information about verification status of the supergroup or channel; may be null if none VerificationStatus *VerificationStatus `json:"verification_status"` - // True, if the channel has direct messages group - HasDirectMessagesGroup bool `json:"has_direct_messages_group"` - // True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups - HasForumTabs bool `json:"has_forum_tabs"` - // Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none - RestrictionInfo *RestrictionInfo `json:"restriction_info"` + // True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler + HasSensitiveContent bool `json:"has_sensitive_content"` + // If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted + RestrictionReason string `json:"restriction_reason"` // 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"` - // State of active stories of the supergroup or channel; may be null if there are no active stories - ActiveStoryState ActiveStoryState `json:"active_story_state"` + // 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"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -16894,7 +12734,6 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { Status json.RawMessage `json:"status"` MemberCount int32 `json:"member_count"` BoostLevel int32 `json:"boost_level"` - HasAutomaticTranslation bool `json:"has_automatic_translation"` HasLinkedChat bool `json:"has_linked_chat"` HasLocation bool `json:"has_location"` SignMessages bool `json:"sign_messages"` @@ -16905,14 +12744,12 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { IsChannel bool `json:"is_channel"` IsBroadcastGroup bool `json:"is_broadcast_group"` IsForum bool `json:"is_forum"` - IsDirectMessagesGroup bool `json:"is_direct_messages_group"` - IsAdministeredDirectMessagesGroup bool `json:"is_administered_direct_messages_group"` VerificationStatus *VerificationStatus `json:"verification_status"` - HasDirectMessagesGroup bool `json:"has_direct_messages_group"` - HasForumTabs bool `json:"has_forum_tabs"` - RestrictionInfo *RestrictionInfo `json:"restriction_info"` + HasSensitiveContent bool `json:"has_sensitive_content"` + RestrictionReason string `json:"restriction_reason"` PaidMessageStarCount int64 `json:"paid_message_star_count"` - ActiveStoryState json.RawMessage `json:"active_story_state"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` } err := json.Unmarshal(data, &tmp) @@ -16926,7 +12763,6 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.Date = tmp.Date supergroup.MemberCount = tmp.MemberCount supergroup.BoostLevel = tmp.BoostLevel - supergroup.HasAutomaticTranslation = tmp.HasAutomaticTranslation supergroup.HasLinkedChat = tmp.HasLinkedChat supergroup.HasLocation = tmp.HasLocation supergroup.SignMessages = tmp.SignMessages @@ -16937,20 +12773,16 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.IsChannel = tmp.IsChannel supergroup.IsBroadcastGroup = tmp.IsBroadcastGroup supergroup.IsForum = tmp.IsForum - supergroup.IsDirectMessagesGroup = tmp.IsDirectMessagesGroup - supergroup.IsAdministeredDirectMessagesGroup = tmp.IsAdministeredDirectMessagesGroup supergroup.VerificationStatus = tmp.VerificationStatus - supergroup.HasDirectMessagesGroup = tmp.HasDirectMessagesGroup - supergroup.HasForumTabs = tmp.HasForumTabs - supergroup.RestrictionInfo = tmp.RestrictionInfo + supergroup.HasSensitiveContent = tmp.HasSensitiveContent + supergroup.RestrictionReason = tmp.RestrictionReason 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 } @@ -16971,8 +12803,6 @@ type SupergroupFullInfo struct { BannedCount int32 `json:"banned_count"` // Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown LinkedChatId int64 `json:"linked_chat_id"` - // Chat identifier of a direct messages group for the channel, or a channel, for which the supergroup is the designated direct messages group; 0 if none - DirectMessagesChatId int64 `json:"direct_messages_chat_id"` // Delay between consecutive sent messages for non-administrator supergroup members, in seconds SlowModeDelay int32 `json:"slow_mode_delay"` // Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero @@ -17017,8 +12847,6 @@ type SupergroupFullInfo struct { MyBoostCount int32 `json:"my_boost_count"` // Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified UnrestrictBoostCount int32 `json:"unrestrict_boost_count"` - // Number of Telegram Stars that must be paid by the current user for each sent message to the supergroup - OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` // Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none StickerSetId JsonInt64 `json:"sticker_set_id"` // Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none @@ -17031,8 +12859,6 @@ type SupergroupFullInfo struct { BotCommands []*BotCommands `json:"bot_commands"` // Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown BotVerification *BotVerification `json:"bot_verification"` - // The main tab chosen by the administrators of the channel; may be null if not chosen manually - MainProfileTab ProfileTab `json:"main_profile_tab"` // Identifier of the basic group from which supergroup was upgraded; 0 if none UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` // Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none @@ -17055,101 +12881,6 @@ func (*SupergroupFullInfo) GetType() string { return TypeSupergroupFullInfo } -func (supergroupFullInfo *SupergroupFullInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - Photo *ChatPhoto `json:"photo"` - Description string `json:"description"` - MemberCount int32 `json:"member_count"` - AdministratorCount int32 `json:"administrator_count"` - RestrictedCount int32 `json:"restricted_count"` - BannedCount int32 `json:"banned_count"` - LinkedChatId int64 `json:"linked_chat_id"` - DirectMessagesChatId int64 `json:"direct_messages_chat_id"` - SlowModeDelay int32 `json:"slow_mode_delay"` - SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"` - CanEnablePaidMessages bool `json:"can_enable_paid_messages"` - CanEnablePaidReaction bool `json:"can_enable_paid_reaction"` - CanGetMembers bool `json:"can_get_members"` - HasHiddenMembers bool `json:"has_hidden_members"` - CanHideMembers bool `json:"can_hide_members"` - CanSetStickerSet bool `json:"can_set_sticker_set"` - CanSetLocation bool `json:"can_set_location"` - CanGetStatistics bool `json:"can_get_statistics"` - CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"` - CanGetStarRevenueStatistics bool `json:"can_get_star_revenue_statistics"` - CanSendGift bool `json:"can_send_gift"` - CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` - IsAllHistoryAvailable bool `json:"is_all_history_available"` - CanHaveSponsoredMessages bool `json:"can_have_sponsored_messages"` - HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` - HasPaidMediaAllowed bool `json:"has_paid_media_allowed"` - HasPinnedStories bool `json:"has_pinned_stories"` - GiftCount int32 `json:"gift_count"` - MyBoostCount int32 `json:"my_boost_count"` - UnrestrictBoostCount int32 `json:"unrestrict_boost_count"` - OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"` - StickerSetId JsonInt64 `json:"sticker_set_id"` - CustomEmojiStickerSetId JsonInt64 `json:"custom_emoji_sticker_set_id"` - Location *ChatLocation `json:"location"` - InviteLink *ChatInviteLink `json:"invite_link"` - BotCommands []*BotCommands `json:"bot_commands"` - BotVerification *BotVerification `json:"bot_verification"` - MainProfileTab json.RawMessage `json:"main_profile_tab"` - UpgradedFromBasicGroupId int64 `json:"upgraded_from_basic_group_id"` - UpgradedFromMaxMessageId int64 `json:"upgraded_from_max_message_id"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - supergroupFullInfo.Photo = tmp.Photo - supergroupFullInfo.Description = tmp.Description - supergroupFullInfo.MemberCount = tmp.MemberCount - supergroupFullInfo.AdministratorCount = tmp.AdministratorCount - supergroupFullInfo.RestrictedCount = tmp.RestrictedCount - supergroupFullInfo.BannedCount = tmp.BannedCount - supergroupFullInfo.LinkedChatId = tmp.LinkedChatId - supergroupFullInfo.DirectMessagesChatId = tmp.DirectMessagesChatId - supergroupFullInfo.SlowModeDelay = tmp.SlowModeDelay - supergroupFullInfo.SlowModeDelayExpiresIn = tmp.SlowModeDelayExpiresIn - supergroupFullInfo.CanEnablePaidMessages = tmp.CanEnablePaidMessages - supergroupFullInfo.CanEnablePaidReaction = tmp.CanEnablePaidReaction - supergroupFullInfo.CanGetMembers = tmp.CanGetMembers - supergroupFullInfo.HasHiddenMembers = tmp.HasHiddenMembers - supergroupFullInfo.CanHideMembers = tmp.CanHideMembers - supergroupFullInfo.CanSetStickerSet = tmp.CanSetStickerSet - supergroupFullInfo.CanSetLocation = tmp.CanSetLocation - supergroupFullInfo.CanGetStatistics = tmp.CanGetStatistics - supergroupFullInfo.CanGetRevenueStatistics = tmp.CanGetRevenueStatistics - supergroupFullInfo.CanGetStarRevenueStatistics = tmp.CanGetStarRevenueStatistics - supergroupFullInfo.CanSendGift = tmp.CanSendGift - supergroupFullInfo.CanToggleAggressiveAntiSpam = tmp.CanToggleAggressiveAntiSpam - supergroupFullInfo.IsAllHistoryAvailable = tmp.IsAllHistoryAvailable - supergroupFullInfo.CanHaveSponsoredMessages = tmp.CanHaveSponsoredMessages - supergroupFullInfo.HasAggressiveAntiSpamEnabled = tmp.HasAggressiveAntiSpamEnabled - supergroupFullInfo.HasPaidMediaAllowed = tmp.HasPaidMediaAllowed - supergroupFullInfo.HasPinnedStories = tmp.HasPinnedStories - supergroupFullInfo.GiftCount = tmp.GiftCount - supergroupFullInfo.MyBoostCount = tmp.MyBoostCount - supergroupFullInfo.UnrestrictBoostCount = tmp.UnrestrictBoostCount - supergroupFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount - supergroupFullInfo.StickerSetId = tmp.StickerSetId - supergroupFullInfo.CustomEmojiStickerSetId = tmp.CustomEmojiStickerSetId - supergroupFullInfo.Location = tmp.Location - supergroupFullInfo.InviteLink = tmp.InviteLink - supergroupFullInfo.BotCommands = tmp.BotCommands - supergroupFullInfo.BotVerification = tmp.BotVerification - supergroupFullInfo.UpgradedFromBasicGroupId = tmp.UpgradedFromBasicGroupId - supergroupFullInfo.UpgradedFromMaxMessageId = tmp.UpgradedFromMaxMessageId - - fieldMainProfileTab, _ := UnmarshalProfileTab(tmp.MainProfileTab) - supergroupFullInfo.MainProfileTab = fieldMainProfileTab - - return nil -} - // The secret chat is not yet created; waiting for the other user to get online type SecretChatStatePending struct{ meta @@ -17285,41 +13016,10 @@ func (secretChat *SecretChat) UnmarshalJSON(data []byte) error { return nil } -// Contains information about public post search limits -type PublicPostSearchLimits struct { - meta - // Number of queries that can be sent daily for free - DailyFreeQueryCount int32 `json:"daily_free_query_count"` - // Number of remaining free queries today - RemainingFreeQueryCount int32 `json:"remaining_free_query_count"` - // 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 int64 `json:"star_count"` - // True, if the search for the specified query isn't charged - IsCurrentQueryFree bool `json:"is_current_query_free"` -} - -func (entity *PublicPostSearchLimits) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PublicPostSearchLimits - - return json.Marshal((*stub)(entity)) -} - -func (*PublicPostSearchLimits) GetClass() string { - return ClassPublicPostSearchLimits -} - -func (*PublicPostSearchLimits) GetType() string { - return TypePublicPostSearchLimits -} - // The message was sent by a known user type MessageSenderUser struct { meta - // Identifier of the user who sent the message + // Identifier of the user that sent the message UserId int64 `json:"user_id"` } @@ -17659,7 +13359,7 @@ func (*MessageViewers) GetType() string { // The message was originally sent by a known user type MessageOriginUser struct { meta - // Identifier of the user who originally sent the message + // Identifier of the user that originally sent the message SenderUserId int64 `json:"sender_user_id"` } @@ -17986,13 +13686,13 @@ func (*PaidReactionTypeChat) PaidReactionTypeType() string { return TypePaidReactionTypeChat } -// Contains information about a user who added paid reactions +// Contains information about a user that added paid reactions type PaidReactor struct { meta // Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user SenderId MessageSender `json:"sender_id"` // Number of Telegram Stars added - StarCount int64 `json:"star_count"` + StarCount int32 `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 @@ -18020,7 +13720,7 @@ func (*PaidReactor) GetType() string { func (paidReactor *PaidReactor) UnmarshalJSON(data []byte) error { var tmp struct { SenderId json.RawMessage `json:"sender_id"` - StarCount int64 `json:"star_count"` + StarCount int32 `json:"star_count"` IsTop bool `json:"is_top"` IsMe bool `json:"is_me"` IsAnonymous bool `json:"is_anonymous"` @@ -18042,31 +13742,6 @@ 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 @@ -18368,114 +14043,6 @@ func (unreadReaction *UnreadReaction) UnmarshalJSON(data []byte) error { return nil } -// A topic in a non-forum supergroup chat -type MessageTopicThread struct { - meta - // Unique identifier of the message thread - MessageThreadId int64 `json:"message_thread_id"` -} - -func (entity *MessageTopicThread) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageTopicThread - - return json.Marshal((*stub)(entity)) -} - -func (*MessageTopicThread) GetClass() string { - return ClassMessageTopic -} - -func (*MessageTopicThread) GetType() string { - return TypeMessageTopicThread -} - -func (*MessageTopicThread) MessageTopicType() string { - return TypeMessageTopicThread -} - -// A topic in a forum supergroup chat or a chat with a bot -type MessageTopicForum struct { - meta - // Unique identifier of the forum topic - ForumTopicId int32 `json:"forum_topic_id"` -} - -func (entity *MessageTopicForum) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageTopicForum - - return json.Marshal((*stub)(entity)) -} - -func (*MessageTopicForum) GetClass() string { - return ClassMessageTopic -} - -func (*MessageTopicForum) GetType() string { - return TypeMessageTopicForum -} - -func (*MessageTopicForum) MessageTopicType() string { - return TypeMessageTopicForum -} - -// A topic in a channel direct messages chat administered by the current user -type MessageTopicDirectMessages struct { - meta - // Unique identifier of the topic - DirectMessagesChatTopicId int64 `json:"direct_messages_chat_topic_id"` -} - -func (entity *MessageTopicDirectMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageTopicDirectMessages - - return json.Marshal((*stub)(entity)) -} - -func (*MessageTopicDirectMessages) GetClass() string { - return ClassMessageTopic -} - -func (*MessageTopicDirectMessages) GetType() string { - return TypeMessageTopicDirectMessages -} - -func (*MessageTopicDirectMessages) MessageTopicType() string { - return TypeMessageTopicDirectMessages -} - -// A topic in Saved Messages chat -type MessageTopicSavedMessages struct { - meta - // Unique identifier of the Saved Messages topic - SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` -} - -func (entity *MessageTopicSavedMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageTopicSavedMessages - - return json.Marshal((*stub)(entity)) -} - -func (*MessageTopicSavedMessages) GetClass() string { - return ClassMessageTopic -} - -func (*MessageTopicSavedMessages) GetType() string { - return TypeMessageTopicSavedMessages -} - -func (*MessageTopicSavedMessages) MessageTopicType() string { - return TypeMessageTopicSavedMessages -} - // An effect from an emoji reaction type MessageEffectTypeEmojiReaction struct { meta @@ -18715,13 +14282,11 @@ type MessageReplyToMessage struct { MessageId int64 `json:"message_id"` // Chosen quote from the replied message; may be null if none Quote *TextQuote `json:"quote"` - // Identifier of the checklist task in the original message that was replied; 0 if none - ChecklistTaskId int32 `json:"checklist_task_id"` // Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat 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, messageStakeDice, 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, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote Content MessageContent `json:"content"` } @@ -18750,7 +14315,6 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e ChatId int64 `json:"chat_id"` MessageId int64 `json:"message_id"` Quote *TextQuote `json:"quote"` - ChecklistTaskId int32 `json:"checklist_task_id"` Origin json.RawMessage `json:"origin"` OriginSendDate int32 `json:"origin_send_date"` Content json.RawMessage `json:"content"` @@ -18764,7 +14328,6 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e messageReplyToMessage.ChatId = tmp.ChatId messageReplyToMessage.MessageId = tmp.MessageId messageReplyToMessage.Quote = tmp.Quote - messageReplyToMessage.ChecklistTaskId = tmp.ChecklistTaskId messageReplyToMessage.OriginSendDate = tmp.OriginSendDate fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) @@ -18779,8 +14342,8 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e // Describes a story replied by a given message type MessageReplyToStory struct { meta - // The identifier of the poster of the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` } @@ -18812,8 +14375,6 @@ type InputMessageReplyToMessage struct { MessageId int64 `json:"message_id"` // Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats Quote *InputTextQuote `json:"quote"` - // Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message - ChecklistTaskId int32 `json:"checklist_task_id"` } func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { @@ -18845,8 +14406,6 @@ type InputMessageReplyToExternalMessage struct { MessageId int64 `json:"message_id"` // Quote from the message to be replied; pass null if none Quote *InputTextQuote `json:"quote"` - // Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message - ChecklistTaskId int32 `json:"checklist_task_id"` } func (entity *InputMessageReplyToExternalMessage) MarshalJSON() ([]byte, error) { @@ -18872,8 +14431,8 @@ func (*InputMessageReplyToExternalMessage) InputMessageReplyToType() string { // Describes a story to be replied type InputMessageReplyToStory struct { meta - // The identifier of the poster of the story. Currently, stories can be replied only in the chat that posted the story; channel stories can't be replied - StoryPosterChatId int64 `json:"story_poster_chat_id"` + // The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat and channel stories can't be replied + StorySenderChatId int64 `json:"story_sender_chat_id"` // The identifier of the story StoryId int32 `json:"story_id"` } @@ -18942,16 +14501,14 @@ type Message struct { IsPinned bool `json:"is_pinned"` // True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message IsFromOffline bool `json:"is_from_offline"` - // True, if content of the message can be saved locally + // True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options CanBeSaved bool `json:"can_be_saved"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` // True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts IsChannelPost bool `json:"is_channel_post"` - // True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending - IsPaidStarSuggestedPost bool `json:"is_paid_star_suggested_post"` - // True, if the message is a suggested channel post which was paid in Toncoins; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending - IsPaidTonSuggestedPost bool `json:"is_paid_ton_suggested_post"` + // True, if the message is a forum topic message + IsTopicMessage bool `json:"is_topic_message"` // True, if the message contains an unread mention for the current user ContainsUnreadMention bool `json:"contains_unread_mention"` // Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages @@ -18968,12 +14525,12 @@ type Message struct { UnreadReactions []*UnreadReaction `json:"unread_reactions"` // Information about fact-check added to the message; may be null if none FactCheck *FactCheck `json:"fact_check"` - // Information about the suggested post; may be null if the message isn't a suggested post - 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; may change when the chat is converted to a forum or back - TopicId MessageTopic `json:"topic_id"` + // If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs + MessageThreadId int64 `json:"message_thread_id"` + // Identifier of the Saved Messages topic for the message; 0 for messages not from Saved Messages + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` // The message's self-destruct type; may be null if none SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` // Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet @@ -18994,10 +14551,10 @@ type Message struct { MediaAlbumId JsonInt64 `json:"media_album_id"` // Unique identifier of the effect added to the message; 0 if none 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"` + // True, if media content of the message must be hidden with 18+ spoiler + HasSensitiveContent bool `json:"has_sensitive_content"` + // If non-empty, contains a human-readable description of the reason why access to this message must be restricted + RestrictionReason string `json:"restriction_reason"` // Content of the message Content MessageContent `json:"content"` // Reply markup for the message; may be null if none @@ -19033,8 +14590,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { CanBeSaved bool `json:"can_be_saved"` HasTimestampedMedia bool `json:"has_timestamped_media"` IsChannelPost bool `json:"is_channel_post"` - IsPaidStarSuggestedPost bool `json:"is_paid_star_suggested_post"` - IsPaidTonSuggestedPost bool `json:"is_paid_ton_suggested_post"` + IsTopicMessage bool `json:"is_topic_message"` ContainsUnreadMention bool `json:"contains_unread_mention"` Date int32 `json:"date"` EditDate int32 `json:"edit_date"` @@ -19043,9 +14599,9 @@ func (message *Message) UnmarshalJSON(data []byte) error { InteractionInfo *MessageInteractionInfo `json:"interaction_info"` UnreadReactions []*UnreadReaction `json:"unread_reactions"` FactCheck *FactCheck `json:"fact_check"` - SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info"` ReplyTo json.RawMessage `json:"reply_to"` - TopicId json.RawMessage `json:"topic_id"` + MessageThreadId int64 `json:"message_thread_id"` + SavedMessagesTopicId int64 `json:"saved_messages_topic_id"` SelfDestructType json.RawMessage `json:"self_destruct_type"` SelfDestructIn float64 `json:"self_destruct_in"` AutoDeleteIn float64 `json:"auto_delete_in"` @@ -19056,8 +14612,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { AuthorSignature string `json:"author_signature"` MediaAlbumId JsonInt64 `json:"media_album_id"` EffectId JsonInt64 `json:"effect_id"` - RestrictionInfo *RestrictionInfo `json:"restriction_info"` - SummaryLanguageCode string `json:"summary_language_code"` + HasSensitiveContent bool `json:"has_sensitive_content"` + RestrictionReason string `json:"restriction_reason"` Content json.RawMessage `json:"content"` ReplyMarkup json.RawMessage `json:"reply_markup"` } @@ -19075,8 +14631,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.CanBeSaved = tmp.CanBeSaved message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost - message.IsPaidStarSuggestedPost = tmp.IsPaidStarSuggestedPost - message.IsPaidTonSuggestedPost = tmp.IsPaidTonSuggestedPost + message.IsTopicMessage = tmp.IsTopicMessage message.ContainsUnreadMention = tmp.ContainsUnreadMention message.Date = tmp.Date message.EditDate = tmp.EditDate @@ -19085,7 +14640,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.InteractionInfo = tmp.InteractionInfo message.UnreadReactions = tmp.UnreadReactions message.FactCheck = tmp.FactCheck - message.SuggestedPostInfo = tmp.SuggestedPostInfo + message.MessageThreadId = tmp.MessageThreadId + message.SavedMessagesTopicId = tmp.SavedMessagesTopicId message.SelfDestructIn = tmp.SelfDestructIn message.AutoDeleteIn = tmp.AutoDeleteIn message.ViaBotUserId = tmp.ViaBotUserId @@ -19095,8 +14651,8 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.AuthorSignature = tmp.AuthorSignature message.MediaAlbumId = tmp.MediaAlbumId message.EffectId = tmp.EffectId - message.RestrictionInfo = tmp.RestrictionInfo - message.SummaryLanguageCode = tmp.SummaryLanguageCode + message.HasSensitiveContent = tmp.HasSensitiveContent + message.RestrictionReason = tmp.RestrictionReason fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) message.SenderId = fieldSenderId @@ -19110,9 +14666,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo) message.ReplyTo = fieldReplyTo - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - message.TopicId = fieldTopicId - fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) message.SelfDestructType = fieldSelfDestructType @@ -19204,35 +14757,6 @@ func (*FoundChatMessages) GetType() string { return TypeFoundChatMessages } -// Contains a list of messages found by a public post search -type FoundPublicPosts struct { - meta - // List of found public posts - Messages []*Message `json:"messages"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` - // Updated public post search limits after the query; repeated requests with the same query will be free; may be null if they didn't change - SearchLimits *PublicPostSearchLimits `json:"search_limits"` - // True, if the query has failed because search limits are exceeded. In this case search_limits.daily_free_query_count will be equal to 0 - AreLimitsExceeded bool `json:"are_limits_exceeded"` -} - -func (entity *FoundPublicPosts) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub FoundPublicPosts - - return json.Marshal((*stub)(entity)) -} - -func (*FoundPublicPosts) GetClass() string { - return ClassFoundPublicPosts -} - -func (*FoundPublicPosts) GetType() string { - return TypeFoundPublicPosts -} - // Contains information about a message in a specific position type MessagePosition struct { meta @@ -19408,7 +14932,7 @@ func (*MessageSourceChatHistory) MessageSourceType() string { return TypeMessageSourceChatHistory } -// The message is from history of a message thread +// The message is from a message thread history type MessageSourceMessageThreadHistory struct{ meta } @@ -19433,7 +14957,7 @@ func (*MessageSourceMessageThreadHistory) MessageSourceType() string { return TypeMessageSourceMessageThreadHistory } -// The message is from history of a forum topic +// The message is from a forum topic history type MessageSourceForumTopicHistory struct{ meta } @@ -19458,31 +14982,6 @@ func (*MessageSourceForumTopicHistory) MessageSourceType() string { return TypeMessageSourceForumTopicHistory } -// The message is from history of a topic in a channel direct messages chat administered by the current user -type MessageSourceDirectMessagesChatTopicHistory struct{ - meta -} - -func (entity *MessageSourceDirectMessagesChatTopicHistory) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSourceDirectMessagesChatTopicHistory - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSourceDirectMessagesChatTopicHistory) GetClass() string { - return ClassMessageSource -} - -func (*MessageSourceDirectMessagesChatTopicHistory) GetType() string { - return TypeMessageSourceDirectMessagesChatTopicHistory -} - -func (*MessageSourceDirectMessagesChatTopicHistory) MessageSourceType() string { - return TypeMessageSourceDirectMessagesChatTopicHistory -} - // The message is from chat, message thread or forum topic history preview type MessageSourceHistoryPreview struct{ meta @@ -19658,31 +15157,31 @@ func (*MessageSourceOther) MessageSourceType() string { return TypeMessageSourceOther } -// Information about the sponsor of an advertisement -type AdvertisementSponsor struct { +// Information about the sponsor of a message +type MessageSponsor struct { meta - // URL of the sponsor to be opened when the advertisement is clicked + // URL of the sponsor to be opened when the message is clicked Url string `json:"url"` // Photo of the sponsor; may be null if must not be shown Photo *Photo `json:"photo"` - // Additional optional information about the sponsor to be shown along with the advertisement + // Additional optional information about the sponsor to be shown along with the message Info string `json:"info"` } -func (entity *AdvertisementSponsor) MarshalJSON() ([]byte, error) { +func (entity *MessageSponsor) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub AdvertisementSponsor + type stub MessageSponsor return json.Marshal((*stub)(entity)) } -func (*AdvertisementSponsor) GetClass() string { - return ClassAdvertisementSponsor +func (*MessageSponsor) GetClass() string { + return ClassMessageSponsor } -func (*AdvertisementSponsor) GetType() string { - return TypeAdvertisementSponsor +func (*MessageSponsor) GetType() string { + return TypeMessageSponsor } // Describes a sponsored message @@ -19697,7 +15196,7 @@ type SponsoredMessage struct { // Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen Content MessageContent `json:"content"` // Information about the sponsor of the message - Sponsor *AdvertisementSponsor `json:"sponsor"` + Sponsor *MessageSponsor `json:"sponsor"` // Title of the sponsored message Title string `json:"title"` // Text for the message action button @@ -19732,7 +15231,7 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { IsRecommended bool `json:"is_recommended"` CanBeReported bool `json:"can_be_reported"` Content json.RawMessage `json:"content"` - Sponsor *AdvertisementSponsor `json:"sponsor"` + Sponsor *MessageSponsor `json:"sponsor"` Title string `json:"title"` ButtonText string `json:"button_text"` AccentColorId int32 `json:"accent_color_id"` @@ -19838,70 +15337,6 @@ func (*SponsoredChats) GetType() string { return TypeSponsoredChats } -// Describes an advertisent to be shown while a video from a message is watched -type VideoMessageAdvertisement struct { - meta - // Unique identifier of this result - UniqueId int64 `json:"unique_id"` - // Text of the advertisement - Text string `json:"text"` - // The minimum amount of time the advertisement must be displayed before it can be hidden by the user, in seconds - MinDisplayDuration int32 `json:"min_display_duration"` - // The maximum amount of time the advertisement must be displayed before it must be automatically hidden, in seconds - MaxDisplayDuration int32 `json:"max_display_duration"` - // True, if the advertisement can be reported to Telegram moderators through reportVideoMessageAdvertisement - CanBeReported bool `json:"can_be_reported"` - // Information about the sponsor of the advertisement - Sponsor *AdvertisementSponsor `json:"sponsor"` - // Title of the sponsored message - Title string `json:"title"` - // If non-empty, additional information about the sponsored message to be shown along with the message - AdditionalInfo string `json:"additional_info"` -} - -func (entity *VideoMessageAdvertisement) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub VideoMessageAdvertisement - - return json.Marshal((*stub)(entity)) -} - -func (*VideoMessageAdvertisement) GetClass() string { - return ClassVideoMessageAdvertisement -} - -func (*VideoMessageAdvertisement) GetType() string { - return TypeVideoMessageAdvertisement -} - -// Contains a list of advertisements to be shown while a video from a message is watched -type VideoMessageAdvertisements struct { - meta - // List of advertisements - Advertisements []*VideoMessageAdvertisement `json:"advertisements"` - // Delay before the first advertisement is shown, in seconds - StartDelay int32 `json:"start_delay"` - // Delay between consecutive advertisements, in seconds - BetweenDelay int32 `json:"between_delay"` -} - -func (entity *VideoMessageAdvertisements) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub VideoMessageAdvertisements - - return json.Marshal((*stub)(entity)) -} - -func (*VideoMessageAdvertisements) GetClass() string { - return ClassVideoMessageAdvertisements -} - -func (*VideoMessageAdvertisements) GetType() string { - return TypeVideoMessageAdvertisements -} - // Describes an option to report an entity to Telegram type ReportOption struct { meta @@ -20239,10 +15674,10 @@ type ChatNotificationSettings struct { UseDefaultStorySound bool `json:"use_default_story_sound"` // Identifier of the notification sound to be played for stories; 0 if sound is disabled StorySoundId JsonInt64 `json:"story_sound_id"` - // If true, the value for the relevant type of chat is used instead of show_story_poster - UseDefaultShowStoryPoster bool `json:"use_default_show_story_poster"` - // True, if the chat that posted a story must be displayed in notifications - ShowStoryPoster bool `json:"show_story_poster"` + // If true, the value for the relevant type of chat is used instead of show_story_sender + UseDefaultShowStorySender bool `json:"use_default_show_story_sender"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` // If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications UseDefaultDisablePinnedMessageNotifications bool `json:"use_default_disable_pinned_message_notifications"` // If true, notifications for incoming pinned messages will be created as for an ordinary unread message @@ -20284,8 +15719,8 @@ type ScopeNotificationSettings struct { MuteStories bool `json:"mute_stories"` // Identifier of the notification sound to be played for stories; 0 if sound is disabled StorySoundId JsonInt64 `json:"story_sound_id"` - // True, if the chat that posted a story must be displayed in notifications - ShowStoryPoster bool `json:"show_story_poster"` + // True, if the sender of stories must be displayed in notifications + ShowStorySender bool `json:"show_story_sender"` // True, if notifications for incoming pinned messages will be created as for an ordinary unread message DisablePinnedMessageNotifications bool `json:"disable_pinned_message_notifications"` // True, if notifications for messages with mentions will be created as for an ordinary unread message @@ -20440,7 +15875,7 @@ func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON( // Contains information about a message draft type DraftMessage struct { meta - // Information about the message to be replied; inputMessageReplyToStory is unsupported; may be null if none + // Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none ReplyTo InputMessageReplyTo `json:"reply_to"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` @@ -20448,8 +15883,6 @@ type DraftMessage struct { InputMessageText InputMessageContent `json:"input_message_text"` // Identifier of the effect to apply to the message when it is sent; 0 if none EffectId JsonInt64 `json:"effect_id"` - // Information about the suggested post; may be null if none - SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` } func (entity *DraftMessage) MarshalJSON() ([]byte, error) { @@ -20474,7 +15907,6 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { Date int32 `json:"date"` InputMessageText json.RawMessage `json:"input_message_text"` EffectId JsonInt64 `json:"effect_id"` - SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` } err := json.Unmarshal(data, &tmp) @@ -20484,7 +15916,6 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { draftMessage.Date = tmp.Date draftMessage.EffectId = tmp.EffectId - draftMessage.SuggestedPostInfo = tmp.SuggestedPostInfo fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) draftMessage.ReplyTo = fieldReplyTo @@ -21290,7 +16721,7 @@ func (*BusinessBotManageBar) GetType() string { return TypeBusinessBotManageBar } -// Describes a video chat, i.e. a group call bound to a chat +// Describes a video chat type VideoChat struct { meta // Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall @@ -21353,8 +16784,6 @@ type Chat struct { AccentColorId int32 `json:"accent_color_id"` // Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - // Color scheme based on an upgraded gift to be used for the chat instead of accent_color_id and background_custom_emoji_id; may be null if none - UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // Identifier of the profile accent color for the chat's profile; -1 if none ProfileAccentColorId int32 `json:"profile_accent_color_id"` // Identifier of a custom emoji to be shown on the background of the chat's profile; 0 if none @@ -21365,7 +16794,7 @@ type Chat struct { LastMessage *Message `json:"last_message"` // Positions of the chat in chat lists Positions []*ChatPosition `json:"positions"` - // Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even if it doesn't belong to the chat list and have no position in a chat list even if it belongs to the chat list + // Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position in a chat list even it belongs to the chat list ChatLists []ChatList `json:"chat_lists"` // Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender MessageSenderId MessageSender `json:"message_sender_id"` @@ -21409,8 +16838,8 @@ type Chat struct { EmojiStatus *EmojiStatus `json:"emoji_status"` // Background set for the chat; may be null if none Background *ChatBackground `json:"background"` - // Theme set for the chat; may be null if none - Theme ChatTheme `json:"theme"` + // If non-empty, name of a theme, set for the chat + ThemeName string `json:"theme_name"` // Information about actions which must be possible to do through the chat action bar; may be null if none ActionBar ChatActionBar `json:"action_bar"` // Information about bar for managing a business bot in the chat; may be null if none @@ -21451,7 +16880,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Photo *ChatPhotoInfo `json:"photo"` AccentColorId int32 `json:"accent_color_id"` BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` ProfileAccentColorId int32 `json:"profile_accent_color_id"` ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"` Permissions *ChatPermissions `json:"permissions"` @@ -21479,7 +16907,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` EmojiStatus *EmojiStatus `json:"emoji_status"` Background *ChatBackground `json:"background"` - Theme json.RawMessage `json:"theme"` + ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` BusinessBotManageBar *BusinessBotManageBar `json:"business_bot_manage_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -21499,7 +16927,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Photo = tmp.Photo chat.AccentColorId = tmp.AccentColorId chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId - chat.UpgradedGiftColors = tmp.UpgradedGiftColors chat.ProfileAccentColorId = tmp.ProfileAccentColorId chat.ProfileBackgroundCustomEmojiId = tmp.ProfileBackgroundCustomEmojiId chat.Permissions = tmp.Permissions @@ -21523,6 +16950,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime chat.EmojiStatus = tmp.EmojiStatus chat.Background = tmp.Background + chat.ThemeName = tmp.ThemeName chat.BusinessBotManageBar = tmp.BusinessBotManageBar chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -21545,9 +16973,6 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { fieldAvailableReactions, _ := UnmarshalChatAvailableReactions(tmp.AvailableReactions) chat.AvailableReactions = fieldAvailableReactions - fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) - chat.Theme = fieldTheme - fieldActionBar, _ := UnmarshalChatActionBar(tmp.ActionBar) chat.ActionBar = fieldActionBar @@ -21579,7 +17004,7 @@ func (*Chats) GetType() string { return TypeChats } -// Contains information about a user who has failed to be added to a chat +// Contains information about a user that has failed to be added to a chat type FailedToAddMember struct { meta // User identifier @@ -21704,7 +17129,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// Contains basic information about another user who started a chat with the current user +// Contains basic information about another user that started a chat with the current user type AccountInfo struct { meta // Month when the user was registered in Telegram; 0-12; may be 0 if unknown @@ -21897,106 +17322,6 @@ func (*ChatActionBarJoinRequest) ChatActionBarType() string { return TypeChatActionBarJoinRequest } -// The button has default style -type ButtonStyleDefault struct{ - meta -} - -func (entity *ButtonStyleDefault) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ButtonStyleDefault - - return json.Marshal((*stub)(entity)) -} - -func (*ButtonStyleDefault) GetClass() string { - return ClassButtonStyle -} - -func (*ButtonStyleDefault) GetType() string { - return TypeButtonStyleDefault -} - -func (*ButtonStyleDefault) ButtonStyleType() string { - return TypeButtonStyleDefault -} - -// The button has dark blue color -type ButtonStylePrimary struct{ - meta -} - -func (entity *ButtonStylePrimary) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ButtonStylePrimary - - return json.Marshal((*stub)(entity)) -} - -func (*ButtonStylePrimary) GetClass() string { - return ClassButtonStyle -} - -func (*ButtonStylePrimary) GetType() string { - return TypeButtonStylePrimary -} - -func (*ButtonStylePrimary) ButtonStyleType() string { - return TypeButtonStylePrimary -} - -// The button has red color -type ButtonStyleDanger struct{ - meta -} - -func (entity *ButtonStyleDanger) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ButtonStyleDanger - - return json.Marshal((*stub)(entity)) -} - -func (*ButtonStyleDanger) GetClass() string { - return ClassButtonStyle -} - -func (*ButtonStyleDanger) GetType() string { - return TypeButtonStyleDanger -} - -func (*ButtonStyleDanger) ButtonStyleType() string { - return TypeButtonStyleDanger -} - -// The button has green color -type ButtonStyleSuccess struct{ - meta -} - -func (entity *ButtonStyleSuccess) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ButtonStyleSuccess - - return json.Marshal((*stub)(entity)) -} - -func (*ButtonStyleSuccess) GetClass() string { - return ClassButtonStyle -} - -func (*ButtonStyleSuccess) GetType() string { - return TypeButtonStyleSuccess -} - -func (*ButtonStyleSuccess) ButtonStyleType() string { - return TypeButtonStyleSuccess -} - // A simple button, with text that must be sent when the button is pressed type KeyboardButtonTypeText struct{ meta @@ -22227,10 +17552,6 @@ type KeyboardButton struct { meta // Text of the button Text string `json:"text"` - // Identifier of the custom emoji that must be shown on the button; 0 if none - IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` - // Style of the button - Style ButtonStyle `json:"style"` // Type of the button Type KeyboardButtonType `json:"type"` } @@ -22254,8 +17575,6 @@ func (*KeyboardButton) GetType() string { func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` - IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` - Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -22265,10 +17584,6 @@ func (keyboardButton *KeyboardButton) UnmarshalJSON(data []byte) error { } keyboardButton.Text = tmp.Text - keyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId - - fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) - keyboardButton.Style = fieldStyle fieldType, _ := UnmarshalKeyboardButtonType(tmp.Type) keyboardButton.Type = fieldType @@ -22572,10 +17887,6 @@ type InlineKeyboardButton struct { meta // Text of the button Text string `json:"text"` - // Identifier of the custom emoji that must be shown on the button; 0 if none - IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` - // Style of the button - Style ButtonStyle `json:"style"` // Type of the button Type InlineKeyboardButtonType `json:"type"` } @@ -22599,8 +17910,6 @@ func (*InlineKeyboardButton) GetType() string { func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) error { var tmp struct { Text string `json:"text"` - IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"` - Style json.RawMessage `json:"style"` Type json.RawMessage `json:"type"` } @@ -22610,10 +17919,6 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err } inlineKeyboardButton.Text = tmp.Text - inlineKeyboardButton.IconCustomEmojiId = tmp.IconCustomEmojiId - - fieldStyle, _ := UnmarshalButtonStyle(tmp.Style) - inlineKeyboardButton.Style = fieldStyle fieldType, _ := UnmarshalInlineKeyboardButtonType(tmp.Type) inlineKeyboardButton.Type = fieldType @@ -22781,16 +18086,6 @@ type LoginUrlInfoRequestConfirmation struct { BotUserId int64 `json:"bot_user_id"` // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` - // True, if the user must be asked for the permission to share their phone number - RequestPhoneNumberAccess bool `json:"request_phone_number_access"` - // The version of a browser used for the authorization; may be empty if irrelevant - Browser string `json:"browser"` - // Operating system the browser is running on; may be empty if irrelevant - Platform string `json:"platform"` - // IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant - IpAddress string `json:"ip_address"` - // Human-readable description of a country and a region from which the authorization is performed, based on the IP address; may be empty if irrelevant - Location string `json:"location"` } func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) { @@ -23253,90 +18548,6 @@ func (savedMessagesTopic *SavedMessagesTopic) UnmarshalJSON(data []byte) error { return nil } -// Contains information about a topic in a channel direct messages chat administered by the current user -type DirectMessagesChatTopic struct { - meta - // Identifier of the chat to which the topic belongs - ChatId int64 `json:"chat_id"` - // Unique topic identifier - Id int64 `json:"id"` - // Identifier of the user or chat that sends the messages to the topic - SenderId MessageSender `json:"sender_id"` - // A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order - Order JsonInt64 `json:"order"` - // True, if the other party can send unpaid messages even if the chat has paid messages enabled - CanSendUnpaidMessages bool `json:"can_send_unpaid_messages"` - // True, if the topic is marked as unread - IsMarkedAsUnread bool `json:"is_marked_as_unread"` - // Number of unread messages in the chat - UnreadCount int64 `json:"unread_count"` - // Identifier of the last read incoming message - LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` - // Identifier of the last read outgoing message - LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` - // Number of messages with unread reactions in the chat - UnreadReactionCount int64 `json:"unread_reaction_count"` - // Last message in the topic; may be null if none or unknown - LastMessage *Message `json:"last_message"` - // A draft of a message in the topic; may be null if none - DraftMessage *DraftMessage `json:"draft_message"` -} - -func (entity *DirectMessagesChatTopic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub DirectMessagesChatTopic - - return json.Marshal((*stub)(entity)) -} - -func (*DirectMessagesChatTopic) GetClass() string { - return ClassDirectMessagesChatTopic -} - -func (*DirectMessagesChatTopic) GetType() string { - return TypeDirectMessagesChatTopic -} - -func (directMessagesChatTopic *DirectMessagesChatTopic) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - Id int64 `json:"id"` - SenderId json.RawMessage `json:"sender_id"` - Order JsonInt64 `json:"order"` - CanSendUnpaidMessages bool `json:"can_send_unpaid_messages"` - IsMarkedAsUnread bool `json:"is_marked_as_unread"` - UnreadCount int64 `json:"unread_count"` - LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` - LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` - UnreadReactionCount int64 `json:"unread_reaction_count"` - LastMessage *Message `json:"last_message"` - DraftMessage *DraftMessage `json:"draft_message"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - directMessagesChatTopic.ChatId = tmp.ChatId - directMessagesChatTopic.Id = tmp.Id - directMessagesChatTopic.Order = tmp.Order - directMessagesChatTopic.CanSendUnpaidMessages = tmp.CanSendUnpaidMessages - directMessagesChatTopic.IsMarkedAsUnread = tmp.IsMarkedAsUnread - directMessagesChatTopic.UnreadCount = tmp.UnreadCount - directMessagesChatTopic.LastReadInboxMessageId = tmp.LastReadInboxMessageId - directMessagesChatTopic.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId - directMessagesChatTopic.UnreadReactionCount = tmp.UnreadReactionCount - directMessagesChatTopic.LastMessage = tmp.LastMessage - directMessagesChatTopic.DraftMessage = tmp.DraftMessage - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - directMessagesChatTopic.SenderId = fieldSenderId - - return nil -} - // Describes a forum topic icon type ForumTopicIcon struct { meta @@ -23365,10 +18576,10 @@ func (*ForumTopicIcon) GetType() string { // Contains basic information about a forum topic type ForumTopicInfo struct { meta - // Identifier of a forum supergroup chat or a chat with a bot to which the topic belongs + // Identifier of the forum chat to which the topic belongs ChatId int64 `json:"chat_id"` - // Forum topic identifier of the topic - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the topic + MessageThreadId int64 `json:"message_thread_id"` // Name of the topic Name string `json:"name"` // Icon of the topic @@ -23377,16 +18588,14 @@ type ForumTopicInfo struct { CreationDate int32 `json:"creation_date"` // Identifier of the creator of the topic CreatorId MessageSender `json:"creator_id"` - // True, if the topic is the General topic + // True, if the topic is the General topic list IsGeneral bool `json:"is_general"` // True, if the topic was created by the current user IsOutgoing bool `json:"is_outgoing"` - // True, if the topic is closed. If the topic is closed, then the user must have can_manage_topics administrator right in the supergroup or must be the creator of the topic to send messages there + // True, if the topic is closed IsClosed bool `json:"is_closed"` // True, if the topic is hidden above the topic list and closed; for General topic only IsHidden bool `json:"is_hidden"` - // True, if the name of the topic wasn't added explicitly - IsNameImplicit bool `json:"is_name_implicit"` } func (entity *ForumTopicInfo) MarshalJSON() ([]byte, error) { @@ -23408,7 +18617,7 @@ func (*ForumTopicInfo) GetType() string { func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` - ForumTopicId int32 `json:"forum_topic_id"` + MessageThreadId int64 `json:"message_thread_id"` Name string `json:"name"` Icon *ForumTopicIcon `json:"icon"` CreationDate int32 `json:"creation_date"` @@ -23417,7 +18626,6 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { IsOutgoing bool `json:"is_outgoing"` IsClosed bool `json:"is_closed"` IsHidden bool `json:"is_hidden"` - IsNameImplicit bool `json:"is_name_implicit"` } err := json.Unmarshal(data, &tmp) @@ -23426,7 +18634,7 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { } forumTopicInfo.ChatId = tmp.ChatId - forumTopicInfo.ForumTopicId = tmp.ForumTopicId + forumTopicInfo.MessageThreadId = tmp.MessageThreadId forumTopicInfo.Name = tmp.Name forumTopicInfo.Icon = tmp.Icon forumTopicInfo.CreationDate = tmp.CreationDate @@ -23434,7 +18642,6 @@ func (forumTopicInfo *ForumTopicInfo) UnmarshalJSON(data []byte) error { forumTopicInfo.IsOutgoing = tmp.IsOutgoing forumTopicInfo.IsClosed = tmp.IsClosed forumTopicInfo.IsHidden = tmp.IsHidden - forumTopicInfo.IsNameImplicit = tmp.IsNameImplicit fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) forumTopicInfo.CreatorId = fieldCreatorId @@ -23496,8 +18703,8 @@ type ForumTopics struct { NextOffsetDate int32 `json:"next_offset_date"` // Offset message identifier for the next getForumTopics request NextOffsetMessageId int64 `json:"next_offset_message_id"` - // Offset forum topic identifier for the next getForumTopics request - NextOffsetForumTopicId int32 `json:"next_offset_forum_topic_id"` + // Offset message thread identifier for the next getForumTopics request + NextOffsetMessageThreadId int64 `json:"next_offset_message_thread_id"` } func (entity *ForumTopics) MarshalJSON() ([]byte, error) { @@ -23607,141 +18814,14 @@ func (*SharedChat) GetType() string { return TypeSharedChat } -// Classic light theme -type BuiltInThemeClassic struct{ - meta -} - -func (entity *BuiltInThemeClassic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BuiltInThemeClassic - - return json.Marshal((*stub)(entity)) -} - -func (*BuiltInThemeClassic) GetClass() string { - return ClassBuiltInTheme -} - -func (*BuiltInThemeClassic) GetType() string { - return TypeBuiltInThemeClassic -} - -func (*BuiltInThemeClassic) BuiltInThemeType() string { - return TypeBuiltInThemeClassic -} - -// Regular light theme -type BuiltInThemeDay struct{ - meta -} - -func (entity *BuiltInThemeDay) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BuiltInThemeDay - - return json.Marshal((*stub)(entity)) -} - -func (*BuiltInThemeDay) GetClass() string { - return ClassBuiltInTheme -} - -func (*BuiltInThemeDay) GetType() string { - return TypeBuiltInThemeDay -} - -func (*BuiltInThemeDay) BuiltInThemeType() string { - return TypeBuiltInThemeDay -} - -// Regular dark theme -type BuiltInThemeNight struct{ - meta -} - -func (entity *BuiltInThemeNight) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BuiltInThemeNight - - return json.Marshal((*stub)(entity)) -} - -func (*BuiltInThemeNight) GetClass() string { - return ClassBuiltInTheme -} - -func (*BuiltInThemeNight) GetType() string { - return TypeBuiltInThemeNight -} - -func (*BuiltInThemeNight) BuiltInThemeType() string { - return TypeBuiltInThemeNight -} - -// Tinted dark theme -type BuiltInThemeTinted struct{ - meta -} - -func (entity *BuiltInThemeTinted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BuiltInThemeTinted - - return json.Marshal((*stub)(entity)) -} - -func (*BuiltInThemeTinted) GetClass() string { - return ClassBuiltInTheme -} - -func (*BuiltInThemeTinted) GetType() string { - return TypeBuiltInThemeTinted -} - -func (*BuiltInThemeTinted) BuiltInThemeType() string { - return TypeBuiltInThemeTinted -} - -// Arctic light theme -type BuiltInThemeArctic struct{ - meta -} - -func (entity *BuiltInThemeArctic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub BuiltInThemeArctic - - return json.Marshal((*stub)(entity)) -} - -func (*BuiltInThemeArctic) GetClass() string { - return ClassBuiltInTheme -} - -func (*BuiltInThemeArctic) GetType() string { - return TypeBuiltInThemeArctic -} - -func (*BuiltInThemeArctic) BuiltInThemeType() string { - return TypeBuiltInThemeArctic -} - // Describes theme settings type ThemeSettings struct { meta - // Base theme for this theme - BaseTheme BuiltInTheme `json:"base_theme"` // Theme accent color in ARGB format AccentColor int32 `json:"accent_color"` // The background to be used in chats; may be null Background *Background `json:"background"` - // The fill to be used as a background for outgoing messages; may be null if the fill from the base theme must be used instead + // The fill to be used as a background for outgoing messages OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` // If true, the freeform gradient fill needs to be animated on every sent message AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` @@ -23767,7 +18847,6 @@ func (*ThemeSettings) GetType() string { func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { var tmp struct { - BaseTheme json.RawMessage `json:"base_theme"` AccentColor int32 `json:"accent_color"` Background *Background `json:"background"` OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` @@ -23785,9 +18864,6 @@ func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor - fieldBaseTheme, _ := UnmarshalBuiltInTheme(tmp.BaseTheme) - themeSettings.BaseTheme = fieldBaseTheme - fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill @@ -26450,33 +21526,6 @@ func (linkPreviewTypeChat *LinkPreviewTypeChat) UnmarshalJSON(data []byte) error return nil } -// The link is a link to a direct messages chat of a channel -type LinkPreviewTypeDirectMessagesChat struct { - meta - // Photo of the channel chat; may be null - Photo *ChatPhoto `json:"photo"` -} - -func (entity *LinkPreviewTypeDirectMessagesChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkPreviewTypeDirectMessagesChat - - return json.Marshal((*stub)(entity)) -} - -func (*LinkPreviewTypeDirectMessagesChat) GetClass() string { - return ClassLinkPreviewType -} - -func (*LinkPreviewTypeDirectMessagesChat) GetType() string { - return TypeLinkPreviewTypeDirectMessagesChat -} - -func (*LinkPreviewTypeDirectMessagesChat) LinkPreviewTypeType() string { - return TypeLinkPreviewTypeDirectMessagesChat -} - // The link is a link to a general file type LinkPreviewTypeDocument struct { meta @@ -26675,87 +21724,6 @@ 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 - // Icons for some gifts from the collection; may be empty - Icons []*Sticker `json:"icons"` -} - -func (entity *LinkPreviewTypeGiftCollection) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkPreviewTypeGiftCollection - - return json.Marshal((*stub)(entity)) -} - -func (*LinkPreviewTypeGiftCollection) GetClass() string { - return ClassLinkPreviewType -} - -func (*LinkPreviewTypeGiftCollection) GetType() string { - return TypeLinkPreviewTypeGiftCollection -} - -func (*LinkPreviewTypeGiftCollection) LinkPreviewTypeType() string { - return TypeLinkPreviewTypeGiftCollection -} - -// The link is a link to a group call that isn't bound to a chat -type LinkPreviewTypeGroupCall struct{ - meta -} - -func (entity *LinkPreviewTypeGroupCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkPreviewTypeGroupCall - - return json.Marshal((*stub)(entity)) -} - -func (*LinkPreviewTypeGroupCall) GetClass() string { - return ClassLinkPreviewType -} - -func (*LinkPreviewTypeGroupCall) GetType() string { - return TypeLinkPreviewTypeGroupCall -} - -func (*LinkPreviewTypeGroupCall) LinkPreviewTypeType() string { - return TypeLinkPreviewTypeGroupCall -} - // The link is a link to an invoice type LinkPreviewTypeInvoice struct{ meta @@ -26781,35 +21749,6 @@ 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 @@ -26970,7 +21909,7 @@ func (*LinkPreviewTypeStickerSet) LinkPreviewTypeType() string { type LinkPreviewTypeStory struct { meta // The identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` } @@ -26995,35 +21934,6 @@ func (*LinkPreviewTypeStory) LinkPreviewTypeType() string { return TypeLinkPreviewTypeStory } -// The link is a link to an album of stories -type LinkPreviewTypeStoryAlbum struct { - meta - // Icon of the album; may be null if none - PhotoIcon *Photo `json:"photo_icon"` - // Video icon of the album; may be null if none - VideoIcon *Video `json:"video_icon"` -} - -func (entity *LinkPreviewTypeStoryAlbum) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub LinkPreviewTypeStoryAlbum - - return json.Marshal((*stub)(entity)) -} - -func (*LinkPreviewTypeStoryAlbum) GetClass() string { - return ClassLinkPreviewType -} - -func (*LinkPreviewTypeStoryAlbum) GetType() string { - return TypeLinkPreviewTypeStoryAlbum -} - -func (*LinkPreviewTypeStoryAlbum) LinkPreviewTypeType() string { - return TypeLinkPreviewTypeStoryAlbum -} - // The link is a link to boost a supergroup chat type LinkPreviewTypeSupergroupBoost struct { meta @@ -27199,8 +22109,6 @@ type LinkPreviewTypeVideoChat struct { Photo *ChatPhoto `json:"photo"` // True, if the video chat is expected to be a live stream in a channel or a broadcast group IsLiveStream bool `json:"is_live_stream"` - // True, if the user can use the link to join the video chat without being muted by administrators - JoinsAsSpeaker bool `json:"joins_as_speaker"` } func (entity *LinkPreviewTypeVideoChat) MarshalJSON() ([]byte, error) { @@ -28619,7 +23527,7 @@ func (*PaidMediaUnsupported) PaidMediaType() string { // Describes parameters of a giveaway type GiveawayParameters struct { meta - // Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Telegram Premium subscription, or for the specified time. If the chat is a channel, then can_post_messages administrator right is required in the channel, otherwise, the user must be an administrator in the supergroup + // Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Telegram Premium subscription, or for the specified time. If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an administrator in the supergroup BoostedChatId int64 `json:"boosted_chat_id"` // Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats AdditionalChatIds []int64 `json:"additional_chat_ids"` @@ -31051,8 +25959,6 @@ type MessageVideo struct { Video *Video `json:"video"` // Alternative qualities of the video AlternativeVideos []*AlternativeVideo `json:"alternative_videos"` - // Available storyboards for the video - Storyboards []*VideoStoryboard `json:"storyboards"` // Cover of the video; may be null if none Cover *Photo `json:"cover"` // Timestamp from which the video playing must start, in seconds @@ -31376,7 +26282,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, then the dice don't have final state yet + // The dice value. If the value is 0, 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"` @@ -31483,73 +26389,11 @@ 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 Toncoin amount that was staked; in the smallest units of the currency - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // The Toncoin amount that was gained from the roll; in the smallest units of the currency; -1 if the dice don't have final state yet - 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 // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` // True, if the story was automatically forwarded because of a mention of the user @@ -31576,33 +26420,6 @@ func (*MessageStory) MessageContentType() string { return TypeMessageStory } -// A message with a checklist -type MessageChecklist struct { - meta - // The checklist description - List *Checklist `json:"list"` -} - -func (entity *MessageChecklist) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChecklist - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChecklist) GetClass() string { - return ClassMessageContent -} - -func (*MessageChecklist) GetType() string { - return TypeMessageChecklist -} - -func (*MessageChecklist) MessageContentType() string { - return TypeMessageChecklist -} - // A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice type MessageInvoice struct { meta @@ -31731,70 +26548,6 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error { return nil } -// A message with information about a group call not bound to a chat. If the message is incoming, the call isn't active, isn't missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden -type MessageGroupCall struct { - meta - // Persistent unique group call identifier - UniqueId JsonInt64 `json:"unique_id"` - // True, if the call is active, i.e. the called user joined the call - IsActive bool `json:"is_active"` - // True, if the called user missed or declined the call - WasMissed bool `json:"was_missed"` - // True, if the call is a video call - IsVideo bool `json:"is_video"` - // Call duration, in seconds; for left calls only - Duration int32 `json:"duration"` - // Identifiers of some other call participants - OtherParticipantIds []MessageSender `json:"other_participant_ids"` -} - -func (entity *MessageGroupCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageGroupCall - - return json.Marshal((*stub)(entity)) -} - -func (*MessageGroupCall) GetClass() string { - return ClassMessageContent -} - -func (*MessageGroupCall) GetType() string { - return TypeMessageGroupCall -} - -func (*MessageGroupCall) MessageContentType() string { - return TypeMessageGroupCall -} - -func (messageGroupCall *MessageGroupCall) UnmarshalJSON(data []byte) error { - var tmp struct { - UniqueId JsonInt64 `json:"unique_id"` - IsActive bool `json:"is_active"` - WasMissed bool `json:"was_missed"` - IsVideo bool `json:"is_video"` - Duration int32 `json:"duration"` - OtherParticipantIds []json.RawMessage `json:"other_participant_ids"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageGroupCall.UniqueId = tmp.UniqueId - messageGroupCall.IsActive = tmp.IsActive - messageGroupCall.WasMissed = tmp.WasMissed - messageGroupCall.IsVideo = tmp.IsVideo - messageGroupCall.Duration = tmp.Duration - - fieldOtherParticipantIds, _ := UnmarshalListOfMessageSender(tmp.OtherParticipantIds) - messageGroupCall.OtherParticipantIds = fieldOtherParticipantIds - - return nil -} - // A new video chat was scheduled type MessageVideoChatScheduled struct { meta @@ -32042,60 +26795,6 @@ func (*MessageChatDeletePhoto) MessageContentType() string { return TypeMessageChatDeletePhoto } -// The owner of the chat has left -type MessageChatOwnerLeft struct { - meta - // Identifier of the user who will become the new owner of the chat if the previous owner isn't return; 0 if none - NewOwnerUserId int64 `json:"new_owner_user_id"` -} - -func (entity *MessageChatOwnerLeft) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatOwnerLeft - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatOwnerLeft) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatOwnerLeft) GetType() string { - return TypeMessageChatOwnerLeft -} - -func (*MessageChatOwnerLeft) MessageContentType() string { - return TypeMessageChatOwnerLeft -} - -// The owner of the chat has changed -type MessageChatOwnerChanged struct { - meta - // Identifier of the user who is the new owner of the chat - NewOwnerUserId int64 `json:"new_owner_user_id"` -} - -func (entity *MessageChatOwnerChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChatOwnerChanged - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChatOwnerChanged) GetClass() string { - return ClassMessageContent -} - -func (*MessageChatOwnerChanged) GetType() string { - return TypeMessageChatOwnerChanged -} - -func (*MessageChatOwnerChanged) MessageContentType() string { - return TypeMessageChatOwnerChanged -} - // New chat members were added type MessageChatAddMembers struct { meta @@ -32342,8 +27041,8 @@ func (*MessageChatSetBackground) MessageContentType() string { // A theme in the chat has been changed type MessageChatSetTheme struct { meta - // New theme for the chat; may be null if chat theme was reset to the default one - Theme ChatTheme `json:"theme"` + // If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one + ThemeName string `json:"theme_name"` } func (entity *MessageChatSetTheme) MarshalJSON() ([]byte, error) { @@ -32366,22 +27065,6 @@ func (*MessageChatSetTheme) MessageContentType() string { return TypeMessageChatSetTheme } -func (messageChatSetTheme *MessageChatSetTheme) UnmarshalJSON(data []byte) error { - var tmp struct { - Theme json.RawMessage `json:"theme"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) - messageChatSetTheme.Theme = fieldTheme - - return nil -} - // The auto-delete or self-destruct timer for messages in the chat has been changed type MessageChatSetMessageAutoDeleteTime struct { meta @@ -32443,8 +27126,6 @@ type MessageForumTopicCreated struct { meta // Name of the topic Name string `json:"name"` - // True, if the name of the topic wasn't added explicitly - IsNameImplicit bool `json:"is_name_implicit"` // Icon of the topic Icon *ForumTopicIcon `json:"icon"` } @@ -32581,33 +27262,6 @@ func (*MessageSuggestProfilePhoto) MessageContentType() string { return TypeMessageSuggestProfilePhoto } -// A birthdate was suggested to be set -type MessageSuggestBirthdate struct { - meta - // The suggested birthdate. Use the method setBirthdate to apply the birthdate - Birthdate *Birthdate `json:"birthdate"` -} - -func (entity *MessageSuggestBirthdate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestBirthdate - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestBirthdate) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestBirthdate) GetType() string { - return TypeMessageSuggestBirthdate -} - -func (*MessageSuggestBirthdate) MessageContentType() string { - return TypeMessageSuggestBirthdate -} - // A non-standard action has happened in the chat type MessageCustomServiceAction struct { meta @@ -32671,7 +27325,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; may be 0 or an identifier of a deleted message + // Identifier of the message with the corresponding invoice; can 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"` @@ -32819,9 +27473,9 @@ func (messagePaymentRefunded *MessagePaymentRefunded) UnmarshalJSON(data []byte) // Telegram Premium was gifted to a user type MessageGiftedPremium struct { meta - // The identifier of a user who gifted Telegram Premium; 0 if the gift was anonymous or is outgoing + // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user who received Telegram Premium; 0 if the gift is incoming + // The identifier of a user that received Telegram Premium; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Message added to the gifted Telegram Premium by the sender Text *FormattedText `json:"text"` @@ -32833,10 +27487,8 @@ 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 after code activation; 0 if the number of months isn't integer + // Number of months the Telegram Premium subscription will be active 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"` } @@ -32864,7 +27516,7 @@ func (*MessageGiftedPremium) MessageContentType() string { // A Telegram Premium gift code was created for the user type MessagePremiumGiftCode struct { meta - // Identifier of a chat or a user who created the gift code; may be null if unknown + // Identifier of a chat or a user that created the gift code; may be null if unknown CreatorId MessageSender `json:"creator_id"` // Message added to the gift Text *FormattedText `json:"text"` @@ -32880,10 +27532,8 @@ 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; 0 if the number of months isn't integer + // Number of months the Telegram Premium subscription will be active after code activation 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 @@ -32921,7 +27571,6 @@ 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"` } @@ -32939,7 +27588,6 @@ 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 @@ -33035,7 +27683,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; may be 0 or an identifier of a deleted message + // Identifier of the message with the giveaway; can be 0 if the message was deleted GiveawayMessageId int64 `json:"giveaway_message_id"` // Number of winners in the giveaway WinnerCount int32 `json:"winner_count"` @@ -33152,9 +27800,9 @@ func (messageGiveawayWinners *MessageGiveawayWinners) UnmarshalJSON(data []byte) // Telegram Stars were gifted to a user type MessageGiftedStars struct { meta - // The identifier of a user who gifted Telegram Stars; 0 if the gift was anonymous or is outgoing + // The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user who received Telegram Stars; 0 if the gift is incoming + // The identifier of a user that received Telegram Stars; 0 if the gift is incoming ReceiverUserId int64 `json:"receiver_user_id"` // Currency for the paid amount Currency string `json:"currency"` @@ -33192,41 +27840,6 @@ func (*MessageGiftedStars) MessageContentType() string { return TypeMessageGiftedStars } -// Toncoins were gifted to a user -type MessageGiftedTon struct { - meta - // The identifier of a user who gifted Toncoins; 0 if the gift was anonymous or is outgoing - GifterUserId int64 `json:"gifter_user_id"` - // The identifier of a user who received Toncoins; 0 if the gift is incoming - ReceiverUserId int64 `json:"receiver_user_id"` - // The received Toncoin amount, in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` - // Identifier of the transaction for Toncoin credit; for receiver only - TransactionId string `json:"transaction_id"` - // A sticker to be shown in the message; may be null if unknown - Sticker *Sticker `json:"sticker"` -} - -func (entity *MessageGiftedTon) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageGiftedTon - - return json.Marshal((*stub)(entity)) -} - -func (*MessageGiftedTon) GetClass() string { - return ClassMessageContent -} - -func (*MessageGiftedTon) GetType() string { - return TypeMessageGiftedTon -} - -func (*MessageGiftedTon) MessageContentType() string { - return TypeMessageGiftedTon -} - // A Telegram Stars were received by the current user from a giveaway type MessageGiveawayPrizeStars struct { meta @@ -33236,7 +27849,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; may be 0 or an identifier of a deleted message + // Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted 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"` @@ -33269,30 +27882,20 @@ type MessageGift struct { meta // The gift Gift *Gift `json:"gift"` - // Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users + // Sender of the gift SenderId MessageSender `json:"sender_id"` - // Receiver of the gift - ReceiverId MessageSender `json:"receiver_id"` // Unique identifier of the received gift for the current user; only for the receiver of the gift 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 IsSaved bool `json:"is_saved"` - // True, if the message is about prepaid upgrade of the gift by another user - IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` // True, if the gift can be upgraded to a unique gift; only for the receiver of the gift CanBeUpgraded bool `json:"can_be_upgraded"` // True, if the gift was converted to Telegram Stars; only for the receiver of the gift @@ -33303,8 +27906,6 @@ type MessageGift struct { WasRefunded bool `json:"was_refunded"` // Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift UpgradedReceivedGiftId string `json:"upgraded_received_gift_id"` - // If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade - PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` } func (entity *MessageGift) MarshalJSON() ([]byte, error) { @@ -33331,23 +27932,17 @@ func (messageGift *MessageGift) UnmarshalJSON(data []byte) error { var tmp struct { Gift *Gift `json:"gift"` SenderId json.RawMessage `json:"sender_id"` - 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"` CanBeUpgraded bool `json:"can_be_upgraded"` WasConverted bool `json:"was_converted"` WasUpgraded bool `json:"was_upgraded"` WasRefunded bool `json:"was_refunded"` UpgradedReceivedGiftId string `json:"upgraded_received_gift_id"` - PrepaidUpgradeHash string `json:"prepaid_upgrade_hash"` } err := json.Unmarshal(data, &tmp) @@ -33358,27 +27953,19 @@ 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 messageGift.CanBeUpgraded = tmp.CanBeUpgraded messageGift.WasConverted = tmp.WasConverted messageGift.WasUpgraded = tmp.WasUpgraded messageGift.WasRefunded = tmp.WasRefunded messageGift.UpgradedReceivedGiftId = tmp.UpgradedReceivedGiftId - messageGift.PrepaidUpgradeHash = tmp.PrepaidUpgradeHash fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageGift.SenderId = fieldSenderId - fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) - messageGift.ReceiverId = fieldReceiverId - return nil } @@ -33389,30 +27976,20 @@ type MessageUpgradedGift struct { Gift *UpgradedGift `json:"gift"` // Sender of the gift; may be null for anonymous gifts SenderId MessageSender `json:"sender_id"` - // Receiver of the gift - ReceiverId MessageSender `json:"receiver_id"` - // Origin of the upgraded gift - Origin UpgradedGiftOrigin `json:"origin"` // Unique identifier of the received gift for the current user; only for the receiver of the gift ReceivedGiftId string `json:"received_gift_id"` + // True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift + IsUpgrade bool `json:"is_upgrade"` // True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift IsSaved bool `json:"is_saved"` // True, if the gift can be transferred to another owner; only for the receiver of the gift CanBeTransferred bool `json:"can_be_transferred"` - // True, if the gift has already been transferred to another owner; only for the receiver of the gift + // True, if the gift was transferred to another owner; only for the receiver of the gift WasTransferred bool `json:"was_transferred"` // Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift TransferStarCount int64 `json:"transfer_star_count"` - // Number of Telegram Stars that must be paid to drop original details of the upgraded gift; 0 if not available; only for the receiver of the gift - DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` - // Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn't possible; only for the receiver of the gift - NextTransferDate int32 `json:"next_transfer_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 - NextResaleDate int32 `json:"next_resale_date"` - // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn't possible; only for the receiver of the gift + // Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift ExportDate int32 `json:"export_date"` - // Point in time (Unix timestamp) when the gift can be used to craft another gift can be in the past; only for the receiver of the gift - CraftDate int32 `json:"craft_date"` } func (entity *MessageUpgradedGift) MarshalJSON() ([]byte, error) { @@ -33439,18 +28016,13 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error var tmp struct { Gift *UpgradedGift `json:"gift"` SenderId json.RawMessage `json:"sender_id"` - ReceiverId json.RawMessage `json:"receiver_id"` - Origin json.RawMessage `json:"origin"` ReceivedGiftId string `json:"received_gift_id"` + IsUpgrade bool `json:"is_upgrade"` IsSaved bool `json:"is_saved"` CanBeTransferred bool `json:"can_be_transferred"` WasTransferred bool `json:"was_transferred"` TransferStarCount int64 `json:"transfer_star_count"` - DropOriginalDetailsStarCount int64 `json:"drop_original_details_star_count"` - NextTransferDate int32 `json:"next_transfer_date"` - NextResaleDate int32 `json:"next_resale_date"` ExportDate int32 `json:"export_date"` - CraftDate int32 `json:"craft_date"` } err := json.Unmarshal(data, &tmp) @@ -33460,25 +28032,16 @@ func (messageUpgradedGift *MessageUpgradedGift) UnmarshalJSON(data []byte) error messageUpgradedGift.Gift = tmp.Gift messageUpgradedGift.ReceivedGiftId = tmp.ReceivedGiftId + messageUpgradedGift.IsUpgrade = tmp.IsUpgrade messageUpgradedGift.IsSaved = tmp.IsSaved messageUpgradedGift.CanBeTransferred = tmp.CanBeTransferred messageUpgradedGift.WasTransferred = tmp.WasTransferred messageUpgradedGift.TransferStarCount = tmp.TransferStarCount - messageUpgradedGift.DropOriginalDetailsStarCount = tmp.DropOriginalDetailsStarCount - messageUpgradedGift.NextTransferDate = tmp.NextTransferDate - messageUpgradedGift.NextResaleDate = tmp.NextResaleDate messageUpgradedGift.ExportDate = tmp.ExportDate - messageUpgradedGift.CraftDate = tmp.CraftDate fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageUpgradedGift.SenderId = fieldSenderId - fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) - messageUpgradedGift.ReceiverId = fieldReceiverId - - fieldOrigin, _ := UnmarshalUpgradedGiftOrigin(tmp.Origin) - messageUpgradedGift.Origin = fieldOrigin - return nil } @@ -33489,10 +28052,8 @@ type MessageRefundedUpgradedGift struct { Gift *Gift `json:"gift"` // Sender of the gift SenderId MessageSender `json:"sender_id"` - // Receiver of the gift - ReceiverId MessageSender `json:"receiver_id"` - // Origin of the upgraded gift - Origin UpgradedGiftOrigin `json:"origin"` + // True, if the gift was obtained by upgrading of a previously received gift + IsUpgrade bool `json:"is_upgrade"` } func (entity *MessageRefundedUpgradedGift) MarshalJSON() ([]byte, error) { @@ -33519,8 +28080,7 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da var tmp struct { Gift *Gift `json:"gift"` SenderId json.RawMessage `json:"sender_id"` - ReceiverId json.RawMessage `json:"receiver_id"` - Origin json.RawMessage `json:"origin"` + IsUpgrade bool `json:"is_upgrade"` } err := json.Unmarshal(data, &tmp) @@ -33529,130 +28089,11 @@ func (messageRefundedUpgradedGift *MessageRefundedUpgradedGift) UnmarshalJSON(da } messageRefundedUpgradedGift.Gift = tmp.Gift + messageRefundedUpgradedGift.IsUpgrade = tmp.IsUpgrade fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) messageRefundedUpgradedGift.SenderId = fieldSenderId - fieldReceiverId, _ := UnmarshalMessageSender(tmp.ReceiverId) - messageRefundedUpgradedGift.ReceiverId = fieldReceiverId - - fieldOrigin, _ := UnmarshalUpgradedGiftOrigin(tmp.Origin) - messageRefundedUpgradedGift.Origin = fieldOrigin - - 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 } @@ -33712,303 +28153,6 @@ func (*MessagePaidMessagePriceChanged) MessageContentType() string { return TypeMessagePaidMessagePriceChanged } -// A price for direct messages was changed in the channel chat -type MessageDirectMessagePriceChanged struct { - meta - // True, if direct messages group was enabled for the channel; false otherwise - IsEnabled bool `json:"is_enabled"` - // The new number of Telegram Stars that must be paid by non-administrator users of the channel chat for each message sent to the direct messages group; 0 if the direct messages group was disabled or the messages are free - PaidMessageStarCount int64 `json:"paid_message_star_count"` -} - -func (entity *MessageDirectMessagePriceChanged) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageDirectMessagePriceChanged - - return json.Marshal((*stub)(entity)) -} - -func (*MessageDirectMessagePriceChanged) GetClass() string { - return ClassMessageContent -} - -func (*MessageDirectMessagePriceChanged) GetType() string { - return TypeMessageDirectMessagePriceChanged -} - -func (*MessageDirectMessagePriceChanged) MessageContentType() string { - return TypeMessageDirectMessagePriceChanged -} - -// Some tasks from a checklist were marked as done or not done -type MessageChecklistTasksDone struct { - meta - // 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"` - // Identifiers of tasks that were marked as not done - MarkedAsNotDoneTaskIds []int32 `json:"marked_as_not_done_task_ids"` -} - -func (entity *MessageChecklistTasksDone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChecklistTasksDone - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChecklistTasksDone) GetClass() string { - return ClassMessageContent -} - -func (*MessageChecklistTasksDone) GetType() string { - return TypeMessageChecklistTasksDone -} - -func (*MessageChecklistTasksDone) MessageContentType() string { - return TypeMessageChecklistTasksDone -} - -// Some tasks were added to a checklist -type MessageChecklistTasksAdded struct { - meta - // 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"` -} - -func (entity *MessageChecklistTasksAdded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageChecklistTasksAdded - - return json.Marshal((*stub)(entity)) -} - -func (*MessageChecklistTasksAdded) GetClass() string { - return ClassMessageContent -} - -func (*MessageChecklistTasksAdded) GetType() string { - return TypeMessageChecklistTasksAdded -} - -func (*MessageChecklistTasksAdded) MessageContentType() string { - return TypeMessageChecklistTasksAdded -} - -// 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; 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"` -} - -func (entity *MessageSuggestedPostApprovalFailed) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestedPostApprovalFailed - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestedPostApprovalFailed) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestedPostApprovalFailed) GetType() string { - return TypeMessageSuggestedPostApprovalFailed -} - -func (*MessageSuggestedPostApprovalFailed) MessageContentType() string { - return TypeMessageSuggestedPostApprovalFailed -} - -func (messageSuggestedPostApprovalFailed *MessageSuggestedPostApprovalFailed) UnmarshalJSON(data []byte) error { - var tmp struct { - SuggestedPostMessageId int64 `json:"suggested_post_message_id"` - Price json.RawMessage `json:"price"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageSuggestedPostApprovalFailed.SuggestedPostMessageId = tmp.SuggestedPostMessageId - - fieldPrice, _ := UnmarshalSuggestedPostPrice(tmp.Price) - messageSuggestedPostApprovalFailed.Price = fieldPrice - - return nil -} - -// A suggested post was approved -type MessageSuggestedPostApproved struct { - meta - // 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"` - // Point in time (Unix timestamp) when the post is expected to be published - SendDate int32 `json:"send_date"` -} - -func (entity *MessageSuggestedPostApproved) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestedPostApproved - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestedPostApproved) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestedPostApproved) GetType() string { - return TypeMessageSuggestedPostApproved -} - -func (*MessageSuggestedPostApproved) MessageContentType() string { - return TypeMessageSuggestedPostApproved -} - -func (messageSuggestedPostApproved *MessageSuggestedPostApproved) UnmarshalJSON(data []byte) error { - var tmp struct { - SuggestedPostMessageId int64 `json:"suggested_post_message_id"` - Price json.RawMessage `json:"price"` - SendDate int32 `json:"send_date"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageSuggestedPostApproved.SuggestedPostMessageId = tmp.SuggestedPostMessageId - messageSuggestedPostApproved.SendDate = tmp.SendDate - - fieldPrice, _ := UnmarshalSuggestedPostPrice(tmp.Price) - messageSuggestedPostApproved.Price = fieldPrice - - return nil -} - -// A suggested post was declined -type MessageSuggestedPostDeclined struct { - meta - // 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"` -} - -func (entity *MessageSuggestedPostDeclined) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestedPostDeclined - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestedPostDeclined) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestedPostDeclined) GetType() string { - return TypeMessageSuggestedPostDeclined -} - -func (*MessageSuggestedPostDeclined) MessageContentType() string { - return TypeMessageSuggestedPostDeclined -} - -// 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; 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"` - // The amount of received Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` -} - -func (entity *MessageSuggestedPostPaid) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestedPostPaid - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestedPostPaid) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestedPostPaid) GetType() string { - return TypeMessageSuggestedPostPaid -} - -func (*MessageSuggestedPostPaid) MessageContentType() string { - return TypeMessageSuggestedPostPaid -} - -// A suggested post was refunded -type MessageSuggestedPostRefunded struct { - meta - // 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"` -} - -func (entity *MessageSuggestedPostRefunded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageSuggestedPostRefunded - - return json.Marshal((*stub)(entity)) -} - -func (*MessageSuggestedPostRefunded) GetClass() string { - return ClassMessageContent -} - -func (*MessageSuggestedPostRefunded) GetType() string { - return TypeMessageSuggestedPostRefunded -} - -func (*MessageSuggestedPostRefunded) MessageContentType() string { - return TypeMessageSuggestedPostRefunded -} - -func (messageSuggestedPostRefunded *MessageSuggestedPostRefunded) UnmarshalJSON(data []byte) error { - var tmp struct { - SuggestedPostMessageId int64 `json:"suggested_post_message_id"` - Reason json.RawMessage `json:"reason"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageSuggestedPostRefunded.SuggestedPostMessageId = tmp.SuggestedPostMessageId - - fieldReason, _ := UnmarshalSuggestedPostRefundReason(tmp.Reason) - messageSuggestedPostRefunded.Reason = fieldReason - - return nil -} - // A contact has registered with Telegram type MessageContactRegistered struct{ meta @@ -35098,8 +29242,6 @@ 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) { @@ -35229,8 +29371,6 @@ func (*MessageSelfDestructTypeImmediately) MessageSelfDestructTypeType() string // Options to be used when a message is sent type MessageSendOptions struct { meta - // Information about the suggested post; pass null if none. For messages to channel direct messages chat only. Applicable only to sendMessage and addOffer - SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // Pass true if the message is sent from the background @@ -35243,9 +29383,9 @@ type MessageSendOptions struct { PaidMessageStarCount int64 `json:"paid_message_star_count"` // Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum 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 + // Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, 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, sendMessageAlbum in private chats and forwardMessages with one message to private chats + // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in 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"` @@ -35271,7 +29411,6 @@ func (*MessageSendOptions) GetType() string { func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { var tmp struct { - SuggestedPostInfo *InputSuggestedPostInfo `json:"suggested_post_info"` DisableNotification bool `json:"disable_notification"` FromBackground bool `json:"from_background"` ProtectContent bool `json:"protect_content"` @@ -35289,7 +29428,6 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return err } - messageSendOptions.SuggestedPostInfo = tmp.SuggestedPostInfo messageSendOptions.DisableNotification = tmp.DisableNotification messageSendOptions.FromBackground = tmp.FromBackground messageSendOptions.ProtectContent = tmp.ProtectContent @@ -35309,7 +29447,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { // Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't be copied type MessageCopyOptions struct { meta - // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable + // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable SendCopy bool `json:"send_copy"` // True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false ReplaceCaption bool `json:"replace_caption"` @@ -35342,7 +29480,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 the chat message draft must be deleted + // True, if a chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -36151,12 +30289,12 @@ func (*InputMessageInvoice) InputMessageContentType() string { return TypeInputMessageInvoice } -// A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat +// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot type InputMessagePoll struct { meta // Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users Question *FormattedText `json:"question"` - // List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users + // List of poll answer options, 2-10 strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users Options []*FormattedText `json:"options"` // True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels IsAnonymous bool `json:"is_anonymous"` @@ -36219,42 +30357,11 @@ 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 Toncoin amount that will be staked; in the smallest units of the currency. Must be in the range getOption("stake_dice_stake_amount_min")-getOption("stake_dice_stake_amount_max") - StakeToncoinAmount int64 `json:"stake_toncoin_amount"` - // True, if the chat message draft must be deleted - ClearDraft bool `json:"clear_draft"` -} - -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 +// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded type InputMessageStory struct { meta // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` } @@ -36279,33 +30386,6 @@ func (*InputMessageStory) InputMessageContentType() string { return TypeInputMessageStory } -// A message with a checklist. Checklists can't be sent to secret chats, channel chats and channel direct messages chats; for Telegram Premium users only -type InputMessageChecklist struct { - meta - // The checklist to send - Checklist *InputChecklist `json:"checklist"` -} - -func (entity *InputMessageChecklist) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputMessageChecklist - - return json.Marshal((*stub)(entity)) -} - -func (*InputMessageChecklist) GetClass() string { - return ClassInputMessageContent -} - -func (*InputMessageChecklist) GetType() string { - return TypeInputMessageChecklist -} - -func (*InputMessageChecklist) InputMessageContentType() string { - return TypeInputMessageChecklist -} - // A forwarded message type InputMessageForwarded struct { meta @@ -36346,25 +30426,15 @@ func (*InputMessageForwarded) InputMessageContentType() string { // Contains properties of a message and describes actions that can be done with the message right now type MessageProperties struct { meta - // True, if an offer can be added to the message using addOffer - CanAddOffer bool `json:"can_add_offer"` - // True, if tasks can be added to the message's checklist using addChecklistTasks if the current user has Telegram Premium subscription - CanAddTasks bool `json:"can_add_tasks"` - // True, if the message is a suggested post that can be approved by the user using approveSuggestedPost - CanBeApproved bool `json:"can_be_approved"` - // True, if content of the message can be copied using inputMessageForwarded or forwardMessages with copy options - CanBeCopied bool `json:"can_be_copied"` // True, if content of the message can be copied to a secret chat using inputMessageForwarded or forwardMessages with copy options CanBeCopiedToSecretChat bool `json:"can_be_copied_to_secret_chat"` - // True, if the message is a suggested post that can be declined by the user using declineSuggestedPost - CanBeDeclined bool `json:"can_be_declined"` // True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` // True, if the message can be deleted for all users using the method deleteMessages with revoke == true CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location, poll, and checklist messages this fields shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message + // True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message CanBeEdited bool `json:"can_be_edited"` - // True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options + // True, if the message can be forwarded using inputMessageForwarded or forwardMessages CanBeForwarded bool `json:"can_be_forwarded"` // True, if the message can be paid using inputInvoiceMessage CanBePaid bool `json:"can_be_paid"` @@ -36374,7 +30444,7 @@ type MessageProperties struct { CanBeReplied bool `json:"can_be_replied"` // True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` - // True, if content of the message can be saved locally + // True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options CanBeSaved bool `json:"can_be_saved"` // True, if the message can be shared in a story using inputStoryAreaTypeMessage CanBeSharedInStory bool `json:"can_be_shared_in_story"` @@ -36382,10 +30452,6 @@ type MessageProperties struct { CanEditMedia bool `json:"can_edit_media"` // True, if scheduling state of the message can be edited CanEditSchedulingState bool `json:"can_edit_scheduling_state"` - // True, if another price or post send time can be suggested using addOffer - CanEditSuggestedPostInfo bool `json:"can_edit_suggested_post_info"` - // True, if author of the message sent on behalf of a chat can be received through getMessageAuthor - CanGetAuthor bool `json:"can_get_author"` // True, if code for message embedding can be received using getMessageEmbeddingCode CanGetEmbeddingCode bool `json:"can_get_embedding_code"` // True, if a link can be generated for the message using getMessageLink @@ -36398,12 +30464,8 @@ type MessageProperties struct { CanGetReadDate bool `json:"can_get_read_date"` // True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards CanGetStatistics bool `json:"can_get_statistics"` - // True, if advertisements for video of the message can be received though getVideoMessageAdvertisements - CanGetVideoAdvertisements bool `json:"can_get_video_advertisements"` // True, if chat members already viewed the message can be received through getMessageViewers CanGetViewers bool `json:"can_get_viewers"` - // True, if tasks can be marked as done or not done in the message's checklist using markChecklistTasksAsDone if the current user has Telegram Premium subscription - CanMarkTasksAsDone bool `json:"can_mark_tasks_as_done"` // True, if speech can be recognized for the message through recognizeSpeech CanRecognizeSpeech bool `json:"can_recognize_speech"` // True, if the message can be reported using reportChat @@ -38694,7 +32756,7 @@ func (*InputStoryAreas) GetType() string { return TypeInputStoryAreas } -// Describes a video file posted as a story +// Describes a video file sent in a story type StoryVideo struct { meta // Duration of the video, in seconds @@ -38735,106 +32797,6 @@ func (*StoryVideo) GetType() string { return TypeStoryVideo } -// A photo story -type StoryContentTypePhoto struct{ - meta -} - -func (entity *StoryContentTypePhoto) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryContentTypePhoto - - return json.Marshal((*stub)(entity)) -} - -func (*StoryContentTypePhoto) GetClass() string { - return ClassStoryContentType -} - -func (*StoryContentTypePhoto) GetType() string { - return TypeStoryContentTypePhoto -} - -func (*StoryContentTypePhoto) StoryContentTypeType() string { - return TypeStoryContentTypePhoto -} - -// A video story -type StoryContentTypeVideo struct{ - meta -} - -func (entity *StoryContentTypeVideo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryContentTypeVideo - - return json.Marshal((*stub)(entity)) -} - -func (*StoryContentTypeVideo) GetClass() string { - return ClassStoryContentType -} - -func (*StoryContentTypeVideo) GetType() string { - return TypeStoryContentTypeVideo -} - -func (*StoryContentTypeVideo) StoryContentTypeType() string { - return TypeStoryContentTypeVideo -} - -// A live story -type StoryContentTypeLive struct{ - meta -} - -func (entity *StoryContentTypeLive) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryContentTypeLive - - return json.Marshal((*stub)(entity)) -} - -func (*StoryContentTypeLive) GetClass() string { - return ClassStoryContentType -} - -func (*StoryContentTypeLive) GetType() string { - return TypeStoryContentTypeLive -} - -func (*StoryContentTypeLive) StoryContentTypeType() string { - return TypeStoryContentTypeLive -} - -// A story of unknown content type -type StoryContentTypeUnsupported struct{ - meta -} - -func (entity *StoryContentTypeUnsupported) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryContentTypeUnsupported - - return json.Marshal((*stub)(entity)) -} - -func (*StoryContentTypeUnsupported) GetClass() string { - return ClassStoryContentType -} - -func (*StoryContentTypeUnsupported) GetType() string { - return TypeStoryContentTypeUnsupported -} - -func (*StoryContentTypeUnsupported) StoryContentTypeType() string { - return TypeStoryContentTypeUnsupported -} - // A photo story type StoryContentPhoto struct { meta @@ -38891,35 +32853,6 @@ 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 @@ -39103,7 +33036,7 @@ func (*StoryListArchive) StoryListType() string { return TypeStoryListArchive } -// The original story was a public story that was posted by a known chat +// The original story was a public story with known sender type StoryOriginPublicStory struct { meta // Identifier of the chat that posted original story @@ -39132,11 +33065,11 @@ func (*StoryOriginPublicStory) StoryOriginType() string { return TypeStoryOriginPublicStory } -// The original story was posted by an unknown user +// The original story was sent by an unknown user type StoryOriginHiddenUser struct { meta - // Name of the user or the chat that posted the story - PosterName string `json:"poster_name"` + // Name of the story sender + SenderName string `json:"sender_name"` } func (entity *StoryOriginHiddenUser) MarshalJSON() ([]byte, error) { @@ -39235,36 +33168,32 @@ func (*StoryInteractionInfo) GetType() string { // Represents a story type Story struct { meta - // Unique story identifier among stories posted by the given chat + // Unique story identifier among stories of the given sender Id int32 `json:"id"` // Identifier of the chat that posted the story - PosterChatId int64 `json:"poster_chat_id"` - // Identifier of the user or chat that posted the story; may be null if the story is posted on behalf of the poster_chat_id - PosterId MessageSender `json:"poster_id"` + SenderChatId int64 `json:"sender_chat_id"` + // Identifier of the sender of the story; may be null if the story is posted on behalf of the sender_chat_id + SenderId MessageSender `json:"sender_id"` // Point in time (Unix timestamp) when the story was published Date int32 `json:"date"` - // True, if the story is being posted by the current user - IsBeingPosted bool `json:"is_being_posted"` + // True, if the story is being sent by the current user + IsBeingSent bool `json:"is_being_sent"` // True, if the story is being edited by the current user IsBeingEdited bool `json:"is_being_edited"` // True, if the story was edited IsEdited bool `json:"is_edited"` - // True, if the story is saved in the profile of the chat that posted it and will be available there after expiration + // True, if the story is saved in the sender's profile and will be available there after expiration 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 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"` // True, if the story can be edited CanBeEdited bool `json:"can_be_edited"` - // True, if the story can be forwarded as a message or reposted as a story. Otherwise, screenshotting and saving of the story content must be also forbidden + // True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden CanBeForwarded bool `json:"can_be_forwarded"` - // True, if the story can be replied in the chat with the user who posted the story + // True, if the story can be replied in the chat with the story sender 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 @@ -39287,8 +33216,6 @@ type Story struct { Areas []*StoryArea `json:"areas"` // Caption of the story Caption *FormattedText `json:"caption"` - // Identifiers of story albums to which the story is added; only for manageable stories - AlbumIds []int32 `json:"album_ids"` } func (entity *Story) MarshalJSON() ([]byte, error) { @@ -39310,20 +33237,18 @@ func (*Story) GetType() string { func (story *Story) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` - PosterChatId int64 `json:"poster_chat_id"` - PosterId json.RawMessage `json:"poster_id"` + SenderChatId int64 `json:"sender_chat_id"` + SenderId json.RawMessage `json:"sender_id"` Date int32 `json:"date"` - IsBeingPosted bool `json:"is_being_posted"` + IsBeingSent bool `json:"is_being_sent"` IsBeingEdited bool `json:"is_being_edited"` IsEdited bool `json:"is_edited"` IsPostedToChatPage bool `json:"is_posted_to_chat_page"` IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` - CanBeAddedToAlbum bool `json:"can_be_added_to_album"` CanBeDeleted bool `json:"can_be_deleted"` 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"` @@ -39335,7 +33260,6 @@ func (story *Story) UnmarshalJSON(data []byte) error { Content json.RawMessage `json:"content"` Areas []*StoryArea `json:"areas"` Caption *FormattedText `json:"caption"` - AlbumIds []int32 `json:"album_ids"` } err := json.Unmarshal(data, &tmp) @@ -39344,19 +33268,17 @@ func (story *Story) UnmarshalJSON(data []byte) error { } story.Id = tmp.Id - story.PosterChatId = tmp.PosterChatId + story.SenderChatId = tmp.SenderChatId story.Date = tmp.Date - story.IsBeingPosted = tmp.IsBeingPosted + story.IsBeingSent = tmp.IsBeingSent story.IsBeingEdited = tmp.IsBeingEdited story.IsEdited = tmp.IsEdited story.IsPostedToChatPage = tmp.IsPostedToChatPage story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf - story.CanBeAddedToAlbum = tmp.CanBeAddedToAlbum story.CanBeDeleted = tmp.CanBeDeleted 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 @@ -39365,10 +33287,9 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.InteractionInfo = tmp.InteractionInfo story.Areas = tmp.Areas story.Caption = tmp.Caption - story.AlbumIds = tmp.AlbumIds - fieldPosterId, _ := UnmarshalMessageSender(tmp.PosterId) - story.PosterId = fieldPosterId + fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) + story.SenderId = fieldSenderId fieldChosenReactionType, _ := UnmarshalReactionType(tmp.ChosenReactionType) story.ChosenReactionType = fieldChosenReactionType @@ -39436,64 +33357,12 @@ func (*FoundStories) GetType() string { return TypeFoundStories } -// Describes album of stories -type StoryAlbum struct { - meta - // Unique identifier of the album - Id int32 `json:"id"` - // Name of the album - Name string `json:"name"` - // Icon of the album; may be null if none - PhotoIcon *Photo `json:"photo_icon"` - // Video icon of the album; may be null if none - VideoIcon *Video `json:"video_icon"` -} - -func (entity *StoryAlbum) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryAlbum - - return json.Marshal((*stub)(entity)) -} - -func (*StoryAlbum) GetClass() string { - return ClassStoryAlbum -} - -func (*StoryAlbum) GetType() string { - return TypeStoryAlbum -} - -// Represents a list of story albums -type StoryAlbums struct { - meta - // List of story albums - Albums []*StoryAlbum `json:"albums"` -} - -func (entity *StoryAlbums) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub StoryAlbums - - return json.Marshal((*stub)(entity)) -} - -func (*StoryAlbums) GetClass() string { - return ClassStoryAlbums -} - -func (*StoryAlbums) GetType() string { - return TypeStoryAlbums -} - -// Contains identifier of a story along with identifier of the chat that posted it +// Contains identifier of a story along with identifier of its sender type StoryFullId struct { meta // Identifier of the chat that posted the story - PosterChatId int64 `json:"poster_chat_id"` - // Unique story identifier among stories of the chat + SenderChatId int64 `json:"sender_chat_id"` + // Unique story identifier among stories of the given sender StoryId int32 `json:"story_id"` } @@ -39516,14 +33385,12 @@ func (*StoryFullId) GetType() string { // Contains basic information about a story type StoryInfo struct { meta - // Unique story identifier among stories of the chat + // Unique story identifier among stories of the given sender StoryId int32 `json:"story_id"` // Point in time (Unix timestamp) when the story was published 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) { @@ -39549,10 +33416,8 @@ type ChatActiveStories struct { ChatId int64 `json:"chat_id"` // Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list List StoryList `json:"list"` - // A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order + // A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order Order int64 `json:"order"` - // True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can't be archived nor hidden using removeTopChat - CanBeArchived bool `json:"can_be_archived"` // Identifier of the last read active story MaxReadStoryId int32 `json:"max_read_story_id"` // Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers) @@ -39580,7 +33445,6 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { ChatId int64 `json:"chat_id"` List json.RawMessage `json:"list"` Order int64 `json:"order"` - CanBeArchived bool `json:"can_be_archived"` MaxReadStoryId int32 `json:"max_read_story_id"` Stories []*StoryInfo `json:"stories"` } @@ -39592,7 +33456,6 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { chatActiveStories.ChatId = tmp.ChatId chatActiveStories.Order = tmp.Order - chatActiveStories.CanBeArchived = tmp.CanBeArchived chatActiveStories.MaxReadStoryId = tmp.MaxReadStoryId chatActiveStories.Stories = tmp.Stories @@ -40017,7 +33880,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; may only be of the types storyContentPhoto, storyContentVideo, or storyContentUnsupported + // Content of the preview Content StoryContent `json:"content"` } @@ -40131,8 +33994,6 @@ type ChatBoostLevelFeatures struct { CanSetCustomBackground bool `json:"can_set_custom_background"` // True, if custom emoji sticker set can be set for the chat CanSetCustomEmojiStickerSet bool `json:"can_set_custom_emoji_sticker_set"` - // True, if automatic translation of messages can be enabled in the chat - CanEnableAutomaticTranslation bool `json:"can_enable_automatic_translation"` // True, if speech recognition can be used for video note and voice note messages by all users CanRecognizeSpeech bool `json:"can_recognize_speech"` // True, if sponsored messages can be disabled in the chat @@ -40172,8 +34033,6 @@ type ChatBoostFeatures struct { MinCustomBackgroundBoostLevel int32 `json:"min_custom_background_boost_level"` // The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only MinCustomEmojiStickerSetBoostLevel int32 `json:"min_custom_emoji_sticker_set_boost_level"` - // The minimum boost level allowing to enable automatic translation of messages for non-Premium users; for channel chats only - MinAutomaticTranslationBoostLevel int32 `json:"min_automatic_translation_boost_level"` // The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only MinSpeechRecognitionBoostLevel int32 `json:"min_speech_recognition_boost_level"` // The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only @@ -40228,7 +34087,7 @@ func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { // The chat created a giveaway type ChatBoostSourceGiveaway struct { meta - // Identifier of a user who won in the giveaway; 0 if none + // Identifier of a user that won in the giveaway; 0 if none UserId int64 `json:"user_id"` // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only GiftCode string `json:"gift_code"` @@ -40549,7 +34408,7 @@ func (*ResendCodeReasonUserRequest) ResendCodeReasonType() string { // The code is re-sent, because device verification has failed type ResendCodeReasonVerificationFailed struct { meta - // Cause of the verification failure, for example, "PLAY_SERVICES_NOT_AVAILABLE", "APNS_RECEIVE_TIMEOUT", or "APNS_INIT_FAILED" + // Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED ErrorMessage string `json:"error_message"` } @@ -40698,31 +34557,31 @@ func (*CallDiscardReasonHungUp) CallDiscardReasonType() string { return TypeCallDiscardReasonHungUp } -// The call was ended because it has been upgraded to a group call -type CallDiscardReasonUpgradeToGroupCall struct { +// The call was ended because it has been used successfully to transfer private encryption key for the associated group call +type CallDiscardReasonAllowGroupCall struct { meta - // Invite link for the group call - InviteLink string `json:"invite_link"` + // Encrypted using the call private key encryption key for the associated group call + EncryptedGroupCallKey []byte `json:"encrypted_group_call_key"` } -func (entity *CallDiscardReasonUpgradeToGroupCall) MarshalJSON() ([]byte, error) { +func (entity *CallDiscardReasonAllowGroupCall) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CallDiscardReasonUpgradeToGroupCall + type stub CallDiscardReasonAllowGroupCall return json.Marshal((*stub)(entity)) } -func (*CallDiscardReasonUpgradeToGroupCall) GetClass() string { +func (*CallDiscardReasonAllowGroupCall) GetClass() string { return ClassCallDiscardReason } -func (*CallDiscardReasonUpgradeToGroupCall) GetType() string { - return TypeCallDiscardReasonUpgradeToGroupCall +func (*CallDiscardReasonAllowGroupCall) GetType() string { + return TypeCallDiscardReasonAllowGroupCall } -func (*CallDiscardReasonUpgradeToGroupCall) CallDiscardReasonType() string { - return TypeCallDiscardReasonUpgradeToGroupCall +func (*CallDiscardReasonAllowGroupCall) CallDiscardReasonType() string { + return TypeCallDiscardReasonAllowGroupCall } // Specifies the supported call protocols @@ -40989,8 +34848,6 @@ type CallStateReady struct { Emojis []string `json:"emojis"` // True, if peer-to-peer connection is allowed by users privacy settings AllowP2p bool `json:"allow_p2p"` - // True, if the other party supports upgrading of the call to a group call - IsGroupCallSupported bool `json:"is_group_call_supported"` // Custom JSON-encoded call parameters to be passed to tgcalls CustomParameters string `json:"custom_parameters"` } @@ -41123,35 +34980,6 @@ func (*CallStateError) CallStateType() string { return TypeCallStateError } -// Describes parameters used to join a group call -type GroupCallJoinParameters struct { - meta - // Audio channel synchronization source identifier; received from tgcalls - AudioSourceId int32 `json:"audio_source_id"` - // Group call join payload; received from tgcalls - Payload string `json:"payload"` - // Pass true to join the call with muted microphone - IsMuted bool `json:"is_muted"` - // Pass true if the user's video is enabled - IsMyVideoEnabled bool `json:"is_my_video_enabled"` -} - -func (entity *GroupCallJoinParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallJoinParameters - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallJoinParameters) GetClass() string { - return ClassGroupCallJoinParameters -} - -func (*GroupCallJoinParameters) GetType() string { - return TypeGroupCallJoinParameters -} - // The worst available video quality type GroupCallVideoQualityThumbnail struct{ meta @@ -41227,7 +35055,7 @@ func (*GroupCallVideoQualityFull) GroupCallVideoQualityType() string { return TypeGroupCallVideoQualityFull } -// Describes an available stream in a video chat or a live story +// Describes an available stream in a group call type GroupCallStream struct { meta // Identifier of an audio/video channel @@ -41351,42 +35179,30 @@ type GroupCall struct { meta // Group call identifier Id int32 `json:"id"` - // Persistent unique group call identifier - UniqueId JsonInt64 `json:"unique_id"` - // Group call title; for video chats only + // Identifier of one-to-one call from which the group call was created; 0 if unknown + FromCallId int32 `json:"from_call_id"` + // Group call title Title string `json:"title"` - // Invite link for the group call; for group calls that aren't bound to a chat. For video chats call getVideoChatInviteLink to get the link. For live stories in chats with username call getInternalLink with internalLinkTypeLiveStory - 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 + // 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 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 + // True, if the group call is scheduled and the current user will receive a notification when the group call starts EnabledStartNotification bool `json:"enabled_start_notification"` // True, if the call is active 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 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 + // True, if the chat is an RTMP stream instead of an ordinary video chat IsRtmpStream bool `json:"is_rtmp_stream"` // True, if the call is joined IsJoined bool `json:"is_joined"` // True, if user was kicked from the call because of network loss and the call needs to be rejoined 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 and live stories only + // True, if the current user can manage the group call CanBeManaged bool `json:"can_be_managed"` // Number of participants in the group call ParticipantCount int32 `json:"participant_count"` - // True, if group call participants, which are muted, aren't returned in participant list; for video chats only + // True, if group call participants, which are muted, aren't returned in participant list 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 @@ -41395,18 +35211,10 @@ type GroupCall struct { IsMyVideoPaused bool `json:"is_my_video_paused"` // True, if the current user can broadcast video or share screen CanEnableVideo bool `json:"can_enable_video"` - // True, if only group call administrators can unmute new participants; for video chats only + // True, if only group call administrators can unmute new participants MuteNewParticipants bool `json:"mute_new_participants"` - // True, if the current user can enable or disable mute_new_participants setting; for video chats only + // True, if the current user can enable or disable mute_new_participants setting CanToggleMuteNewParticipants bool `json:"can_toggle_mute_new_participants"` - // True, if the current user can send messages to the group call - CanSendMessages bool `json:"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 @@ -41431,85 +35239,6 @@ func (*GroupCall) GetType() string { return TypeGroupCall } -func (groupCall *GroupCall) UnmarshalJSON(data []byte) error { - var tmp struct { - Id int32 `json:"id"` - UniqueId JsonInt64 `json:"unique_id"` - Title string `json:"title"` - InviteLink string `json:"invite_link"` - PaidMessageStarCount int64 `json:"paid_message_star_count"` - 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.UniqueId = tmp.UniqueId - 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 @@ -41670,384 +35399,6 @@ func (groupCallParticipant *GroupCallParticipant) UnmarshalJSON(data []byte) err return nil } -// Contains identifiers of group call participants -type GroupCallParticipants struct { - meta - // Total number of group call participants - TotalCount int32 `json:"total_count"` - // Identifiers of the participants - ParticipantIds []MessageSender `json:"participant_ids"` -} - -func (entity *GroupCallParticipants) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallParticipants - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallParticipants) GetClass() string { - return ClassGroupCallParticipants -} - -func (*GroupCallParticipants) GetType() string { - return TypeGroupCallParticipants -} - -func (groupCallParticipants *GroupCallParticipants) UnmarshalJSON(data []byte) error { - var tmp struct { - TotalCount int32 `json:"total_count"` - ParticipantIds []json.RawMessage `json:"participant_ids"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - groupCallParticipants.TotalCount = tmp.TotalCount - - fieldParticipantIds, _ := UnmarshalListOfMessageSender(tmp.ParticipantIds) - groupCallParticipants.ParticipantIds = fieldParticipantIds - - return nil -} - -// Contains information about a just created or just joined group call -type GroupCallInfo struct { - meta - // Identifier of the group call - GroupCallId int32 `json:"group_call_id"` - // Join response payload for tgcalls; empty if the call isn't joined - JoinPayload string `json:"join_payload"` -} - -func (entity *GroupCallInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallInfo - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallInfo) GetClass() string { - return ClassGroupCallInfo -} - -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 -} - -func (entity *InviteGroupCallParticipantResultUserPrivacyRestricted) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InviteGroupCallParticipantResultUserPrivacyRestricted - - return json.Marshal((*stub)(entity)) -} - -func (*InviteGroupCallParticipantResultUserPrivacyRestricted) GetClass() string { - return ClassInviteGroupCallParticipantResult -} - -func (*InviteGroupCallParticipantResultUserPrivacyRestricted) GetType() string { - return TypeInviteGroupCallParticipantResultUserPrivacyRestricted -} - -func (*InviteGroupCallParticipantResultUserPrivacyRestricted) InviteGroupCallParticipantResultType() string { - return TypeInviteGroupCallParticipantResultUserPrivacyRestricted -} - -// The user can't be invited because they are already a participant of the call -type InviteGroupCallParticipantResultUserAlreadyParticipant struct{ - meta -} - -func (entity *InviteGroupCallParticipantResultUserAlreadyParticipant) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InviteGroupCallParticipantResultUserAlreadyParticipant - - return json.Marshal((*stub)(entity)) -} - -func (*InviteGroupCallParticipantResultUserAlreadyParticipant) GetClass() string { - return ClassInviteGroupCallParticipantResult -} - -func (*InviteGroupCallParticipantResultUserAlreadyParticipant) GetType() string { - return TypeInviteGroupCallParticipantResultUserAlreadyParticipant -} - -func (*InviteGroupCallParticipantResultUserAlreadyParticipant) InviteGroupCallParticipantResultType() string { - return TypeInviteGroupCallParticipantResultUserAlreadyParticipant -} - -// The user can't be invited because they were banned by the owner of the call and can be invited back only by the owner of the group call -type InviteGroupCallParticipantResultUserWasBanned struct{ - meta -} - -func (entity *InviteGroupCallParticipantResultUserWasBanned) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InviteGroupCallParticipantResultUserWasBanned - - return json.Marshal((*stub)(entity)) -} - -func (*InviteGroupCallParticipantResultUserWasBanned) GetClass() string { - return ClassInviteGroupCallParticipantResult -} - -func (*InviteGroupCallParticipantResultUserWasBanned) GetType() string { - return TypeInviteGroupCallParticipantResultUserWasBanned -} - -func (*InviteGroupCallParticipantResultUserWasBanned) InviteGroupCallParticipantResultType() string { - return TypeInviteGroupCallParticipantResultUserWasBanned -} - -// The user was invited and a service message of the type messageGroupCall was sent which can be used in declineGroupCallInvitation to cancel the invitation -type InviteGroupCallParticipantResultSuccess struct { - meta - // Identifier of the chat with the invitation message - ChatId int64 `json:"chat_id"` - // Identifier of the message - MessageId int64 `json:"message_id"` -} - -func (entity *InviteGroupCallParticipantResultSuccess) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InviteGroupCallParticipantResultSuccess - - return json.Marshal((*stub)(entity)) -} - -func (*InviteGroupCallParticipantResultSuccess) GetClass() string { - return ClassInviteGroupCallParticipantResult -} - -func (*InviteGroupCallParticipantResultSuccess) GetType() string { - return TypeInviteGroupCallParticipantResultSuccess -} - -func (*InviteGroupCallParticipantResultSuccess) InviteGroupCallParticipantResultType() string { - return TypeInviteGroupCallParticipantResultSuccess -} - -// The main data channel for audio and video data -type GroupCallDataChannelMain struct{ - meta -} - -func (entity *GroupCallDataChannelMain) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallDataChannelMain - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallDataChannelMain) GetClass() string { - return ClassGroupCallDataChannel -} - -func (*GroupCallDataChannelMain) GetType() string { - return TypeGroupCallDataChannelMain -} - -func (*GroupCallDataChannelMain) GroupCallDataChannelType() string { - return TypeGroupCallDataChannelMain -} - -// The data channel for screen sharing -type GroupCallDataChannelScreenSharing struct{ - meta -} - -func (entity *GroupCallDataChannelScreenSharing) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GroupCallDataChannelScreenSharing - - return json.Marshal((*stub)(entity)) -} - -func (*GroupCallDataChannelScreenSharing) GetClass() string { - return ClassGroupCallDataChannel -} - -func (*GroupCallDataChannelScreenSharing) GetType() string { - return TypeGroupCallDataChannelScreenSharing -} - -func (*GroupCallDataChannelScreenSharing) GroupCallDataChannelType() string { - return TypeGroupCallDataChannelScreenSharing -} - -// The group call is accessible through a link -type InputGroupCallLink struct { - meta - // The link for the group call - Link string `json:"link"` -} - -func (entity *InputGroupCallLink) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputGroupCallLink - - return json.Marshal((*stub)(entity)) -} - -func (*InputGroupCallLink) GetClass() string { - return ClassInputGroupCall -} - -func (*InputGroupCallLink) GetType() string { - return TypeInputGroupCallLink -} - -func (*InputGroupCallLink) InputGroupCallType() string { - return TypeInputGroupCallLink -} - -// The group call is accessible through a message of the type messageGroupCall -type InputGroupCallMessage struct { - meta - // Identifier of the chat with the message - ChatId int64 `json:"chat_id"` - // Identifier of the message of the type messageGroupCall - MessageId int64 `json:"message_id"` -} - -func (entity *InputGroupCallMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputGroupCallMessage - - return json.Marshal((*stub)(entity)) -} - -func (*InputGroupCallMessage) GetClass() string { - return ClassInputGroupCall -} - -func (*InputGroupCallMessage) GetType() string { - return TypeInputGroupCallMessage -} - -func (*InputGroupCallMessage) InputGroupCallType() string { - return TypeInputGroupCallMessage -} - // The user heard their own voice type CallProblemEcho struct{ meta @@ -42278,8 +35629,6 @@ type Call struct { meta // Call identifier, not persistent Id int32 `json:"id"` - // Persistent unique call identifier; 0 if isn't assigned yet by the server - UniqueId JsonInt64 `json:"unique_id"` // User identifier of the other call participant UserId int64 `json:"user_id"` // True, if the call is outgoing @@ -42288,6 +35637,8 @@ type Call struct { IsVideo bool `json:"is_video"` // Call state State CallState `json:"state"` + // Identifier of the group call associated with the call; 0 if the group call isn't created yet. The group call can be received through the method getGroupCall + GroupCallId int32 `json:"group_call_id"` } func (entity *Call) MarshalJSON() ([]byte, error) { @@ -42309,11 +35660,11 @@ func (*Call) GetType() string { func (call *Call) UnmarshalJSON(data []byte) error { var tmp struct { Id int32 `json:"id"` - UniqueId JsonInt64 `json:"unique_id"` UserId int64 `json:"user_id"` IsOutgoing bool `json:"is_outgoing"` IsVideo bool `json:"is_video"` State json.RawMessage `json:"state"` + GroupCallId int32 `json:"group_call_id"` } err := json.Unmarshal(data, &tmp) @@ -42322,10 +35673,10 @@ func (call *Call) UnmarshalJSON(data []byte) error { } call.Id = tmp.Id - call.UniqueId = tmp.UniqueId call.UserId = tmp.UserId call.IsOutgoing = tmp.IsOutgoing call.IsVideo = tmp.IsVideo + call.GroupCallId = tmp.GroupCallId fieldState, _ := UnmarshalCallState(tmp.State) call.State = fieldState @@ -42402,7 +35753,7 @@ type PhoneNumberAuthenticationSettings struct { AllowSmsRetrieverApi bool `json:"allow_sms_retriever_api"` // For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication FirebaseAuthenticationSettings FirebaseAuthenticationSettings `json:"firebase_authentication_settings"` - // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions; for setAuthenticationPhoneNumber only + // List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions AuthenticationTokens []string `json:"authentication_tokens"` } @@ -42812,35 +36163,6 @@ func (*DiceStickersSlotMachine) DiceStickersType() string { return TypeDiceStickersSlotMachine } -// Describes a contact to import -type ImportedContact struct { - meta - // Phone number of the user - PhoneNumber string `json:"phone_number"` - // First name of the user; 1-64 characters - FirstName string `json:"first_name"` - // Last name of the user; 0-64 characters - LastName string `json:"last_name"` - // Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed; pass null to keep the current user's note - Note *FormattedText `json:"note"` -} - -func (entity *ImportedContact) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ImportedContact - - return json.Marshal((*stub)(entity)) -} - -func (*ImportedContact) GetClass() string { - return ClassImportedContact -} - -func (*ImportedContact) GetType() string { - return TypeImportedContact -} - // Represents the result of an importContacts request type ImportedContacts struct { meta @@ -42952,7 +36274,7 @@ type BusinessConnection struct { meta // Unique identifier of the connection Id string `json:"id"` - // Identifier of the business user who created the connection + // Identifier of the business user that created the connection UserId int64 `json:"user_id"` // Chat identifier of the private chat with the user UserChatId int64 `json:"user_chat_id"` @@ -46182,33 +39504,6 @@ func (*ChatEventShowMessageSenderToggled) ChatEventActionType() string { return TypeChatEventShowMessageSenderToggled } -// The has_automatic_translation setting of a channel was toggled -type ChatEventAutomaticTranslationToggled struct { - meta - // New value of has_automatic_translation - HasAutomaticTranslation bool `json:"has_automatic_translation"` -} - -func (entity *ChatEventAutomaticTranslationToggled) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatEventAutomaticTranslationToggled - - return json.Marshal((*stub)(entity)) -} - -func (*ChatEventAutomaticTranslationToggled) GetClass() string { - return ClassChatEventAction -} - -func (*ChatEventAutomaticTranslationToggled) GetType() string { - return TypeChatEventAutomaticTranslationToggled -} - -func (*ChatEventAutomaticTranslationToggled) ChatEventActionType() string { - return TypeChatEventAutomaticTranslationToggled -} - // A chat invite link was edited type ChatEventInviteLinkEdited struct { meta @@ -47364,57 +40659,57 @@ func (*PremiumLimitTypeActiveStoryCount) PremiumLimitTypeType() string { return TypePremiumLimitTypeActiveStoryCount } -// The maximum number of stories posted per week -type PremiumLimitTypeWeeklyPostedStoryCount struct{ +// The maximum number of stories sent per week +type PremiumLimitTypeWeeklySentStoryCount struct{ meta } -func (entity *PremiumLimitTypeWeeklyPostedStoryCount) MarshalJSON() ([]byte, error) { +func (entity *PremiumLimitTypeWeeklySentStoryCount) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PremiumLimitTypeWeeklyPostedStoryCount + type stub PremiumLimitTypeWeeklySentStoryCount return json.Marshal((*stub)(entity)) } -func (*PremiumLimitTypeWeeklyPostedStoryCount) GetClass() string { +func (*PremiumLimitTypeWeeklySentStoryCount) GetClass() string { return ClassPremiumLimitType } -func (*PremiumLimitTypeWeeklyPostedStoryCount) GetType() string { - return TypePremiumLimitTypeWeeklyPostedStoryCount +func (*PremiumLimitTypeWeeklySentStoryCount) GetType() string { + return TypePremiumLimitTypeWeeklySentStoryCount } -func (*PremiumLimitTypeWeeklyPostedStoryCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeWeeklyPostedStoryCount +func (*PremiumLimitTypeWeeklySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeWeeklySentStoryCount } -// The maximum number of stories posted per month -type PremiumLimitTypeMonthlyPostedStoryCount struct{ +// The maximum number of stories sent per month +type PremiumLimitTypeMonthlySentStoryCount struct{ meta } -func (entity *PremiumLimitTypeMonthlyPostedStoryCount) MarshalJSON() ([]byte, error) { +func (entity *PremiumLimitTypeMonthlySentStoryCount) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PremiumLimitTypeMonthlyPostedStoryCount + type stub PremiumLimitTypeMonthlySentStoryCount return json.Marshal((*stub)(entity)) } -func (*PremiumLimitTypeMonthlyPostedStoryCount) GetClass() string { +func (*PremiumLimitTypeMonthlySentStoryCount) GetClass() string { return ClassPremiumLimitType } -func (*PremiumLimitTypeMonthlyPostedStoryCount) GetType() string { - return TypePremiumLimitTypeMonthlyPostedStoryCount +func (*PremiumLimitTypeMonthlySentStoryCount) GetType() string { + return TypePremiumLimitTypeMonthlySentStoryCount } -func (*PremiumLimitTypeMonthlyPostedStoryCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeMonthlyPostedStoryCount +func (*PremiumLimitTypeMonthlySentStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeMonthlySentStoryCount } -// The maximum length of captions of posted stories +// The maximum length of captions of sent stories type PremiumLimitTypeStoryCaptionLength struct{ meta } @@ -48014,7 +41309,7 @@ func (*PremiumFeatureMessagePrivacy) PremiumFeatureType() string { return TypePremiumFeatureMessagePrivacy } -// The ability to view last seen and read times of other users even if they can't view last seen or read time for the current user +// The ability to view last seen and read times of other users even they can't view last seen or read time for the current user type PremiumFeatureLastSeenTimes struct{ meta } @@ -48089,56 +41384,6 @@ func (*PremiumFeatureMessageEffects) PremiumFeatureType() string { return TypePremiumFeatureMessageEffects } -// The ability to create and use checklist messages -type PremiumFeatureChecklists struct{ - meta -} - -func (entity *PremiumFeatureChecklists) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PremiumFeatureChecklists - - return json.Marshal((*stub)(entity)) -} - -func (*PremiumFeatureChecklists) GetClass() string { - return ClassPremiumFeature -} - -func (*PremiumFeatureChecklists) GetType() string { - return TypePremiumFeatureChecklists -} - -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 @@ -48898,7 +42143,7 @@ func (premiumSourceStoryFeature *PremiumSourceStoryFeature) UnmarshalJSON(data [ return nil } -// A user opened an internal link of the type internalLinkTypePremiumFeaturesPage +// A user opened an internal link of the type internalLinkTypePremiumFeatures type PremiumSourceLink struct { meta // The referrer from the link @@ -49239,8 +42484,6 @@ type StorePaymentPurposeStars struct { Amount int64 `json:"amount"` // Number of bought Telegram Stars StarCount int64 `json:"star_count"` - // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none - ChatId int64 `json:"chat_id"` } func (entity *StorePaymentPurposeStars) MarshalJSON() ([]byte, error) { @@ -49470,8 +42713,6 @@ type TelegramPaymentPurposeStars struct { Amount int64 `json:"amount"` // Number of bought Telegram Stars StarCount int64 `json:"star_count"` - // Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none - ChatId int64 `json:"chat_id"` } func (entity *TelegramPaymentPurposeStars) MarshalJSON() ([]byte, error) { @@ -50163,10 +43404,10 @@ func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { return nil } -// A background from a chat theme based on an emoji; can be used only as a chat background in channels +// A background from a chat theme; can be used only as a chat background in channels type BackgroundTypeChatTheme struct { meta - // Name of the emoji chat theme + // Name of the chat theme ThemeName string `json:"theme_name"` } @@ -50287,8 +43528,8 @@ func (*InputBackgroundPrevious) InputBackgroundType() string { return TypeInputBackgroundPrevious } -// Describes a chat theme based on an emoji -type EmojiChatTheme struct { +// Describes a chat theme +type ChatTheme struct { meta // Theme name Name string `json:"name"` @@ -50298,180 +43539,20 @@ type EmojiChatTheme struct { DarkSettings *ThemeSettings `json:"dark_settings"` } -func (entity *EmojiChatTheme) MarshalJSON() ([]byte, error) { +func (entity *ChatTheme) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub EmojiChatTheme + type stub ChatTheme return json.Marshal((*stub)(entity)) } -func (*EmojiChatTheme) GetClass() string { - return ClassEmojiChatTheme -} - -func (*EmojiChatTheme) GetType() string { - return TypeEmojiChatTheme -} - -// Describes a chat theme based on an upgraded gift -type GiftChatTheme struct { - meta - // The gift - Gift *UpgradedGift `json:"gift"` - // Theme settings for a light chat theme - LightSettings *ThemeSettings `json:"light_settings"` - // Theme settings for a dark chat theme - DarkSettings *ThemeSettings `json:"dark_settings"` -} - -func (entity *GiftChatTheme) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftChatTheme - - return json.Marshal((*stub)(entity)) -} - -func (*GiftChatTheme) GetClass() string { - return ClassGiftChatTheme -} - -func (*GiftChatTheme) GetType() string { - return TypeGiftChatTheme -} - -// Contains a list of chat themes based on upgraded gifts -type GiftChatThemes struct { - meta - // A list of chat themes - Themes []*GiftChatTheme `json:"themes"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` -} - -func (entity *GiftChatThemes) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub GiftChatThemes - - return json.Marshal((*stub)(entity)) -} - -func (*GiftChatThemes) GetClass() string { - return ClassGiftChatThemes -} - -func (*GiftChatThemes) GetType() string { - return TypeGiftChatThemes -} - -// A chat theme based on an emoji -type ChatThemeEmoji struct { - meta - // Name of the theme; full theme description is received through updateEmojiChatThemes - Name string `json:"name"` -} - -func (entity *ChatThemeEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatThemeEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*ChatThemeEmoji) GetClass() string { +func (*ChatTheme) GetClass() string { return ClassChatTheme } -func (*ChatThemeEmoji) GetType() string { - return TypeChatThemeEmoji -} - -func (*ChatThemeEmoji) ChatThemeType() string { - return TypeChatThemeEmoji -} - -// A chat theme based on an upgraded gift -type ChatThemeGift struct { - meta - // The chat theme - GiftTheme *GiftChatTheme `json:"gift_theme"` -} - -func (entity *ChatThemeGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatThemeGift - - return json.Marshal((*stub)(entity)) -} - -func (*ChatThemeGift) GetClass() string { - return ClassChatTheme -} - -func (*ChatThemeGift) GetType() string { - return TypeChatThemeGift -} - -func (*ChatThemeGift) ChatThemeType() string { - return TypeChatThemeGift -} - -// A theme based on an emoji -type InputChatThemeEmoji struct { - meta - // Name of the theme - Name string `json:"name"` -} - -func (entity *InputChatThemeEmoji) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChatThemeEmoji - - return json.Marshal((*stub)(entity)) -} - -func (*InputChatThemeEmoji) GetClass() string { - return ClassInputChatTheme -} - -func (*InputChatThemeEmoji) GetType() string { - return TypeInputChatThemeEmoji -} - -func (*InputChatThemeEmoji) InputChatThemeType() string { - return TypeInputChatThemeEmoji -} - -// A theme based on an upgraded gift -type InputChatThemeGift struct { - meta - // Name of the upgraded gift. A gift can be used only in one chat in a time. When the same gift is used in another chat, theme in the previous chat is reset to default - Name string `json:"name"` -} - -func (entity *InputChatThemeGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InputChatThemeGift - - return json.Marshal((*stub)(entity)) -} - -func (*InputChatThemeGift) GetClass() string { - return ClassInputChatTheme -} - -func (*InputChatThemeGift) GetType() string { - return TypeInputChatThemeGift -} - -func (*InputChatThemeGift) InputChatThemeType() string { - return TypeInputChatThemeGift +func (*ChatTheme) GetType() string { + return TypeChatTheme } // Describes a time zone @@ -50548,256 +43629,157 @@ func (*Hashtags) GetType() string { } // A story can be sent -type CanPostStoryResultOk struct { +type CanSendStoryResultOk struct{ meta - // Number of stories that can be posted by the user - StoryCount int32 `json:"story_count"` } -func (entity *CanPostStoryResultOk) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultOk) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultOk + type stub CanSendStoryResultOk return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultOk) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultOk) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultOk) GetType() string { - return TypeCanPostStoryResultOk +func (*CanSendStoryResultOk) GetType() string { + return TypeCanSendStoryResultOk } -func (*CanPostStoryResultOk) CanPostStoryResultType() string { - return TypeCanPostStoryResultOk +func (*CanSendStoryResultOk) CanSendStoryResultType() string { + return TypeCanSendStoryResultOk } // The user must subscribe to Telegram Premium to be able to post stories -type CanPostStoryResultPremiumNeeded struct{ +type CanSendStoryResultPremiumNeeded struct{ meta } -func (entity *CanPostStoryResultPremiumNeeded) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultPremiumNeeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultPremiumNeeded + type stub CanSendStoryResultPremiumNeeded return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultPremiumNeeded) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultPremiumNeeded) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultPremiumNeeded) GetType() string { - return TypeCanPostStoryResultPremiumNeeded +func (*CanSendStoryResultPremiumNeeded) GetType() string { + return TypeCanSendStoryResultPremiumNeeded } -func (*CanPostStoryResultPremiumNeeded) CanPostStoryResultType() string { - return TypeCanPostStoryResultPremiumNeeded +func (*CanSendStoryResultPremiumNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultPremiumNeeded } // The chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat -type CanPostStoryResultBoostNeeded struct{ +type CanSendStoryResultBoostNeeded struct{ meta } -func (entity *CanPostStoryResultBoostNeeded) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultBoostNeeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultBoostNeeded + type stub CanSendStoryResultBoostNeeded return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultBoostNeeded) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultBoostNeeded) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultBoostNeeded) GetType() string { - return TypeCanPostStoryResultBoostNeeded +func (*CanSendStoryResultBoostNeeded) GetType() string { + return TypeCanSendStoryResultBoostNeeded } -func (*CanPostStoryResultBoostNeeded) CanPostStoryResultType() string { - return TypeCanPostStoryResultBoostNeeded +func (*CanSendStoryResultBoostNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultBoostNeeded } // The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire -type CanPostStoryResultActiveStoryLimitExceeded struct{ +type CanSendStoryResultActiveStoryLimitExceeded struct{ meta } -func (entity *CanPostStoryResultActiveStoryLimitExceeded) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultActiveStoryLimitExceeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultActiveStoryLimitExceeded + type stub CanSendStoryResultActiveStoryLimitExceeded return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultActiveStoryLimitExceeded) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultActiveStoryLimitExceeded) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultActiveStoryLimitExceeded) GetType() string { - return TypeCanPostStoryResultActiveStoryLimitExceeded +func (*CanSendStoryResultActiveStoryLimitExceeded) GetType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded } -func (*CanPostStoryResultActiveStoryLimitExceeded) CanPostStoryResultType() string { - return TypeCanPostStoryResultActiveStoryLimitExceeded +func (*CanSendStoryResultActiveStoryLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultActiveStoryLimitExceeded } // The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time -type CanPostStoryResultWeeklyLimitExceeded struct { +type CanSendStoryResultWeeklyLimitExceeded struct { meta - // Time left before the user can post the next story, in seconds + // Time left before the user can send the next story RetryAfter int32 `json:"retry_after"` } -func (entity *CanPostStoryResultWeeklyLimitExceeded) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultWeeklyLimitExceeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultWeeklyLimitExceeded + type stub CanSendStoryResultWeeklyLimitExceeded return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultWeeklyLimitExceeded) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultWeeklyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultWeeklyLimitExceeded) GetType() string { - return TypeCanPostStoryResultWeeklyLimitExceeded +func (*CanSendStoryResultWeeklyLimitExceeded) GetType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded } -func (*CanPostStoryResultWeeklyLimitExceeded) CanPostStoryResultType() string { - return TypeCanPostStoryResultWeeklyLimitExceeded +func (*CanSendStoryResultWeeklyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultWeeklyLimitExceeded } // The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time -type CanPostStoryResultMonthlyLimitExceeded struct { +type CanSendStoryResultMonthlyLimitExceeded struct { meta - // Time left before the user can post the next story, in seconds + // Time left before the user can send the next story RetryAfter int32 `json:"retry_after"` } -func (entity *CanPostStoryResultMonthlyLimitExceeded) MarshalJSON() ([]byte, error) { +func (entity *CanSendStoryResultMonthlyLimitExceeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub CanPostStoryResultMonthlyLimitExceeded + type stub CanSendStoryResultMonthlyLimitExceeded return json.Marshal((*stub)(entity)) } -func (*CanPostStoryResultMonthlyLimitExceeded) GetClass() string { - return ClassCanPostStoryResult +func (*CanSendStoryResultMonthlyLimitExceeded) GetClass() string { + return ClassCanSendStoryResult } -func (*CanPostStoryResultMonthlyLimitExceeded) GetType() string { - return TypeCanPostStoryResultMonthlyLimitExceeded +func (*CanSendStoryResultMonthlyLimitExceeded) GetType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded } -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 +func (*CanSendStoryResultMonthlyLimitExceeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultMonthlyLimitExceeded } // The session can be used @@ -51404,10 +44386,8 @@ func (*PushMessageContentContact) PushMessageContentType() string { } // A contact has registered with Telegram -type PushMessageContentContactRegistered struct { +type PushMessageContentContactRegistered struct{ meta - // True, if the user joined Telegram as a Telegram Premium account - AsPremiumAccount bool `json:"as_premium_account"` } func (entity *PushMessageContentContactRegistered) MarshalJSON() ([]byte, error) { @@ -51754,8 +44734,6 @@ type PushMessageContentGift struct { meta // Number of Telegram Stars that sender paid for the gift StarCount int64 `json:"star_count"` - // True, if the message is about prepaid upgrade of the gift by another user instead of actual receiving of a new gift - IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` } func (entity *PushMessageContentGift) MarshalJSON() ([]byte, error) { @@ -51781,10 +44759,8 @@ func (*PushMessageContentGift) PushMessageContentType() string { // A message with an upgraded gift type PushMessageContentUpgradedGift struct { meta - // True, if the gift was obtained by upgrading of a previously received gift; otherwise, if is_prepaid_upgrade == false, then this is a transferred or resold gift + // True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift IsUpgrade bool `json:"is_upgrade"` - // True, if the message is about completion of prepaid upgrade of the gift instead of actual receiving of a new gift - IsPrepaidUpgrade bool `json:"is_prepaid_upgrade"` } func (entity *PushMessageContentUpgradedGift) MarshalJSON() ([]byte, error) { @@ -51921,35 +44897,6 @@ func (*PushMessageContentText) PushMessageContentType() string { return TypePushMessageContentText } -// A message with a checklist -type PushMessageContentChecklist struct { - meta - // Checklist title - Title string `json:"title"` - // True, if the message is a pinned message with the specified content - IsPinned bool `json:"is_pinned"` -} - -func (entity *PushMessageContentChecklist) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PushMessageContentChecklist - - return json.Marshal((*stub)(entity)) -} - -func (*PushMessageContentChecklist) GetClass() string { - return ClassPushMessageContent -} - -func (*PushMessageContentChecklist) GetType() string { - return TypePushMessageContentChecklist -} - -func (*PushMessageContentChecklist) PushMessageContentType() string { - return TypePushMessageContentChecklist -} - // A video message type PushMessageContentVideo struct { meta @@ -52256,8 +45203,8 @@ func (*PushMessageContentChatSetBackground) PushMessageContentType() string { // A chat theme was edited type PushMessageContentChatSetTheme struct { meta - // If non-empty, human-readable name of the new theme. Otherwise, the chat theme was reset to the default one - Name string `json:"name"` + // If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one + ThemeName string `json:"theme_name"` } func (entity *PushMessageContentChatSetTheme) MarshalJSON() ([]byte, error) { @@ -52413,31 +45360,6 @@ func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string { return TypePushMessageContentSuggestProfilePhoto } -// A birthdate was suggested to be set -type PushMessageContentSuggestBirthdate struct{ - meta -} - -func (entity *PushMessageContentSuggestBirthdate) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PushMessageContentSuggestBirthdate - - return json.Marshal((*stub)(entity)) -} - -func (*PushMessageContentSuggestBirthdate) GetClass() string { - return ClassPushMessageContent -} - -func (*PushMessageContentSuggestBirthdate) GetType() string { - return TypePushMessageContentSuggestBirthdate -} - -func (*PushMessageContentSuggestBirthdate) PushMessageContentType() string { - return TypePushMessageContentSuggestBirthdate -} - // A user in the chat came within proximity alert range from the current user type PushMessageContentProximityAlertTriggered struct { meta @@ -52465,60 +45387,6 @@ func (*PushMessageContentProximityAlertTriggered) PushMessageContentType() strin return TypePushMessageContentProximityAlertTriggered } -// Some tasks were added to a checklist -type PushMessageContentChecklistTasksAdded struct { - meta - // Number of added tasks - TaskCount int32 `json:"task_count"` -} - -func (entity *PushMessageContentChecklistTasksAdded) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PushMessageContentChecklistTasksAdded - - return json.Marshal((*stub)(entity)) -} - -func (*PushMessageContentChecklistTasksAdded) GetClass() string { - return ClassPushMessageContent -} - -func (*PushMessageContentChecklistTasksAdded) GetType() string { - return TypePushMessageContentChecklistTasksAdded -} - -func (*PushMessageContentChecklistTasksAdded) PushMessageContentType() string { - return TypePushMessageContentChecklistTasksAdded -} - -// Some tasks from a checklist were marked as done or not done -type PushMessageContentChecklistTasksDone struct { - meta - // Number of changed tasks - TaskCount int32 `json:"task_count"` -} - -func (entity *PushMessageContentChecklistTasksDone) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub PushMessageContentChecklistTasksDone - - return json.Marshal((*stub)(entity)) -} - -func (*PushMessageContentChecklistTasksDone) GetClass() string { - return ClassPushMessageContent -} - -func (*PushMessageContentChecklistTasksDone) GetType() string { - return TypePushMessageContentChecklistTasksDone -} - -func (*PushMessageContentChecklistTasksDone) PushMessageContentType() string { - return TypePushMessageContentChecklistTasksDone -} - // A forwarded messages type PushMessageContentMessageForwards struct { meta @@ -52988,54 +45856,6 @@ func (notificationGroup *NotificationGroup) UnmarshalJSON(data []byte) error { return nil } -// Describes a proxy server -type Proxy struct { - meta - // Proxy server domain or IP address - Server string `json:"server"` - // Proxy server port - Port int32 `json:"port"` - // Type of the proxy - Type ProxyType `json:"type"` -} - -func (entity *Proxy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Proxy - - return json.Marshal((*stub)(entity)) -} - -func (*Proxy) GetClass() string { - return ClassProxy -} - -func (*Proxy) GetType() string { - return TypeProxy -} - -func (proxy *Proxy) UnmarshalJSON(data []byte) error { - var tmp struct { - Server string `json:"server"` - Port int32 `json:"port"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - proxy.Server = tmp.Server - proxy.Port = tmp.Port - - fieldType, _ := UnmarshalProxyType(tmp.Type) - proxy.Type = fieldType - - return nil -} - // Represents a boolean option type OptionValueBoolean struct { meta @@ -53940,31 +46760,6 @@ 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 @@ -55426,557 +48221,29 @@ func (*ReportStoryResultTextRequired) ReportStoryResultType() string { return TypeReportStoryResultTextRequired } -// The appearance section -type SettingsSectionAppearance struct { +// The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user +type InternalLinkTypeActiveSessions struct{ meta - // Subsection of the section; may be one of "", "themes", "themes/edit", "themes/create", "wallpapers", "wallpapers/edit", "wallpapers/set", "wallpapers/choose-photo", "your-color/profile", "your-color/profile/add-icons", "your-color/profile/use-gift", "your-color/profile/reset", "your-color/name", "your-color/name/add-icons", "your-color/name/use-gift", "night-mode", "auto-night-mode", "text-size", "text-size/use-system", "message-corners", "animations", "stickers-and-emoji", "stickers-and-emoji/edit", "stickers-and-emoji/trending", "stickers-and-emoji/archived", "stickers-and-emoji/archived/edit", "stickers-and-emoji/emoji", "stickers-and-emoji/emoji/edit", "stickers-and-emoji/emoji/archived", "stickers-and-emoji/emoji/archived/edit", "stickers-and-emoji/emoji/suggest", "stickers-and-emoji/emoji/quick-reaction", "stickers-and-emoji/emoji/quick-reaction/choose", "stickers-and-emoji/suggest-by-emoji", "stickers-and-emoji/large-emoji", "stickers-and-emoji/dynamic-order", "stickers-and-emoji/emoji/show-more", "app-icon", "tap-for-next-media" - Subsection string `json:"subsection"` } -func (entity *SettingsSectionAppearance) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeActiveSessions) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub SettingsSectionAppearance + type stub InternalLinkTypeActiveSessions return json.Marshal((*stub)(entity)) } -func (*SettingsSectionAppearance) GetClass() string { - return ClassSettingsSection +func (*InternalLinkTypeActiveSessions) GetClass() string { + return ClassInternalLinkType } -func (*SettingsSectionAppearance) GetType() string { - return TypeSettingsSectionAppearance +func (*InternalLinkTypeActiveSessions) GetType() string { + return TypeInternalLinkTypeActiveSessions } -func (*SettingsSectionAppearance) SettingsSectionType() string { - return TypeSettingsSectionAppearance -} - -// The "Ask a question" section -type SettingsSectionAskQuestion struct{ - meta -} - -func (entity *SettingsSectionAskQuestion) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionAskQuestion - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionAskQuestion) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionAskQuestion) GetType() string { - return TypeSettingsSectionAskQuestion -} - -func (*SettingsSectionAskQuestion) SettingsSectionType() string { - return TypeSettingsSectionAskQuestion -} - -// The "Telegram Business" section -type SettingsSectionBusiness struct { - meta - // Subsection of the section; may be one of "", "do-not-hide-ads" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionBusiness) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionBusiness - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionBusiness) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionBusiness) GetType() string { - return TypeSettingsSectionBusiness -} - -func (*SettingsSectionBusiness) SettingsSectionType() string { - return TypeSettingsSectionBusiness -} - -// The chat folder settings section -type SettingsSectionChatFolders struct { - meta - // Subsection of the section; may be one of "", "edit", "create", "add-recommended", "show-tags", "tab-view" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionChatFolders) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionChatFolders - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionChatFolders) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionChatFolders) GetType() string { - return TypeSettingsSectionChatFolders -} - -func (*SettingsSectionChatFolders) SettingsSectionType() string { - return TypeSettingsSectionChatFolders -} - -// The data and storage settings section -type SettingsSectionDataAndStorage struct { - meta - // Subsection of the section; may be one of "", "storage", "storage/edit", "storage/auto-remove", "storage/clear-cache", "storage/max-cache", "usage", "usage/mobile", "usage/wifi", "usage/reset", "usage/roaming", "auto-download/mobile", "auto-download/mobile/enable", "auto-download/mobile/usage", "auto-download/mobile/photos", "auto-download/mobile/stories", "auto-download/mobile/videos", "auto-download/mobile/files", "auto-download/wifi", "auto-download/wifi/enable", "auto-download/wifi/usage", "auto-download/wifi/photos", "auto-download/wifi/stories", "auto-download/wifi/videos", "auto-download/wifi/files", "auto-download/roaming", "auto-download/roaming/enable", "auto-download/roaming/usage", "auto-download/roaming/photos", "auto-download/roaming/stories", "auto-download/roaming/videos", "auto-download/roaming/files", "auto-download/reset", "save-to-photos/chats", "save-to-photos/chats/max-video-size", "save-to-photos/chats/add-exception", "save-to-photos/chats/delete-all", "save-to-photos/groups", "save-to-photos/groups/max-video-size", "save-to-photos/groups/add-exception", "save-to-photos/groups/delete-all", "save-to-photos/channels", "save-to-photos/channels/max-video-size", "save-to-photos/channels/add-exception", "save-to-photos/channels/delete-all", "less-data-calls", "open-links", "share-sheet", "share-sheet/suggested-chats", "share-sheet/suggest-by", "share-sheet/reset", "saved-edited-photos", "pause-music", "raise-to-listen", "raise-to-speak", "show-18-content", "proxy", "proxy/edit", "proxy/use-proxy", "proxy/add-proxy", "proxy/share-list", "proxy/use-for-calls" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionDataAndStorage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionDataAndStorage - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionDataAndStorage) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionDataAndStorage) GetType() string { - return TypeSettingsSectionDataAndStorage -} - -func (*SettingsSectionDataAndStorage) SettingsSectionType() string { - return TypeSettingsSectionDataAndStorage -} - -// The Devices section -type SettingsSectionDevices struct { - meta - // Subsection of the section; may be one of "", "edit", "link-desktop", "terminate-sessions", "auto-terminate" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionDevices) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionDevices - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionDevices) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionDevices) GetType() string { - return TypeSettingsSectionDevices -} - -func (*SettingsSectionDevices) SettingsSectionType() string { - return TypeSettingsSectionDevices -} - -// The profile edit section -type SettingsSectionEditProfile struct { - meta - // Subsection of the section; may be one of "", "set-photo", "first-name", "last-name", "emoji-status", "bio", "birthday", "change-number", "username", "your-color", "channel", "add-account", "log-out", "profile-color/profile", "profile-color/profile/add-icons", "profile-color/profile/use-gift", "profile-color/name", "profile-color/name/add-icons", "profile-color/name/use-gift", "profile-photo/use-emoji" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionEditProfile) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionEditProfile - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionEditProfile) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionEditProfile) GetType() string { - return TypeSettingsSectionEditProfile -} - -func (*SettingsSectionEditProfile) SettingsSectionType() string { - return TypeSettingsSectionEditProfile -} - -// The FAQ section -type SettingsSectionFaq struct{ - meta -} - -func (entity *SettingsSectionFaq) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionFaq - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionFaq) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionFaq) GetType() string { - return TypeSettingsSectionFaq -} - -func (*SettingsSectionFaq) SettingsSectionType() string { - return TypeSettingsSectionFaq -} - -// The "Telegram Features" section -type SettingsSectionFeatures struct{ - meta -} - -func (entity *SettingsSectionFeatures) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionFeatures - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionFeatures) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionFeatures) GetType() string { - return TypeSettingsSectionFeatures -} - -func (*SettingsSectionFeatures) SettingsSectionType() string { - return TypeSettingsSectionFeatures -} - -// The in-app browser settings section -type SettingsSectionInAppBrowser struct { - meta - // Subsection of the section; may be one of "", "enable-browser", "clear-cookies", "clear-cache", "history", "clear-history", "never-open", "clear-list", "search" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionInAppBrowser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionInAppBrowser - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionInAppBrowser) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionInAppBrowser) GetType() string { - return TypeSettingsSectionInAppBrowser -} - -func (*SettingsSectionInAppBrowser) SettingsSectionType() string { - return TypeSettingsSectionInAppBrowser -} - -// The application language section -type SettingsSectionLanguage struct { - meta - // Subsection of the section; may be one of "", "show-button" for Show Translate Button toggle, "translate-chats" for Translate Entire Chats toggle, "do-not-translate" - for Do Not Translate language list - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionLanguage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionLanguage - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionLanguage) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionLanguage) GetType() string { - return TypeSettingsSectionLanguage -} - -func (*SettingsSectionLanguage) SettingsSectionType() string { - return TypeSettingsSectionLanguage -} - -// The Telegram Star balance and transaction section -type SettingsSectionMyStars struct { - meta - // Subsection of the section; may be one of "", "top-up", "stats", "gift", "earn" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionMyStars) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionMyStars - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionMyStars) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionMyStars) GetType() string { - return TypeSettingsSectionMyStars -} - -func (*SettingsSectionMyStars) SettingsSectionType() string { - return TypeSettingsSectionMyStars -} - -// The Toncoin balance and transaction section -type SettingsSectionMyToncoins struct{ - meta -} - -func (entity *SettingsSectionMyToncoins) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionMyToncoins - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionMyToncoins) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionMyToncoins) GetType() string { - return TypeSettingsSectionMyToncoins -} - -func (*SettingsSectionMyToncoins) SettingsSectionType() string { - return TypeSettingsSectionMyToncoins -} - -// The notification settings section -type SettingsSectionNotifications struct { - meta - // Subsection of the section; may be one of "", "accounts", "private-chats", "private-chats/edit", "private-chats/show", "private-chats/preview", "private-chats/sound", "private-chats/add-exception", "private-chats/delete-exceptions", "private-chats/light-color", "private-chats/vibrate", "private-chats/priority", "groups", "groups/edit", "groups/show", "groups/preview", "groups/sound", "groups/add-exception", "groups/delete-exceptions", "groups/light-color", "groups/vibrate", "groups/priority", "channels", "channels/edit", "channels/show", "channels/preview", "channels/sound", "channels/add-exception", "channels/delete-exceptions", "channels/light-color", "channels/vibrate", "channels/priority", "stories", "stories/new", "stories/important", "stories/show-sender", "stories/sound", "stories/add-exception", "stories/delete-exceptions", "stories/light-color", "stories/vibrate", "stories/priority", "reactions", "reactions/messages", "reactions/stories", "reactions/show-sender", "reactions/sound", "reactions/light-color", "reactions/vibrate", "reactions/priority", "in-app-sounds", "in-app-vibrate", "in-app-preview", "in-chat-sounds", "in-app-popup", "lock-screen-names", "include-channels", "include-muted-chats", "count-unread-messages", "new-contacts", "pinned-messages", "reset", "web" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionNotifications) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionNotifications - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionNotifications) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionNotifications) GetType() string { - return TypeSettingsSectionNotifications -} - -func (*SettingsSectionNotifications) SettingsSectionType() string { - return TypeSettingsSectionNotifications -} - -// The power saving settings section -type SettingsSectionPowerSaving struct { - meta - // Subsection of the section; may be one of "", "videos", "gifs", "stickers", "emoji", "effects", "preload", "background", "call-animations", "particles", "transitions" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionPowerSaving) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionPowerSaving - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionPowerSaving) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionPowerSaving) GetType() string { - return TypeSettingsSectionPowerSaving -} - -func (*SettingsSectionPowerSaving) SettingsSectionType() string { - return TypeSettingsSectionPowerSaving -} - -// The "Telegram Premium" section -type SettingsSectionPremium struct{ - meta -} - -func (entity *SettingsSectionPremium) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionPremium - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionPremium) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionPremium) GetType() string { - return TypeSettingsSectionPremium -} - -func (*SettingsSectionPremium) SettingsSectionType() string { - return TypeSettingsSectionPremium -} - -// The privacy and security section -type SettingsSectionPrivacyAndSecurity struct { - meta - // Subsection of the section; may be one of "", "blocked", "blocked/edit", "blocked/block-user", "blocked/block-user/chats", "blocked/block-user/contacts", "active-websites", "active-websites/edit", "active-websites/disconnect-all", "passcode", "passcode/disable", "passcode/change", "passcode/auto-lock", "passcode/face-id", "passcode/fingerprint", "2sv", "2sv/change", "2sv/disable", "2sv/change-email", "passkey", "passkey/create", "auto-delete", "auto-delete/set-custom", "login-email", "phone-number", "phone-number/never", "phone-number/always", "last-seen", "last-seen/never", "last-seen/always", "last-seen/hide-read-time", "profile-photos", "profile-photos/never", "profile-photos/always", "profile-photos/set-public", "profile-photos/update-public", "profile-photos/remove-public", "bio", "bio/never", "bio/always", "gifts", "gifts/show-icon", "gifts/never", "gifts/always", "gifts/accepted-types", "birthday", "birthday/add", "birthday/never", "birthday/always", "saved-music", "saved-music/never", "saved-music/always", "forwards", "forwards/never", "forwards/always", "calls", "calls/never", "calls/always", "calls/p2p", "calls/p2p/never", "calls/p2p/always", "calls/ios-integration", "voice", "voice/never", "voice/always", "messages", "messages/set-price", "messages/exceptions", "invites", "invites/never", "invites/always", "self-destruct", "data-settings", "data-settings/sync-contacts", "data-settings/delete-synced", "data-settings/suggest-contacts", "data-settings/delete-cloud-drafts", "data-settings/clear-payment-info", "data-settings/link-previews", "data-settings/bot-settings", "data-settings/map-provider", "archive-and-mute" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionPrivacyAndSecurity) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionPrivacyAndSecurity - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionPrivacyAndSecurity) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionPrivacyAndSecurity) GetType() string { - return TypeSettingsSectionPrivacyAndSecurity -} - -func (*SettingsSectionPrivacyAndSecurity) SettingsSectionType() string { - return TypeSettingsSectionPrivacyAndSecurity -} - -// The "Privacy Policy" section -type SettingsSectionPrivacyPolicy struct{ - meta -} - -func (entity *SettingsSectionPrivacyPolicy) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionPrivacyPolicy - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionPrivacyPolicy) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionPrivacyPolicy) GetType() string { - return TypeSettingsSectionPrivacyPolicy -} - -func (*SettingsSectionPrivacyPolicy) SettingsSectionType() string { - return TypeSettingsSectionPrivacyPolicy -} - -// The current user's QR code section -type SettingsSectionQrCode struct { - meta - // Subsection of the section; may be one of "", "share", "scan" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionQrCode) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionQrCode - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionQrCode) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionQrCode) GetType() string { - return TypeSettingsSectionQrCode -} - -func (*SettingsSectionQrCode) SettingsSectionType() string { - return TypeSettingsSectionQrCode -} - -// Search in Settings -type SettingsSectionSearch struct{ - meta -} - -func (entity *SettingsSectionSearch) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionSearch - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionSearch) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionSearch) GetType() string { - return TypeSettingsSectionSearch -} - -func (*SettingsSectionSearch) SettingsSectionType() string { - return TypeSettingsSectionSearch -} - -// The "Send a gift" section -type SettingsSectionSendGift struct { - meta - // Subsection of the section; may be one of "", "self" - Subsection string `json:"subsection"` -} - -func (entity *SettingsSectionSendGift) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SettingsSectionSendGift - - return json.Marshal((*stub)(entity)) -} - -func (*SettingsSectionSendGift) GetClass() string { - return ClassSettingsSection -} - -func (*SettingsSectionSendGift) GetType() string { - return TypeSettingsSectionSendGift -} - -func (*SettingsSectionSendGift) SettingsSectionType() string { - return TypeSettingsSectionSendGift +func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { + return TypeInternalLinkTypeActiveSessions } // The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL @@ -56203,31 +48470,58 @@ func (*InternalLinkTypeBusinessChat) InternalLinkTypeType() string { return TypeInternalLinkTypeBusinessChat } -// The link is a link to the Call tab or page -type InternalLinkTypeCallsPage struct { +// The link is a link to the Telegram Star purchase section of the application +type InternalLinkTypeBuyStars struct { meta - // Section of the page; may be one of "", "all", "missed", "edit", "show-tab", "start-call" - Section string `json:"section"` + // The number of Telegram Stars that must be owned by the user + StarCount int64 `json:"star_count"` + // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions + Purpose string `json:"purpose"` } -func (entity *InternalLinkTypeCallsPage) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeBuyStars) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeCallsPage + type stub InternalLinkTypeBuyStars return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeCallsPage) GetClass() string { +func (*InternalLinkTypeBuyStars) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeCallsPage) GetType() string { - return TypeInternalLinkTypeCallsPage +func (*InternalLinkTypeBuyStars) GetType() string { + return TypeInternalLinkTypeBuyStars } -func (*InternalLinkTypeCallsPage) InternalLinkTypeType() string { - return TypeInternalLinkTypeCallsPage +func (*InternalLinkTypeBuyStars) InternalLinkTypeType() string { + return TypeInternalLinkTypeBuyStars +} + +// The link is a link to the change phone number section of the application +type InternalLinkTypeChangePhoneNumber struct{ + meta +} + +func (entity *InternalLinkTypeChangePhoneNumber) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChangePhoneNumber + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChangePhoneNumber) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChangePhoneNumber) GetType() string { + return TypeInternalLinkTypeChangePhoneNumber +} + +func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { + return TypeInternalLinkTypeChangePhoneNumber } // The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link @@ -56313,6 +48607,31 @@ func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatFolderInvite } +// The link is a link to the folder section of the application settings +type InternalLinkTypeChatFolderSettings struct{ + meta +} + +func (entity *InternalLinkTypeChatFolderSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderSettings) GetType() string { + return TypeInternalLinkTypeChatFolderSettings +} + +func (*InternalLinkTypeChatFolderSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderSettings +} + // The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink type InternalLinkTypeChatInvite struct { meta @@ -56340,83 +48659,54 @@ func (*InternalLinkTypeChatInvite) InternalLinkTypeType() string { return TypeInternalLinkTypeChatInvite } -// The link is a link that allows to select some chats -type InternalLinkTypeChatSelection struct{ +// The link is a link to the default message auto-delete timer settings section of the application settings +type InternalLinkTypeDefaultMessageAutoDeleteTimerSettings struct{ meta } -func (entity *InternalLinkTypeChatSelection) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeChatSelection + type stub InternalLinkTypeDefaultMessageAutoDeleteTimerSettings return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeChatSelection) GetClass() string { +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeChatSelection) GetType() string { - return TypeInternalLinkTypeChatSelection +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) GetType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings } -func (*InternalLinkTypeChatSelection) InternalLinkTypeType() string { - return TypeInternalLinkTypeChatSelection +func (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings } -// The link is a link to the Contacts tab or page -type InternalLinkTypeContactsPage struct { +// The link is a link to the edit profile section of the application settings +type InternalLinkTypeEditProfileSettings struct{ meta - // Section of the page; may be one of "", "search", "sort", "new", "invite", "manage" - Section string `json:"section"` } -func (entity *InternalLinkTypeContactsPage) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeEditProfileSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeContactsPage + type stub InternalLinkTypeEditProfileSettings return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeContactsPage) GetClass() string { +func (*InternalLinkTypeEditProfileSettings) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeContactsPage) GetType() string { - return TypeInternalLinkTypeContactsPage +func (*InternalLinkTypeEditProfileSettings) GetType() string { + return TypeInternalLinkTypeEditProfileSettings } -func (*InternalLinkTypeContactsPage) InternalLinkTypeType() string { - return TypeInternalLinkTypeContactsPage -} - -// The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. If the chat is found and is channel, open the direct messages chat of the channel -type InternalLinkTypeDirectMessagesChat struct { - meta - // Username of the channel - ChannelUsername string `json:"channel_username"` -} - -func (entity *InternalLinkTypeDirectMessagesChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeDirectMessagesChat - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeDirectMessagesChat) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeDirectMessagesChat) GetType() string { - return TypeInternalLinkTypeDirectMessagesChat -} - -func (*InternalLinkTypeDirectMessagesChat) InternalLinkTypeType() string { - return TypeInternalLinkTypeDirectMessagesChat +func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeEditProfileSettings } // The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame @@ -56448,89 +48738,6 @@ 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 - // Username of the owner of the gift collection - GiftOwnerUsername string `json:"gift_owner_username"` - // Gift collection identifier - CollectionId int32 `json:"collection_id"` -} - -func (entity *InternalLinkTypeGiftCollection) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeGiftCollection - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeGiftCollection) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeGiftCollection) GetType() string { - return TypeInternalLinkTypeGiftCollection -} - -func (*InternalLinkTypeGiftCollection) InternalLinkTypeType() string { - return TypeInternalLinkTypeGiftCollection -} - -// The link is a link to a group call that isn't bound to a chat. Use getGroupCallParticipants to get the list of group call participants and show them on the join group call screen. Call joinGroupCall with the given invite_link to join the call -type InternalLinkTypeGroupCall struct { - meta - // Internal representation of the invite link - InviteLink string `json:"invite_link"` -} - -func (entity *InternalLinkTypeGroupCall) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeGroupCall - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeGroupCall) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeGroupCall) GetType() string { - return TypeInternalLinkTypeGroupCall -} - -func (*InternalLinkTypeGroupCall) InternalLinkTypeType() string { - return TypeInternalLinkTypeGroupCall -} - // The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser type InternalLinkTypeInstantView struct { meta @@ -56614,31 +48821,29 @@ func (*InternalLinkTypeLanguagePack) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguagePack } -// 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 { +// The link is a link to the language section of the application settings +type InternalLinkTypeLanguageSettings struct{ meta - // Username of the poster of the story - StoryPosterUsername string `json:"story_poster_username"` } -func (entity *InternalLinkTypeLiveStory) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypeLanguageSettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypeLiveStory + type stub InternalLinkTypeLanguageSettings return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypeLiveStory) GetClass() string { +func (*InternalLinkTypeLanguageSettings) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypeLiveStory) GetType() string { - return TypeInternalLinkTypeLiveStory +func (*InternalLinkTypeLanguageSettings) GetType() string { + return TypeInternalLinkTypeLanguageSettings } -func (*InternalLinkTypeLiveStory) InternalLinkTypeType() string { - return TypeInternalLinkTypeLiveStory +func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeLanguageSettings } // 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 @@ -56749,151 +48954,6 @@ func (*InternalLinkTypeMessageDraft) InternalLinkTypeType() string { return TypeInternalLinkTypeMessageDraft } -// The link is a link to the My Profile application page -type InternalLinkTypeMyProfilePage struct { - meta - // Section of the page; may be one of "", "posts", "posts/all-stories", "posts/add-album", "gifts", "archived-posts" - Section string `json:"section"` -} - -func (entity *InternalLinkTypeMyProfilePage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeMyProfilePage - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeMyProfilePage) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeMyProfilePage) GetType() string { - return TypeInternalLinkTypeMyProfilePage -} - -func (*InternalLinkTypeMyProfilePage) InternalLinkTypeType() string { - return TypeInternalLinkTypeMyProfilePage -} - -// The link is a link to the screen for creating a new channel chat -type InternalLinkTypeNewChannelChat struct{ - meta -} - -func (entity *InternalLinkTypeNewChannelChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeNewChannelChat - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeNewChannelChat) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeNewChannelChat) GetType() string { - return TypeInternalLinkTypeNewChannelChat -} - -func (*InternalLinkTypeNewChannelChat) InternalLinkTypeType() string { - return TypeInternalLinkTypeNewChannelChat -} - -// The link is a link to the screen for creating a new group chat -type InternalLinkTypeNewGroupChat struct{ - meta -} - -func (entity *InternalLinkTypeNewGroupChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeNewGroupChat - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeNewGroupChat) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeNewGroupChat) GetType() string { - return TypeInternalLinkTypeNewGroupChat -} - -func (*InternalLinkTypeNewGroupChat) InternalLinkTypeType() string { - return TypeInternalLinkTypeNewGroupChat -} - -// The link is a link to the screen for creating a new private chat with a contact -type InternalLinkTypeNewPrivateChat struct{ - meta -} - -func (entity *InternalLinkTypeNewPrivateChat) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeNewPrivateChat - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeNewPrivateChat) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeNewPrivateChat) GetType() string { - return TypeInternalLinkTypeNewPrivateChat -} - -func (*InternalLinkTypeNewPrivateChat) InternalLinkTypeType() string { - return TypeInternalLinkTypeNewPrivateChat -} - -// The link is a link to open the story posting interface -type InternalLinkTypeNewStory struct { - meta - // The type of the content of the story to post; may be null if unspecified - ContentType StoryContentType `json:"content_type"` -} - -func (entity *InternalLinkTypeNewStory) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeNewStory - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeNewStory) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeNewStory) GetType() string { - return TypeInternalLinkTypeNewStory -} - -func (*InternalLinkTypeNewStory) InternalLinkTypeType() string { - return TypeInternalLinkTypeNewStory -} - -func (internalLinkTypeNewStory *InternalLinkTypeNewStory) UnmarshalJSON(data []byte) error { - var tmp struct { - ContentType json.RawMessage `json:"content_type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldContentType, _ := UnmarshalStoryContentType(tmp.ContentType) - internalLinkTypeNewStory.ContentType = fieldContentType - - return nil -} - // The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it type InternalLinkTypePassportDataRequest struct { meta @@ -56959,30 +49019,57 @@ func (*InternalLinkTypePhoneNumberConfirmation) InternalLinkTypeType() string { } // 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 InternalLinkTypePremiumFeaturesPage struct { +type InternalLinkTypePremiumFeatures struct { meta // Referrer specified in the link Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePremiumFeaturesPage) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePremiumFeatures) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePremiumFeaturesPage + type stub InternalLinkTypePremiumFeatures return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePremiumFeaturesPage) GetClass() string { +func (*InternalLinkTypePremiumFeatures) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePremiumFeaturesPage) GetType() string { - return TypeInternalLinkTypePremiumFeaturesPage +func (*InternalLinkTypePremiumFeatures) GetType() string { + return TypeInternalLinkTypePremiumFeatures } -func (*InternalLinkTypePremiumFeaturesPage) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumFeaturesPage +func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumFeatures +} + +// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases +type InternalLinkTypePremiumGift struct { + meta + // Referrer specified in the link + Referrer string `json:"referrer"` +} + +func (entity *InternalLinkTypePremiumGift) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGift + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGift) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGift) GetType() string { + return TypeInternalLinkTypePremiumGift +} + +func (*InternalLinkTypePremiumGift) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGift } // The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode @@ -57012,38 +49099,40 @@ func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { return TypeInternalLinkTypePremiumGiftCode } -// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases -type InternalLinkTypePremiumGiftPurchase struct { +// The link is a link to the privacy and security section of the application settings +type InternalLinkTypePrivacyAndSecuritySettings struct{ meta - // Referrer specified in the link - Referrer string `json:"referrer"` } -func (entity *InternalLinkTypePremiumGiftPurchase) MarshalJSON() ([]byte, error) { +func (entity *InternalLinkTypePrivacyAndSecuritySettings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub InternalLinkTypePremiumGiftPurchase + type stub InternalLinkTypePrivacyAndSecuritySettings return json.Marshal((*stub)(entity)) } -func (*InternalLinkTypePremiumGiftPurchase) GetClass() string { +func (*InternalLinkTypePrivacyAndSecuritySettings) GetClass() string { return ClassInternalLinkType } -func (*InternalLinkTypePremiumGiftPurchase) GetType() string { - return TypeInternalLinkTypePremiumGiftPurchase +func (*InternalLinkTypePrivacyAndSecuritySettings) GetType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings } -func (*InternalLinkTypePremiumGiftPurchase) InternalLinkTypeType() string { - return TypeInternalLinkTypePremiumGiftPurchase +func (*InternalLinkTypePrivacyAndSecuritySettings) InternalLinkTypeType() string { + return TypeInternalLinkTypePrivacyAndSecuritySettings } // The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy type InternalLinkTypeProxy struct { meta - // The proxy; may be null if the proxy is unsupported, in which case an alert can be shown to the user - Proxy *Proxy `json:"proxy"` + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` + // Type of the proxy + Type ProxyType `json:"type"` } func (entity *InternalLinkTypeProxy) MarshalJSON() ([]byte, error) { @@ -57066,6 +49155,27 @@ func (*InternalLinkTypeProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeProxy } +func (internalLinkTypeProxy *InternalLinkTypeProxy) UnmarshalJSON(data []byte) error { + var tmp struct { + Server string `json:"server"` + Port int32 `json:"port"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + internalLinkTypeProxy.Server = tmp.Server + internalLinkTypeProxy.Port = tmp.Port + + fieldType, _ := UnmarshalProxyType(tmp.Type) + internalLinkTypeProxy.Type = fieldType + + return nil +} + // The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. If the chat is found, open its profile information screen or the chat itself. If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field type InternalLinkTypePublicChat struct { meta @@ -57147,61 +49257,9 @@ func (*InternalLinkTypeRestorePurchases) InternalLinkTypeType() string { return TypeInternalLinkTypeRestorePurchases } -// The link is a link to the Saved Messages chat. Call createPrivateChat with getOption("my_id") and open the chat -type InternalLinkTypeSavedMessages struct{ - meta -} - -func (entity *InternalLinkTypeSavedMessages) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeSavedMessages - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeSavedMessages) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeSavedMessages) GetType() string { - return TypeInternalLinkTypeSavedMessages -} - -func (*InternalLinkTypeSavedMessages) InternalLinkTypeType() string { - return TypeInternalLinkTypeSavedMessages -} - -// The link is a link to the global chat and messages search field -type InternalLinkTypeSearch struct{ - meta -} - -func (entity *InternalLinkTypeSearch) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeSearch - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeSearch) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeSearch) GetType() string { - return TypeInternalLinkTypeSearch -} - -func (*InternalLinkTypeSearch) InternalLinkTypeType() string { - return TypeInternalLinkTypeSearch -} - // The link is a link to application settings -type InternalLinkTypeSettings struct { +type InternalLinkTypeSettings struct{ meta - // Section of the application settings to open; may be null if none - Section SettingsSection `json:"section"` } func (entity *InternalLinkTypeSettings) MarshalJSON() ([]byte, error) { @@ -57224,51 +49282,6 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } -func (internalLinkTypeSettings *InternalLinkTypeSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - Section json.RawMessage `json:"section"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - fieldSection, _ := UnmarshalSettingsSection(tmp.Section) - internalLinkTypeSettings.Section = fieldSection - - return nil -} - -// The link is a link to the Telegram Star purchase section of the application -type InternalLinkTypeStarPurchase struct { - meta - // The number of Telegram Stars that must be owned by the user - StarCount int64 `json:"star_count"` - // Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions - Purpose string `json:"purpose"` -} - -func (entity *InternalLinkTypeStarPurchase) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeStarPurchase - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeStarPurchase) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeStarPurchase) GetType() string { - return TypeInternalLinkTypeStarPurchase -} - -func (*InternalLinkTypeStarPurchase) InternalLinkTypeType() string { - return TypeInternalLinkTypeStarPurchase -} - // The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet type InternalLinkTypeStickerSet struct { meta @@ -57298,11 +49311,11 @@ func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { return TypeInternalLinkTypeStickerSet } -// The link is a link to a story. Call searchPublicChat with the given poster username, then call getStory with the received chat identifier and the given story identifier, then show the story if received +// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier, then show the story if received type InternalLinkTypeStory struct { meta - // Username of the poster of the story - StoryPosterUsername string `json:"story_poster_username"` + // Username of the sender of the story + StorySenderUsername string `json:"story_sender_username"` // Story identifier StoryId int32 `json:"story_id"` } @@ -57327,35 +49340,6 @@ func (*InternalLinkTypeStory) InternalLinkTypeType() string { return TypeInternalLinkTypeStory } -// The link is a link to an album of stories. Call searchPublicChat with the given username, then call getStoryAlbumStories with the received chat identifier and the given story album identifier, then show the story album if received -type InternalLinkTypeStoryAlbum struct { - meta - // Username of the owner of the story album - StoryAlbumOwnerUsername string `json:"story_album_owner_username"` - // Story album identifier - StoryAlbumId int32 `json:"story_album_id"` -} - -func (entity *InternalLinkTypeStoryAlbum) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeStoryAlbum - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeStoryAlbum) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeStoryAlbum) GetType() string { - return TypeInternalLinkTypeStoryAlbum -} - -func (*InternalLinkTypeStoryAlbum) InternalLinkTypeType() string { - return TypeInternalLinkTypeStoryAlbum -} - // The link is a link to a cloud theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { meta @@ -57383,6 +49367,31 @@ func (*InternalLinkTypeTheme) InternalLinkTypeType() string { return TypeInternalLinkTypeTheme } +// The link is a link to the theme section of the application settings +type InternalLinkTypeThemeSettings struct{ + meta +} + +func (entity *InternalLinkTypeThemeSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeThemeSettings + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeThemeSettings) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeThemeSettings) GetType() string { + return TypeInternalLinkTypeThemeSettings +} + +func (*InternalLinkTypeThemeSettings) InternalLinkTypeType() string { + return TypeInternalLinkTypeThemeSettings +} + // The link is an unknown tg: link. Call getDeepLinkInfo to process the link type InternalLinkTypeUnknownDeepLink struct { meta @@ -57410,6 +49419,31 @@ func (*InternalLinkTypeUnknownDeepLink) InternalLinkTypeType() string { return TypeInternalLinkTypeUnknownDeepLink } +// The link is a link to an unsupported proxy. An alert can be shown to the user +type InternalLinkTypeUnsupportedProxy struct{ + meta +} + +func (entity *InternalLinkTypeUnsupportedProxy) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeUnsupportedProxy + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeUnsupportedProxy) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeUnsupportedProxy) GetType() string { + return TypeInternalLinkTypeUnsupportedProxy +} + +func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { + return TypeInternalLinkTypeUnsupportedProxy +} + // The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link type InternalLinkTypeUpgradedGift struct { meta @@ -57495,7 +49529,7 @@ func (*InternalLinkTypeUserToken) InternalLinkTypeType() string { return TypeInternalLinkTypeUserToken } -// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinVideoChat with the given invite hash to process the link +// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link type InternalLinkTypeVideoChat struct { meta // Username of the chat with the video chat @@ -57614,8 +49648,8 @@ type MessageLinkInfo struct { IsPublic bool `json:"is_public"` // If found, identifier of the chat to which the link points, 0 otherwise ChatId int64 `json:"chat_id"` - // Identifier of the specific topic in which the message must be opened, or a topic to open if the message is missing; may be null if none - TopicId MessageTopic `json:"topic_id"` + // If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing + MessageThreadId int64 `json:"message_thread_id"` // If found, the linked message; may be null Message *Message `json:"message"` // Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview @@ -57640,33 +49674,6 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } -func (messageLinkInfo *MessageLinkInfo) UnmarshalJSON(data []byte) error { - var tmp struct { - IsPublic bool `json:"is_public"` - ChatId int64 `json:"chat_id"` - TopicId json.RawMessage `json:"topic_id"` - Message *Message `json:"message"` - MediaTimestamp int32 `json:"media_timestamp"` - ForAlbum bool `json:"for_album"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - messageLinkInfo.IsPublic = tmp.IsPublic - messageLinkInfo.ChatId = tmp.ChatId - messageLinkInfo.Message = tmp.Message - messageLinkInfo.MediaTimestamp = tmp.MediaTimestamp - messageLinkInfo.ForAlbum = tmp.ForAlbum - - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - messageLinkInfo.TopicId = fieldTopicId - - return nil -} - // Contains an HTTPS link to boost a chat type ChatBoostLink struct { meta @@ -57767,6 +49774,29 @@ func (*BlockListStories) BlockListType() string { return TypeBlockListStories } +// Contains a part of a file +type FilePart struct { + meta + // File bytes + Data []byte `json:"data"` +} + +func (entity *FilePart) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FilePart + + return json.Marshal((*stub)(entity)) +} + +func (*FilePart) GetClass() string { + return ClassFilePart +} + +func (*FilePart) GetType() string { + return TypeFilePart +} + // The data is not a file type FileTypeNone struct{ meta @@ -59157,33 +51187,6 @@ func (*ConnectionStateReady) ConnectionStateType() string { return TypeConnectionStateReady } -// Describes parameters for age verification of the current user -type AgeVerificationParameters struct { - meta - // The minimum age required to view restricted content - MinAge int32 `json:"min_age"` - // Username of the bot which main Web App may be used to verify age of the user - VerificationBotUsername string `json:"verification_bot_username"` - // Unique name for the country or region, which legislation required age verification. May be used to get the corresponding localization key - Country string `json:"country"` -} - -func (entity *AgeVerificationParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub AgeVerificationParameters - - return json.Marshal((*stub)(entity)) -} - -func (*AgeVerificationParameters) GetClass() string { - return ClassAgeVerificationParameters -} - -func (*AgeVerificationParameters) GetType() string { - return TypeAgeVerificationParameters -} - // A category containing frequently used private chats with non-bot users type TopChatCategoryUsers struct{ meta @@ -59963,91 +51966,6 @@ func (*SuggestedActionExtendStarSubscriptions) SuggestedActionType() string { return TypeSuggestedActionExtendStarSubscriptions } -// A custom suggestion to be shown at the top of the chat list -type SuggestedActionCustom struct { - meta - // Unique name of the suggestion - Name string `json:"name"` - // Title of the suggestion - Title *FormattedText `json:"title"` - // Description of the suggestion - Description *FormattedText `json:"description"` - // The link to open when the suggestion is clicked - Url string `json:"url"` -} - -func (entity *SuggestedActionCustom) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub SuggestedActionCustom - - return json.Marshal((*stub)(entity)) -} - -func (*SuggestedActionCustom) GetClass() string { - return ClassSuggestedAction -} - -func (*SuggestedActionCustom) GetType() string { - return TypeSuggestedActionCustom -} - -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 @@ -60094,29 +52012,6 @@ func (*Text) GetType() string { return TypeText } -// Contains some binary data -type Data struct { - meta - // Data - Data []byte `json:"data"` -} - -func (entity *Data) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Data - - return json.Marshal((*stub)(entity)) -} - -func (*Data) GetClass() string { - return ClassData -} - -func (*Data) GetType() string { - return TypeData -} - // Contains a value representing a number of seconds type Seconds struct { meta @@ -60350,56 +52245,87 @@ func (*ProxyTypeMtproto) ProxyTypeType() string { return TypeProxyTypeMtproto } -// Contains information about a proxy server added to the list of proxies -type AddedProxy struct { +// Contains information about a proxy server +type Proxy struct { meta // Unique identifier of the proxy Id int32 `json:"id"` + // Proxy server domain or IP address + Server string `json:"server"` + // Proxy server port + Port int32 `json:"port"` // Point in time (Unix timestamp) when the proxy was last used; 0 if never LastUsedDate int32 `json:"last_used_date"` // True, if the proxy is enabled now IsEnabled bool `json:"is_enabled"` - // The proxy - Proxy *Proxy `json:"proxy"` + // Type of the proxy + Type ProxyType `json:"type"` } -func (entity *AddedProxy) MarshalJSON() ([]byte, error) { +func (entity *Proxy) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub AddedProxy + type stub Proxy return json.Marshal((*stub)(entity)) } -func (*AddedProxy) GetClass() string { - return ClassAddedProxy +func (*Proxy) GetClass() string { + return ClassProxy } -func (*AddedProxy) GetType() string { - return TypeAddedProxy +func (*Proxy) GetType() string { + return TypeProxy } -// Represents a list of added proxy servers -type AddedProxies struct { +func (proxy *Proxy) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + Server string `json:"server"` + Port int32 `json:"port"` + LastUsedDate int32 `json:"last_used_date"` + IsEnabled bool `json:"is_enabled"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + proxy.Id = tmp.Id + proxy.Server = tmp.Server + proxy.Port = tmp.Port + proxy.LastUsedDate = tmp.LastUsedDate + proxy.IsEnabled = tmp.IsEnabled + + fieldType, _ := UnmarshalProxyType(tmp.Type) + proxy.Type = fieldType + + return nil +} + +// Represents a list of proxy servers +type Proxies struct { meta // List of proxy servers - Proxies []*AddedProxy `json:"proxies"` + Proxies []*Proxy `json:"proxies"` } -func (entity *AddedProxies) MarshalJSON() ([]byte, error) { +func (entity *Proxies) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub AddedProxies + type stub Proxies return json.Marshal((*stub)(entity)) } -func (*AddedProxies) GetClass() string { - return ClassAddedProxies +func (*Proxies) GetClass() string { + return ClassProxies } -func (*AddedProxies) GetType() string { - return TypeAddedProxies +func (*Proxies) GetType() string { + return TypeProxies } // A sticker to be added to a sticker set @@ -60622,7 +52548,7 @@ func (*ChatStatisticsObjectTypeMessage) ChatStatisticsObjectTypeType() string { return TypeChatStatisticsObjectTypeMessage } -// Describes a story posted on behalf of the chat +// Describes a story sent by the chat type ChatStatisticsObjectTypeStory struct { meta // Story identifier @@ -60649,7 +52575,7 @@ func (*ChatStatisticsObjectTypeStory) ChatStatisticsObjectTypeType() string { return TypeChatStatisticsObjectTypeStory } -// Contains statistics about interactions with a message sent in the chat or a story posted on behalf of the chat +// Contains statistics about interactions with a message sent in the chat or a story sent by the chat type ChatStatisticsInteractionInfo struct { meta // Type of the object @@ -60913,11 +52839,11 @@ type ChatStatisticsChannel struct { MeanMessageShareCount *StatisticalValue `json:"mean_message_share_count"` // Mean number of times reactions were added to the recently sent messages MeanMessageReactionCount *StatisticalValue `json:"mean_message_reaction_count"` - // Mean number of times the recently posted stories were viewed + // Mean number of times the recently sent stories were viewed MeanStoryViewCount *StatisticalValue `json:"mean_story_view_count"` - // Mean number of times the recently posted stories were shared + // Mean number of times the recently sent stories were shared MeanStoryShareCount *StatisticalValue `json:"mean_story_share_count"` - // Mean number of times reactions were added to the recently posted stories + // Mean number of times reactions were added to the recently sent stories MeanStoryReactionCount *StatisticalValue `json:"mean_story_reaction_count"` // A percentage of users with enabled notifications for the chat; 0-100 EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` @@ -60945,7 +52871,7 @@ type ChatStatisticsChannel struct { StoryReactionGraph StatisticalGraph `json:"story_reaction_graph"` // A graph containing number of views of associated with the chat instant views InstantViewInteractionGraph StatisticalGraph `json:"instant_view_interaction_graph"` - // Detailed statistics about number of views and shares of recently sent messages and posted stories + // Detailed statistics about number of views and shares of recently sent messages and stories RecentInteractions []*ChatStatisticsInteractionInfo `json:"recent_interactions"` } @@ -61304,33 +53230,8 @@ func (*RevenueWithdrawalStateFailed) RevenueWithdrawalStateType() string { return TypeRevenueWithdrawalStateFailed } -// Describes an unsupported transaction -type ChatRevenueTransactionTypeUnsupported struct{ - meta -} - -func (entity *ChatRevenueTransactionTypeUnsupported) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatRevenueTransactionTypeUnsupported - - return json.Marshal((*stub)(entity)) -} - -func (*ChatRevenueTransactionTypeUnsupported) GetClass() string { - return ClassChatRevenueTransactionType -} - -func (*ChatRevenueTransactionTypeUnsupported) GetType() string { - return TypeChatRevenueTransactionTypeUnsupported -} - -func (*ChatRevenueTransactionTypeUnsupported) ChatRevenueTransactionTypeType() string { - return TypeChatRevenueTransactionTypeUnsupported -} - // Describes earnings from sponsored messages in a chat in some time frame -type ChatRevenueTransactionTypeSponsoredMessageEarnings struct { +type ChatRevenueTransactionTypeEarnings struct { meta // Point in time (Unix timestamp) when the earnings started StartDate int32 `json:"start_date"` @@ -61338,85 +53239,61 @@ type ChatRevenueTransactionTypeSponsoredMessageEarnings struct { EndDate int32 `json:"end_date"` } -func (entity *ChatRevenueTransactionTypeSponsoredMessageEarnings) MarshalJSON() ([]byte, error) { +func (entity *ChatRevenueTransactionTypeEarnings) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueTransactionTypeSponsoredMessageEarnings + type stub ChatRevenueTransactionTypeEarnings return json.Marshal((*stub)(entity)) } -func (*ChatRevenueTransactionTypeSponsoredMessageEarnings) GetClass() string { +func (*ChatRevenueTransactionTypeEarnings) GetClass() string { return ClassChatRevenueTransactionType } -func (*ChatRevenueTransactionTypeSponsoredMessageEarnings) GetType() string { - return TypeChatRevenueTransactionTypeSponsoredMessageEarnings +func (*ChatRevenueTransactionTypeEarnings) GetType() string { + return TypeChatRevenueTransactionTypeEarnings } -func (*ChatRevenueTransactionTypeSponsoredMessageEarnings) ChatRevenueTransactionTypeType() string { - return TypeChatRevenueTransactionTypeSponsoredMessageEarnings +func (*ChatRevenueTransactionTypeEarnings) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeEarnings } -// Describes earnings from a published suggested post -type ChatRevenueTransactionTypeSuggestedPostEarnings struct { - meta - // Identifier of the user who paid for the suggested post - UserId int64 `json:"user_id"` -} - -func (entity *ChatRevenueTransactionTypeSuggestedPostEarnings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ChatRevenueTransactionTypeSuggestedPostEarnings - - return json.Marshal((*stub)(entity)) -} - -func (*ChatRevenueTransactionTypeSuggestedPostEarnings) GetClass() string { - return ClassChatRevenueTransactionType -} - -func (*ChatRevenueTransactionTypeSuggestedPostEarnings) GetType() string { - return TypeChatRevenueTransactionTypeSuggestedPostEarnings -} - -func (*ChatRevenueTransactionTypeSuggestedPostEarnings) ChatRevenueTransactionTypeType() string { - return TypeChatRevenueTransactionTypeSuggestedPostEarnings -} - -// Describes a withdrawal of earnings through Fragment -type ChatRevenueTransactionTypeFragmentWithdrawal struct { +// Describes a withdrawal of earnings +type ChatRevenueTransactionTypeWithdrawal struct { meta // Point in time (Unix timestamp) when the earnings withdrawal started WithdrawalDate int32 `json:"withdrawal_date"` + // Name of the payment provider + Provider string `json:"provider"` // State of the withdrawal State RevenueWithdrawalState `json:"state"` } -func (entity *ChatRevenueTransactionTypeFragmentWithdrawal) MarshalJSON() ([]byte, error) { +func (entity *ChatRevenueTransactionTypeWithdrawal) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueTransactionTypeFragmentWithdrawal + type stub ChatRevenueTransactionTypeWithdrawal return json.Marshal((*stub)(entity)) } -func (*ChatRevenueTransactionTypeFragmentWithdrawal) GetClass() string { +func (*ChatRevenueTransactionTypeWithdrawal) GetClass() string { return ClassChatRevenueTransactionType } -func (*ChatRevenueTransactionTypeFragmentWithdrawal) GetType() string { - return TypeChatRevenueTransactionTypeFragmentWithdrawal +func (*ChatRevenueTransactionTypeWithdrawal) GetType() string { + return TypeChatRevenueTransactionTypeWithdrawal } -func (*ChatRevenueTransactionTypeFragmentWithdrawal) ChatRevenueTransactionTypeType() string { - return TypeChatRevenueTransactionTypeFragmentWithdrawal +func (*ChatRevenueTransactionTypeWithdrawal) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeWithdrawal } -func (chatRevenueTransactionTypeFragmentWithdrawal *ChatRevenueTransactionTypeFragmentWithdrawal) UnmarshalJSON(data []byte) error { +func (chatRevenueTransactionTypeWithdrawal *ChatRevenueTransactionTypeWithdrawal) UnmarshalJSON(data []byte) error { var tmp struct { WithdrawalDate int32 `json:"withdrawal_date"` + Provider string `json:"provider"` State json.RawMessage `json:"state"` } @@ -61425,39 +53302,42 @@ func (chatRevenueTransactionTypeFragmentWithdrawal *ChatRevenueTransactionTypeFr return err } - chatRevenueTransactionTypeFragmentWithdrawal.WithdrawalDate = tmp.WithdrawalDate + chatRevenueTransactionTypeWithdrawal.WithdrawalDate = tmp.WithdrawalDate + chatRevenueTransactionTypeWithdrawal.Provider = tmp.Provider fieldState, _ := UnmarshalRevenueWithdrawalState(tmp.State) - chatRevenueTransactionTypeFragmentWithdrawal.State = fieldState + chatRevenueTransactionTypeWithdrawal.State = fieldState return nil } -// Describes a refund for failed withdrawal of earnings through Fragment -type ChatRevenueTransactionTypeFragmentRefund struct { +// Describes a refund for failed withdrawal of earnings +type ChatRevenueTransactionTypeRefund struct { meta // Point in time (Unix timestamp) when the transaction was refunded RefundDate int32 `json:"refund_date"` + // Name of the payment provider + Provider string `json:"provider"` } -func (entity *ChatRevenueTransactionTypeFragmentRefund) MarshalJSON() ([]byte, error) { +func (entity *ChatRevenueTransactionTypeRefund) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueTransactionTypeFragmentRefund + type stub ChatRevenueTransactionTypeRefund return json.Marshal((*stub)(entity)) } -func (*ChatRevenueTransactionTypeFragmentRefund) GetClass() string { +func (*ChatRevenueTransactionTypeRefund) GetClass() string { return ClassChatRevenueTransactionType } -func (*ChatRevenueTransactionTypeFragmentRefund) GetType() string { - return TypeChatRevenueTransactionTypeFragmentRefund +func (*ChatRevenueTransactionTypeRefund) GetType() string { + return TypeChatRevenueTransactionTypeRefund } -func (*ChatRevenueTransactionTypeFragmentRefund) ChatRevenueTransactionTypeType() string { - return TypeChatRevenueTransactionTypeFragmentRefund +func (*ChatRevenueTransactionTypeRefund) ChatRevenueTransactionTypeType() string { + return TypeChatRevenueTransactionTypeRefund } // Contains a chat revenue transactions @@ -61511,12 +53391,10 @@ func (chatRevenueTransaction *ChatRevenueTransaction) UnmarshalJSON(data []byte) // Contains a list of chat revenue transactions type ChatRevenueTransactions struct { meta - // The amount of owned Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` + // Total number of transactions + TotalCount int32 `json:"total_count"` // List of transactions Transactions []*ChatRevenueTransaction `json:"transactions"` - // The offset for the next request. If empty, then there are no more results - NextOffset string `json:"next_offset"` } func (entity *ChatRevenueTransactions) MarshalJSON() ([]byte, error) { @@ -61535,14 +53413,14 @@ func (*ChatRevenueTransactions) GetType() string { return TypeChatRevenueTransactions } -// Contains information about Telegram Stars earned by a user or a chat +// Contains information about Telegram Stars earned by a bot or a chat type StarRevenueStatus struct { meta - // Total Telegram Star amount earned + // Total amount of Telegram Stars earned TotalAmount *StarAmount `json:"total_amount"` - // The Telegram Star amount that isn't withdrawn yet + // The amount of Telegram Stars that aren't withdrawn yet CurrentAmount *StarAmount `json:"current_amount"` - // The Telegram Star amount that is available for withdrawal + // The amount of Telegram Stars that are available for withdrawal AvailableAmount *StarAmount `json:"available_amount"` // True, if Telegram Stars can be withdrawn now or later WithdrawalEnabled bool `json:"withdrawal_enabled"` @@ -61566,7 +53444,7 @@ func (*StarRevenueStatus) GetType() string { return TypeStarRevenueStatus } -// A detailed statistics about Telegram Stars earned by a user or a chat +// A detailed statistics about Telegram Stars earned by a bot or a chat type StarRevenueStatistics struct { meta // A graph containing amount of revenue in a given day @@ -61614,83 +53492,6 @@ func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) e return nil } -// Contains information about Toncoins earned by the current user -type TonRevenueStatus struct { - meta - // Total Toncoin amount earned; in the smallest units of the cryptocurrency - TotalAmount JsonInt64 `json:"total_amount"` - // The Toncoin amount that isn't withdrawn yet; in the smallest units of the cryptocurrency - BalanceAmount JsonInt64 `json:"balance_amount"` - // The Toncoin amount that is available for withdrawal; in the smallest units of the cryptocurrency - AvailableAmount JsonInt64 `json:"available_amount"` - // True, if Toncoins can be withdrawn - WithdrawalEnabled bool `json:"withdrawal_enabled"` -} - -func (entity *TonRevenueStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonRevenueStatus - - return json.Marshal((*stub)(entity)) -} - -func (*TonRevenueStatus) GetClass() string { - return ClassTonRevenueStatus -} - -func (*TonRevenueStatus) GetType() string { - return TypeTonRevenueStatus -} - -// A detailed statistics about Toncoins earned by the current user -type TonRevenueStatistics struct { - meta - // A graph containing amount of revenue in a given day - RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` - // Amount of earned revenue - Status *TonRevenueStatus `json:"status"` - // Current conversion rate of nanotoncoin to USD cents - UsdRate float64 `json:"usd_rate"` -} - -func (entity *TonRevenueStatistics) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub TonRevenueStatistics - - return json.Marshal((*stub)(entity)) -} - -func (*TonRevenueStatistics) GetClass() string { - return ClassTonRevenueStatistics -} - -func (*TonRevenueStatistics) GetType() string { - return TypeTonRevenueStatistics -} - -func (tonRevenueStatistics *TonRevenueStatistics) UnmarshalJSON(data []byte) error { - var tmp struct { - RevenueByDayGraph json.RawMessage `json:"revenue_by_day_graph"` - Status *TonRevenueStatus `json:"status"` - UsdRate float64 `json:"usd_rate"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - tonRevenueStatistics.Status = tmp.Status - tonRevenueStatistics.UsdRate = tmp.UsdRate - - fieldRevenueByDayGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueByDayGraph) - tonRevenueStatistics.RevenueByDayGraph = fieldRevenueByDayGraph - - return nil -} - // A point on a Cartesian plane type Point struct { meta @@ -62487,37 +54288,6 @@ func (*UpdateMessageFactCheck) UpdateType() string { return TypeUpdateMessageFactCheck } -// Information about suggested post of a message was changed -type UpdateMessageSuggestedPostInfo struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // The new information about the suggested post - SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info"` -} - -func (entity *UpdateMessageSuggestedPostInfo) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateMessageSuggestedPostInfo - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateMessageSuggestedPostInfo) GetClass() string { - return ClassUpdate -} - -func (*UpdateMessageSuggestedPostInfo) GetType() string { - return TypeUpdateMessageSuggestedPostInfo -} - -func (*UpdateMessageSuggestedPostInfo) UpdateType() string { - return TypeUpdateMessageSuggestedPostInfo -} - // A message with a live location was viewed. When the update is received, the application is expected to update the live location type UpdateMessageLiveLocationViewed struct { meta @@ -62670,8 +54440,6 @@ type UpdateChatAccentColors struct { AccentColorId int32 `json:"accent_color_id"` // The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` - // Color scheme based on an upgraded gift to be used for the chat instead of accent_color_id and background_custom_emoji_id; may be null if none - UpgradedGiftColors *UpgradedGiftColors `json:"upgraded_gift_colors"` // The new chat profile accent color identifier; -1 if none ProfileAccentColorId int32 `json:"profile_accent_color_id"` // The new identifier of a custom emoji to be shown on the profile background; 0 if none @@ -63326,8 +55094,8 @@ type UpdateChatTheme struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new theme of the chat; may be null if theme was reset to default - Theme ChatTheme `json:"theme"` + // The new name of the chat theme; may be empty if theme was reset to default + ThemeName string `json:"theme_name"` } func (entity *UpdateChatTheme) MarshalJSON() ([]byte, error) { @@ -63350,25 +55118,6 @@ func (*UpdateChatTheme) UpdateType() string { return TypeUpdateChatTheme } -func (updateChatTheme *UpdateChatTheme) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - Theme json.RawMessage `json:"theme"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateChatTheme.ChatId = tmp.ChatId - - fieldTheme, _ := UnmarshalChatTheme(tmp.Theme) - updateChatTheme.Theme = fieldTheme - - return nil -} - // The chat unread_mention_count has changed type UpdateChatUnreadMentionCount struct { meta @@ -63792,85 +55541,6 @@ func (*UpdateSavedMessagesTopicCount) UpdateType() string { return TypeUpdateSavedMessagesTopicCount } -// Basic information about a topic in a channel direct messages chat administered by the current user has changed. This update is guaranteed to come before the topic identifier is returned to the application -type UpdateDirectMessagesChatTopic struct { - meta - // New data about the topic - Topic *DirectMessagesChatTopic `json:"topic"` -} - -func (entity *UpdateDirectMessagesChatTopic) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateDirectMessagesChatTopic - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateDirectMessagesChatTopic) GetClass() string { - return ClassUpdate -} - -func (*UpdateDirectMessagesChatTopic) GetType() string { - return TypeUpdateDirectMessagesChatTopic -} - -func (*UpdateDirectMessagesChatTopic) UpdateType() string { - return TypeUpdateDirectMessagesChatTopic -} - -// Number of messages in a topic has changed; for Saved Messages and channel direct messages chat topics only -type UpdateTopicMessageCount struct { - meta - // Identifier of the chat in topic of which the number of messages has changed - ChatId int64 `json:"chat_id"` - // Identifier of the topic - TopicId MessageTopic `json:"topic_id"` - // Approximate number of messages in the topic - MessageCount int32 `json:"message_count"` -} - -func (entity *UpdateTopicMessageCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateTopicMessageCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateTopicMessageCount) GetClass() string { - return ClassUpdate -} - -func (*UpdateTopicMessageCount) GetType() string { - return TypeUpdateTopicMessageCount -} - -func (*UpdateTopicMessageCount) UpdateType() string { - return TypeUpdateTopicMessageCount -} - -func (updateTopicMessageCount *UpdateTopicMessageCount) UnmarshalJSON(data []byte) error { - var tmp struct { - ChatId int64 `json:"chat_id"` - TopicId json.RawMessage `json:"topic_id"` - MessageCount int32 `json:"message_count"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateTopicMessageCount.ChatId = tmp.ChatId - updateTopicMessageCount.MessageCount = tmp.MessageCount - - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - updateTopicMessageCount.TopicId = fieldTopicId - - return nil -} - // Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application type UpdateQuickReplyShortcut struct { meta @@ -64013,22 +55683,14 @@ type UpdateForumTopic struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // Forum topic identifier of the topic - ForumTopicId int32 `json:"forum_topic_id"` + // Message thread identifier of the topic + MessageThreadId int64 `json:"message_thread_id"` // True, if the topic is pinned in the topic list IsPinned bool `json:"is_pinned"` - // Identifier of the last read incoming message - LastReadInboxMessageId int64 `json:"last_read_inbox_message_id"` // Identifier of the last read outgoing message LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` - // Number of unread messages with a mention/reply in the topic - UnreadMentionCount int32 `json:"unread_mention_count"` - // Number of messages with unread reactions in the topic - 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) { @@ -64321,8 +55983,8 @@ type UpdateChatAction struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // Identifier of the specific topic in which the action was performed; may be null if none - TopicId MessageTopic `json:"topic_id"` + // If not 0, the message thread identifier in which the action was performed + MessageThreadId int64 `json:"message_thread_id"` // Identifier of a message sender performing the action SenderId MessageSender `json:"sender_id"` // The action @@ -64352,7 +56014,7 @@ func (*UpdateChatAction) UpdateType() string { func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { var tmp struct { ChatId int64 `json:"chat_id"` - TopicId json.RawMessage `json:"topic_id"` + MessageThreadId int64 `json:"message_thread_id"` SenderId json.RawMessage `json:"sender_id"` Action json.RawMessage `json:"action"` } @@ -64363,9 +56025,7 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { } updateChatAction.ChatId = tmp.ChatId - - fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) - updateChatAction.TopicId = fieldTopicId + updateChatAction.MessageThreadId = tmp.MessageThreadId fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) updateChatAction.SenderId = fieldSenderId @@ -64376,39 +56036,6 @@ func (updateChatAction *UpdateChatAction) UnmarshalJSON(data []byte) error { return nil } -// A new pending text message was received in a chat with a bot. The message must be shown in the chat for at most getOption("pending_text_message_period") seconds, replace any other pending message with the same draft_id, and be deleted whenever any incoming message from the bot in the message thread is received -type UpdatePendingTextMessage struct { - meta - // Chat identifier - ChatId int64 `json:"chat_id"` - // The forum topic identifier in which the message will be sent; 0 if none - ForumTopicId int32 `json:"forum_topic_id"` - // Unique identifier of the message draft within the message thread - DraftId JsonInt64 `json:"draft_id"` - // Text of the pending message - Text *FormattedText `json:"text"` -} - -func (entity *UpdatePendingTextMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdatePendingTextMessage - - return json.Marshal((*stub)(entity)) -} - -func (*UpdatePendingTextMessage) GetClass() string { - return ClassUpdate -} - -func (*UpdatePendingTextMessage) GetType() string { - return TypeUpdatePendingTextMessage -} - -func (*UpdatePendingTextMessage) UpdateType() string { - return TypeUpdatePendingTextMessage -} - // The user went online or offline type UpdateUserStatus struct { meta @@ -65001,7 +56628,7 @@ func (*UpdateCall) UpdateType() string { // Information about a group call was updated type UpdateGroupCall struct { meta - // New data about the group call + // New data about a group call GroupCall *GroupCall `json:"group_call"` } @@ -65028,9 +56655,9 @@ func (*UpdateGroupCall) UpdateType() string { // Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined type UpdateGroupCallParticipant struct { meta - // Identifier of the group call + // Identifier of group call GroupCallId int32 `json:"group_call_id"` - // New data about the participant + // New data about a participant Participant *GroupCallParticipant `json:"participant"` } @@ -65054,236 +56681,6 @@ func (*UpdateGroupCallParticipant) UpdateType() string { return TypeUpdateGroupCallParticipant } -// The list of group call participants that can send and receive encrypted call data has changed; for group calls not bound to a chat only -type UpdateGroupCallParticipants struct { - meta - // Identifier of the group call - GroupCallId int32 `json:"group_call_id"` - // New list of group call participant user identifiers. The identifiers may be invalid or the corresponding users may be unknown. The participants must be shown in the list of group call participants even if there is no information about them - ParticipantUserIds []JsonInt64 `json:"participant_user_ids"` -} - -func (entity *UpdateGroupCallParticipants) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateGroupCallParticipants - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateGroupCallParticipants) GetClass() string { - return ClassUpdate -} - -func (*UpdateGroupCallParticipants) GetType() string { - return TypeUpdateGroupCallParticipants -} - -func (*UpdateGroupCallParticipants) UpdateType() string { - return TypeUpdateGroupCallParticipants -} - -// The verification state of an encrypted group call has changed; for group calls not bound to a chat only -type UpdateGroupCallVerificationState struct { - meta - // Identifier of the group call - GroupCallId int32 `json:"group_call_id"` - // The call state generation to which the emoji corresponds. If generation is different for two users, then their emoji may be also different - Generation int32 `json:"generation"` - // Group call state fingerprint represented as 4 emoji; may be empty if the state isn't verified yet - Emojis []string `json:"emojis"` -} - -func (entity *UpdateGroupCallVerificationState) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateGroupCallVerificationState - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateGroupCallVerificationState) GetClass() string { - return ClassUpdate -} - -func (*UpdateGroupCallVerificationState) GetType() string { - return TypeUpdateGroupCallVerificationState -} - -func (*UpdateGroupCallVerificationState) UpdateType() string { - return TypeUpdateGroupCallVerificationState -} - -// A new message was received in a group call -type UpdateNewGroupCallMessage struct { - meta - // Identifier of the group call - GroupCallId int32 `json:"group_call_id"` - // The message - Message *GroupCallMessage `json:"message"` -} - -func (entity *UpdateNewGroupCallMessage) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateNewGroupCallMessage - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateNewGroupCallMessage) GetClass() string { - return ClassUpdate -} - -func (*UpdateNewGroupCallMessage) GetType() string { - return TypeUpdateNewGroupCallMessage -} - -func (*UpdateNewGroupCallMessage) UpdateType() string { - return TypeUpdateNewGroupCallMessage -} - -// 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"` - StarCount int64 `json:"star_count"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - updateNewGroupCallPaidReaction.GroupCallId = tmp.GroupCallId - updateNewGroupCallPaidReaction.StarCount = tmp.StarCount - - fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId) - 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 @@ -65313,60 +56710,6 @@ 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 @@ -65562,7 +56905,7 @@ func (*UpdateStory) UpdateType() string { type UpdateStoryDeleted struct { meta // Identifier of the chat that posted the story - StoryPosterChatId int64 `json:"story_poster_chat_id"` + StorySenderChatId int64 `json:"story_sender_chat_id"` // Story identifier StoryId int32 `json:"story_id"` } @@ -65587,67 +56930,67 @@ func (*UpdateStoryDeleted) UpdateType() string { return TypeUpdateStoryDeleted } -// A story has been successfully posted -type UpdateStoryPostSucceeded struct { +// A story has been successfully sent +type UpdateStorySendSucceeded struct { meta - // The posted story + // The sent story Story *Story `json:"story"` // The previous temporary story identifier OldStoryId int32 `json:"old_story_id"` } -func (entity *UpdateStoryPostSucceeded) MarshalJSON() ([]byte, error) { +func (entity *UpdateStorySendSucceeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateStoryPostSucceeded + type stub UpdateStorySendSucceeded return json.Marshal((*stub)(entity)) } -func (*UpdateStoryPostSucceeded) GetClass() string { +func (*UpdateStorySendSucceeded) GetClass() string { return ClassUpdate } -func (*UpdateStoryPostSucceeded) GetType() string { - return TypeUpdateStoryPostSucceeded +func (*UpdateStorySendSucceeded) GetType() string { + return TypeUpdateStorySendSucceeded } -func (*UpdateStoryPostSucceeded) UpdateType() string { - return TypeUpdateStoryPostSucceeded +func (*UpdateStorySendSucceeded) UpdateType() string { + return TypeUpdateStorySendSucceeded } -// A story failed to post. If the story posting is canceled, then updateStoryDeleted will be received instead of this update -type UpdateStoryPostFailed struct { +// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update +type UpdateStorySendFailed struct { meta - // The failed to post story + // The failed to send story Story *Story `json:"story"` - // The cause of the story posting failure + // The cause of the story sending failure Error *Error `json:"error"` // Type of the error; may be null if unknown - ErrorType CanPostStoryResult `json:"error_type"` + ErrorType CanSendStoryResult `json:"error_type"` } -func (entity *UpdateStoryPostFailed) MarshalJSON() ([]byte, error) { +func (entity *UpdateStorySendFailed) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateStoryPostFailed + type stub UpdateStorySendFailed return json.Marshal((*stub)(entity)) } -func (*UpdateStoryPostFailed) GetClass() string { +func (*UpdateStorySendFailed) GetClass() string { return ClassUpdate } -func (*UpdateStoryPostFailed) GetType() string { - return TypeUpdateStoryPostFailed +func (*UpdateStorySendFailed) GetType() string { + return TypeUpdateStorySendFailed } -func (*UpdateStoryPostFailed) UpdateType() string { - return TypeUpdateStoryPostFailed +func (*UpdateStorySendFailed) UpdateType() string { + return TypeUpdateStorySendFailed } -func (updateStoryPostFailed *UpdateStoryPostFailed) UnmarshalJSON(data []byte) error { +func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) error { var tmp struct { Story *Story `json:"story"` Error *Error `json:"error"` @@ -65659,11 +57002,11 @@ func (updateStoryPostFailed *UpdateStoryPostFailed) UnmarshalJSON(data []byte) e return err } - updateStoryPostFailed.Story = tmp.Story - updateStoryPostFailed.Error = tmp.Error + updateStorySendFailed.Story = tmp.Story + updateStorySendFailed.Error = tmp.Error - fieldErrorType, _ := UnmarshalCanPostStoryResult(tmp.ErrorType) - updateStoryPostFailed.ErrorType = fieldErrorType + fieldErrorType, _ := UnmarshalCanSendStoryResult(tmp.ErrorType) + updateStorySendFailed.ErrorType = fieldErrorType return nil } @@ -65772,33 +57115,6 @@ 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 @@ -66109,31 +57425,31 @@ func (*UpdateDefaultBackground) UpdateType() string { return TypeUpdateDefaultBackground } -// The list of available emoji chat themes has changed -type UpdateEmojiChatThemes struct { +// The list of available chat themes has changed +type UpdateChatThemes struct { meta - // The new list of emoji chat themes - ChatThemes []*EmojiChatTheme `json:"chat_themes"` + // The new list of chat themes + ChatThemes []*ChatTheme `json:"chat_themes"` } -func (entity *UpdateEmojiChatThemes) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatThemes) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateEmojiChatThemes + type stub UpdateChatThemes return json.Marshal((*stub)(entity)) } -func (*UpdateEmojiChatThemes) GetClass() string { +func (*UpdateChatThemes) GetClass() string { return ClassUpdate } -func (*UpdateEmojiChatThemes) GetType() string { - return TypeUpdateEmojiChatThemes +func (*UpdateChatThemes) GetType() string { + return TypeUpdateChatThemes } -func (*UpdateEmojiChatThemes) UpdateType() string { - return TypeUpdateEmojiChatThemes +func (*UpdateChatThemes) UpdateType() string { + return TypeUpdateChatThemes } // The list of supported accent colors has changed @@ -66301,33 +57617,6 @@ func (*UpdateFreezeState) UpdateType() string { return TypeUpdateFreezeState } -// The parameters for age verification of the current user's account has changed -type UpdateAgeVerificationParameters struct { - meta - // Parameters for the age verification; may be null if age verification isn't needed - Parameters *AgeVerificationParameters `json:"parameters"` -} - -func (entity *UpdateAgeVerificationParameters) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateAgeVerificationParameters - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateAgeVerificationParameters) GetClass() string { - return ClassUpdate -} - -func (*UpdateAgeVerificationParameters) GetType() string { - return TypeUpdateAgeVerificationParameters -} - -func (*UpdateAgeVerificationParameters) UpdateType() string { - return TypeUpdateAgeVerificationParameters -} - // New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update" type UpdateTermsOfService struct { meta @@ -66663,33 +57952,6 @@ func (*UpdateOwnedStarCount) UpdateType() string { return TypeUpdateOwnedStarCount } -// The number of Toncoins owned by the current user has changed -type UpdateOwnedTonCount struct { - meta - // The new amount of owned Toncoins; in the smallest units of the cryptocurrency - TonAmount int64 `json:"ton_amount"` -} - -func (entity *UpdateOwnedTonCount) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateOwnedTonCount - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateOwnedTonCount) GetClass() string { - return ClassUpdate -} - -func (*UpdateOwnedTonCount) GetType() string { - return TypeUpdateOwnedTonCount -} - -func (*UpdateOwnedTonCount) UpdateType() string { - return TypeUpdateOwnedTonCount -} - // The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions type UpdateChatRevenueAmount struct { meta @@ -66719,7 +57981,7 @@ func (*UpdateChatRevenueAmount) UpdateType() string { return TypeUpdateChatRevenueAmount } -// The Telegram Star revenue earned by a user or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +// The Telegram Star revenue earned by a bot or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions type UpdateStarRevenueStatus struct { meta // Identifier of the owner of the Telegram Stars @@ -66767,33 +58029,6 @@ func (updateStarRevenueStatus *UpdateStarRevenueStatus) UnmarshalJSON(data []byt return nil } -// The Toncoin revenue earned by the current user has changed. If Toncoin transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions -type UpdateTonRevenueStatus struct { - meta - // New Toncoin revenue status - Status *TonRevenueStatus `json:"status"` -} - -func (entity *UpdateTonRevenueStatus) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub UpdateTonRevenueStatus - - return json.Marshal((*stub)(entity)) -} - -func (*UpdateTonRevenueStatus) GetClass() string { - return ClassUpdate -} - -func (*UpdateTonRevenueStatus) GetType() string { - return TypeUpdateTonRevenueStatus -} - -func (*UpdateTonRevenueStatus) UpdateType() string { - return TypeUpdateTonRevenueStatus -} - // The parameters of speech recognition without Telegram Premium subscription has changed type UpdateSpeechRecognitionTrial struct { meta @@ -66827,33 +58062,6 @@ 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 @@ -66881,33 +58089,6 @@ 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 5319fa2..31bc0c7 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -511,58 +511,6 @@ func UnmarshalListOfPollType(dataList []json.RawMessage) ([]PollType, error) { return list, nil } -func UnmarshalProfileTab(data json.RawMessage) (ProfileTab, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeProfileTabPosts: - return UnmarshalProfileTabPosts(data) - - case TypeProfileTabGifts: - return UnmarshalProfileTabGifts(data) - - case TypeProfileTabMedia: - return UnmarshalProfileTabMedia(data) - - case TypeProfileTabFiles: - return UnmarshalProfileTabFiles(data) - - case TypeProfileTabLinks: - return UnmarshalProfileTabLinks(data) - - case TypeProfileTabMusic: - return UnmarshalProfileTabMusic(data) - - case TypeProfileTabVoice: - return UnmarshalProfileTabVoice(data) - - case TypeProfileTabGifs: - return UnmarshalProfileTabGifs(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfProfileTab(dataList []json.RawMessage) ([]ProfileTab, error) { - list := []ProfileTab{} - - for _, data := range dataList { - entity, err := UnmarshalProfileTab(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalUserType(data json.RawMessage) (UserType, error) { var meta meta @@ -714,182 +662,6 @@ func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto return list, nil } -func UnmarshalGiftResalePrice(data json.RawMessage) (GiftResalePrice, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeGiftResalePriceStar: - return UnmarshalGiftResalePriceStar(data) - - case TypeGiftResalePriceTon: - return UnmarshalGiftResalePriceTon(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfGiftResalePrice(dataList []json.RawMessage) ([]GiftResalePrice, error) { - list := []GiftResalePrice{} - - for _, data := range dataList { - entity, err := UnmarshalGiftResalePrice(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - 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 - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeSuggestedPostPriceStar: - return UnmarshalSuggestedPostPriceStar(data) - - case TypeSuggestedPostPriceTon: - return UnmarshalSuggestedPostPriceTon(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfSuggestedPostPrice(dataList []json.RawMessage) ([]SuggestedPostPrice, error) { - list := []SuggestedPostPrice{} - - for _, data := range dataList { - entity, err := UnmarshalSuggestedPostPrice(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalSuggestedPostState(data json.RawMessage) (SuggestedPostState, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeSuggestedPostStatePending: - return UnmarshalSuggestedPostStatePending(data) - - case TypeSuggestedPostStateApproved: - return UnmarshalSuggestedPostStateApproved(data) - - case TypeSuggestedPostStateDeclined: - return UnmarshalSuggestedPostStateDeclined(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfSuggestedPostState(dataList []json.RawMessage) ([]SuggestedPostState, error) { - list := []SuggestedPostState{} - - for _, data := range dataList { - entity, err := UnmarshalSuggestedPostState(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalSuggestedPostRefundReason(data json.RawMessage) (SuggestedPostRefundReason, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeSuggestedPostRefundReasonPostDeleted: - return UnmarshalSuggestedPostRefundReasonPostDeleted(data) - - case TypeSuggestedPostRefundReasonPaymentRefunded: - return UnmarshalSuggestedPostRefundReasonPaymentRefunded(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfSuggestedPostRefundReason(dataList []json.RawMessage) ([]SuggestedPostRefundReason, error) { - list := []SuggestedPostRefundReason{} - - for _, data := range dataList { - entity, err := UnmarshalSuggestedPostRefundReason(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalStarSubscriptionType(data json.RawMessage) (StarSubscriptionType, error) { var meta meta @@ -998,280 +770,6 @@ func UnmarshalListOfAffiliateProgramSortOrder(dataList []json.RawMessage) ([]Aff return list, nil } -func UnmarshalCanSendGiftResult(data json.RawMessage) (CanSendGiftResult, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeCanSendGiftResultOk: - return UnmarshalCanSendGiftResultOk(data) - - case TypeCanSendGiftResultFail: - return UnmarshalCanSendGiftResultFail(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfCanSendGiftResult(dataList []json.RawMessage) ([]CanSendGiftResult, error) { - list := []CanSendGiftResult{} - - for _, data := range dataList { - entity, err := UnmarshalCanSendGiftResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalUpgradedGiftOrigin(data json.RawMessage) (UpgradedGiftOrigin, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeUpgradedGiftOriginUpgrade: - return UnmarshalUpgradedGiftOriginUpgrade(data) - - case TypeUpgradedGiftOriginTransfer: - return UnmarshalUpgradedGiftOriginTransfer(data) - - case TypeUpgradedGiftOriginResale: - return UnmarshalUpgradedGiftOriginResale(data) - - case TypeUpgradedGiftOriginBlockchain: - return UnmarshalUpgradedGiftOriginBlockchain(data) - - case TypeUpgradedGiftOriginPrepaidUpgrade: - return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) - - case TypeUpgradedGiftOriginOffer: - return UnmarshalUpgradedGiftOriginOffer(data) - - case TypeUpgradedGiftOriginCraft: - return UnmarshalUpgradedGiftOriginCraft(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfUpgradedGiftOrigin(dataList []json.RawMessage) ([]UpgradedGiftOrigin, error) { - list := []UpgradedGiftOrigin{} - - for _, data := range dataList { - entity, err := UnmarshalUpgradedGiftOrigin(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalUpgradedGiftAttributeRarity(data json.RawMessage) (UpgradedGiftAttributeRarity, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeUpgradedGiftAttributeRarityPerMille: - return UnmarshalUpgradedGiftAttributeRarityPerMille(data) - - case TypeUpgradedGiftAttributeRarityUncommon: - return UnmarshalUpgradedGiftAttributeRarityUncommon(data) - - case TypeUpgradedGiftAttributeRarityRare: - return UnmarshalUpgradedGiftAttributeRarityRare(data) - - case TypeUpgradedGiftAttributeRarityEpic: - return UnmarshalUpgradedGiftAttributeRarityEpic(data) - - case TypeUpgradedGiftAttributeRarityLegendary: - return UnmarshalUpgradedGiftAttributeRarityLegendary(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfUpgradedGiftAttributeRarity(dataList []json.RawMessage) ([]UpgradedGiftAttributeRarity, error) { - list := []UpgradedGiftAttributeRarity{} - - for _, data := range dataList { - entity, err := UnmarshalUpgradedGiftAttributeRarity(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalCraftGiftResult(data json.RawMessage) (CraftGiftResult, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeCraftGiftResultSuccess: - return UnmarshalCraftGiftResultSuccess(data) - - case TypeCraftGiftResultTooEarly: - return UnmarshalCraftGiftResultTooEarly(data) - - case TypeCraftGiftResultInvalidGift: - return UnmarshalCraftGiftResultInvalidGift(data) - - case TypeCraftGiftResultFail: - return UnmarshalCraftGiftResultFail(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfCraftGiftResult(dataList []json.RawMessage) ([]CraftGiftResult, error) { - list := []CraftGiftResult{} - - for _, data := range dataList { - entity, err := UnmarshalCraftGiftResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalUpgradedGiftAttributeId(data json.RawMessage) (UpgradedGiftAttributeId, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeUpgradedGiftAttributeIdModel: - return UnmarshalUpgradedGiftAttributeIdModel(data) - - case TypeUpgradedGiftAttributeIdSymbol: - return UnmarshalUpgradedGiftAttributeIdSymbol(data) - - case TypeUpgradedGiftAttributeIdBackdrop: - return UnmarshalUpgradedGiftAttributeIdBackdrop(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfUpgradedGiftAttributeId(dataList []json.RawMessage) ([]UpgradedGiftAttributeId, error) { - list := []UpgradedGiftAttributeId{} - - for _, data := range dataList { - entity, err := UnmarshalUpgradedGiftAttributeId(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalGiftForResaleOrder(data json.RawMessage) (GiftForResaleOrder, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeGiftForResaleOrderPrice: - return UnmarshalGiftForResaleOrderPrice(data) - - case TypeGiftForResaleOrderPriceChangeDate: - return UnmarshalGiftForResaleOrderPriceChangeDate(data) - - case TypeGiftForResaleOrderNumber: - return UnmarshalGiftForResaleOrderNumber(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfGiftForResaleOrder(dataList []json.RawMessage) ([]GiftForResaleOrder, error) { - list := []GiftForResaleOrder{} - - for _, data := range dataList { - entity, err := UnmarshalGiftForResaleOrder(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalGiftResaleResult(data json.RawMessage) (GiftResaleResult, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeGiftResaleResultOk: - return UnmarshalGiftResaleResultOk(data) - - case TypeGiftResaleResultPriceIncreased: - return UnmarshalGiftResaleResultPriceIncreased(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfGiftResaleResult(dataList []json.RawMessage) ([]GiftResaleResult, error) { - list := []GiftResaleResult{} - - for _, data := range dataList { - entity, err := UnmarshalGiftResaleResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalSentGift(data json.RawMessage) (SentGift, error) { var meta meta @@ -1306,7 +804,7 @@ func UnmarshalListOfSentGift(dataList []json.RawMessage) ([]SentGift, error) { return list, nil } -func UnmarshalAuctionState(data json.RawMessage) (AuctionState, error) { +func UnmarshalStarTransactionDirection(data json.RawMessage) (StarTransactionDirection, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -1315,56 +813,22 @@ func UnmarshalAuctionState(data json.RawMessage) (AuctionState, error) { } switch meta.Type { - case TypeAuctionStateActive: - return UnmarshalAuctionStateActive(data) + case TypeStarTransactionDirectionIncoming: + return UnmarshalStarTransactionDirectionIncoming(data) - case TypeAuctionStateFinished: - return UnmarshalAuctionStateFinished(data) + case TypeStarTransactionDirectionOutgoing: + return UnmarshalStarTransactionDirectionOutgoing(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfAuctionState(dataList []json.RawMessage) ([]AuctionState, error) { - list := []AuctionState{} +func UnmarshalListOfStarTransactionDirection(dataList []json.RawMessage) ([]StarTransactionDirection, error) { + list := []StarTransactionDirection{} 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 - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeTransactionDirectionIncoming: - return UnmarshalTransactionDirectionIncoming(data) - - case TypeTransactionDirectionOutgoing: - return UnmarshalTransactionDirectionOutgoing(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfTransactionDirection(dataList []json.RawMessage) ([]TransactionDirection, error) { - list := []TransactionDirection{} - - for _, data := range dataList { - entity, err := UnmarshalTransactionDirection(data) + entity, err := UnmarshalStarTransactionDirection(data) if err != nil { return nil, err } @@ -1440,36 +904,18 @@ 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) - case TypeStarTransactionTypeGiftOriginalDetailsDrop: - return UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data) - case TypeStarTransactionTypeGiftSale: return UnmarshalStarTransactionTypeGiftSale(data) case TypeStarTransactionTypeGiftUpgrade: return UnmarshalStarTransactionTypeGiftUpgrade(data) - case TypeStarTransactionTypeGiftUpgradePurchase: - return UnmarshalStarTransactionTypeGiftUpgradePurchase(data) - - case TypeStarTransactionTypeUpgradedGiftPurchase: - return UnmarshalStarTransactionTypeUpgradedGiftPurchase(data) - - case TypeStarTransactionTypeUpgradedGiftSale: - return UnmarshalStarTransactionTypeUpgradedGiftSale(data) - case TypeStarTransactionTypeChannelPaidReactionSend: return UnmarshalStarTransactionTypeChannelPaidReactionSend(data) @@ -1485,24 +931,6 @@ 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) - - case TypeStarTransactionTypeSuggestedPostPaymentReceive: - return UnmarshalStarTransactionTypeSuggestedPostPaymentReceive(data) - case TypeStarTransactionTypePremiumPurchase: return UnmarshalStarTransactionTypePremiumPurchase(data) @@ -1512,9 +940,6 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er case TypeStarTransactionTypeBusinessBotTransferReceive: return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data) - case TypeStarTransactionTypePublicPostSearch: - return UnmarshalStarTransactionTypePublicPostSearch(data) - case TypeStarTransactionTypeUnsupported: return UnmarshalStarTransactionTypeUnsupported(data) @@ -1537,98 +962,6 @@ func UnmarshalListOfStarTransactionType(dataList []json.RawMessage) ([]StarTrans return list, nil } -func UnmarshalTonTransactionType(data json.RawMessage) (TonTransactionType, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - 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) - - case TypeTonTransactionTypeUpgradedGiftSale: - return UnmarshalTonTransactionTypeUpgradedGiftSale(data) - - case TypeTonTransactionTypeStakeDiceStake: - return UnmarshalTonTransactionTypeStakeDiceStake(data) - - case TypeTonTransactionTypeStakeDicePayout: - return UnmarshalTonTransactionTypeStakeDicePayout(data) - - case TypeTonTransactionTypeUnsupported: - return UnmarshalTonTransactionTypeUnsupported(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfTonTransactionType(dataList []json.RawMessage) ([]TonTransactionType, error) { - list := []TonTransactionType{} - - for _, data := range dataList { - entity, err := UnmarshalTonTransactionType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - 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 @@ -2186,46 +1519,6 @@ func UnmarshalListOfPaidReactionType(dataList []json.RawMessage) ([]PaidReaction return list, nil } -func UnmarshalMessageTopic(data json.RawMessage) (MessageTopic, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeMessageTopicThread: - return UnmarshalMessageTopicThread(data) - - case TypeMessageTopicForum: - return UnmarshalMessageTopicForum(data) - - case TypeMessageTopicDirectMessages: - return UnmarshalMessageTopicDirectMessages(data) - - case TypeMessageTopicSavedMessages: - return UnmarshalMessageTopicSavedMessages(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfMessageTopic(dataList []json.RawMessage) ([]MessageTopic, error) { - list := []MessageTopic{} - - for _, data := range dataList { - entity, err := UnmarshalMessageTopic(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalMessageEffectType(data json.RawMessage) (MessageEffectType, error) { var meta meta @@ -2383,9 +1676,6 @@ func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { case TypeMessageSourceForumTopicHistory: return UnmarshalMessageSourceForumTopicHistory(data) - case TypeMessageSourceDirectMessagesChatTopicHistory: - return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data) - case TypeMessageSourceHistoryPreview: return UnmarshalMessageSourceHistoryPreview(data) @@ -2768,46 +2058,6 @@ func UnmarshalListOfChatActionBar(dataList []json.RawMessage) ([]ChatActionBar, return list, nil } -func UnmarshalButtonStyle(data json.RawMessage) (ButtonStyle, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeButtonStyleDefault: - return UnmarshalButtonStyleDefault(data) - - case TypeButtonStylePrimary: - return UnmarshalButtonStylePrimary(data) - - case TypeButtonStyleDanger: - return UnmarshalButtonStyleDanger(data) - - case TypeButtonStyleSuccess: - return UnmarshalButtonStyleSuccess(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfButtonStyle(dataList []json.RawMessage) ([]ButtonStyle, error) { - list := []ButtonStyle{} - - for _, data := range dataList { - entity, err := UnmarshalButtonStyle(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, error) { var meta meta @@ -3063,49 +2313,6 @@ func UnmarshalListOfSavedMessagesTopicType(dataList []json.RawMessage) ([]SavedM return list, nil } -func UnmarshalBuiltInTheme(data json.RawMessage) (BuiltInTheme, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeBuiltInThemeClassic: - return UnmarshalBuiltInThemeClassic(data) - - case TypeBuiltInThemeDay: - return UnmarshalBuiltInThemeDay(data) - - case TypeBuiltInThemeNight: - return UnmarshalBuiltInThemeNight(data) - - case TypeBuiltInThemeTinted: - return UnmarshalBuiltInThemeTinted(data) - - case TypeBuiltInThemeArctic: - return UnmarshalBuiltInThemeArctic(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfBuiltInTheme(dataList []json.RawMessage) ([]BuiltInTheme, error) { - list := []BuiltInTheme{} - - for _, data := range dataList { - entity, err := UnmarshalBuiltInTheme(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalRichText(data json.RawMessage) (RichText, error) { var meta meta @@ -3441,9 +2648,6 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeChat: return UnmarshalLinkPreviewTypeChat(data) - case TypeLinkPreviewTypeDirectMessagesChat: - return UnmarshalLinkPreviewTypeDirectMessagesChat(data) - case TypeLinkPreviewTypeDocument: return UnmarshalLinkPreviewTypeDocument(data) @@ -3462,21 +2666,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) - case TypeLinkPreviewTypeGiftAuction: - return UnmarshalLinkPreviewTypeGiftAuction(data) - - case TypeLinkPreviewTypeGiftCollection: - return UnmarshalLinkPreviewTypeGiftCollection(data) - - case TypeLinkPreviewTypeGroupCall: - return UnmarshalLinkPreviewTypeGroupCall(data) - case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) - case TypeLinkPreviewTypeLiveStory: - return UnmarshalLinkPreviewTypeLiveStory(data) - case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -3498,9 +2690,6 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypeStory: return UnmarshalLinkPreviewTypeStory(data) - case TypeLinkPreviewTypeStoryAlbum: - return UnmarshalLinkPreviewTypeStoryAlbum(data) - case TypeLinkPreviewTypeSupergroupBoost: return UnmarshalLinkPreviewTypeSupergroupBoost(data) @@ -4192,24 +3381,15 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) - case TypeMessageStakeDice: - return UnmarshalMessageStakeDice(data) - case TypeMessageStory: return UnmarshalMessageStory(data) - case TypeMessageChecklist: - return UnmarshalMessageChecklist(data) - case TypeMessageInvoice: return UnmarshalMessageInvoice(data) case TypeMessageCall: return UnmarshalMessageCall(data) - case TypeMessageGroupCall: - return UnmarshalMessageGroupCall(data) - case TypeMessageVideoChatScheduled: return UnmarshalMessageVideoChatScheduled(data) @@ -4237,12 +3417,6 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) - case TypeMessageChatOwnerLeft: - return UnmarshalMessageChatOwnerLeft(data) - - case TypeMessageChatOwnerChanged: - return UnmarshalMessageChatOwnerChanged(data) - case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -4294,9 +3468,6 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageSuggestProfilePhoto: return UnmarshalMessageSuggestProfilePhoto(data) - case TypeMessageSuggestBirthdate: - return UnmarshalMessageSuggestBirthdate(data) - case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -4333,9 +3504,6 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageGiftedStars: return UnmarshalMessageGiftedStars(data) - case TypeMessageGiftedTon: - return UnmarshalMessageGiftedTon(data) - case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) @@ -4348,42 +3516,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) case TypeMessagePaidMessagePriceChanged: return UnmarshalMessagePaidMessagePriceChanged(data) - case TypeMessageDirectMessagePriceChanged: - return UnmarshalMessageDirectMessagePriceChanged(data) - - case TypeMessageChecklistTasksDone: - return UnmarshalMessageChecklistTasksDone(data) - - case TypeMessageChecklistTasksAdded: - return UnmarshalMessageChecklistTasksAdded(data) - - case TypeMessageSuggestedPostApprovalFailed: - return UnmarshalMessageSuggestedPostApprovalFailed(data) - - case TypeMessageSuggestedPostApproved: - return UnmarshalMessageSuggestedPostApproved(data) - - case TypeMessageSuggestedPostDeclined: - return UnmarshalMessageSuggestedPostDeclined(data) - - case TypeMessageSuggestedPostPaid: - return UnmarshalMessageSuggestedPostPaid(data) - - case TypeMessageSuggestedPostRefunded: - return UnmarshalMessageSuggestedPostRefunded(data) - case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -4692,15 +3830,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) - case TypeInputMessageStakeDice: - return UnmarshalInputMessageStakeDice(data) - case TypeInputMessageStory: return UnmarshalInputMessageStory(data) - case TypeInputMessageChecklist: - return UnmarshalInputMessageChecklist(data) - case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -5133,46 +4265,6 @@ func UnmarshalListOfInputStoryAreaType(dataList []json.RawMessage) ([]InputStory return list, nil } -func UnmarshalStoryContentType(data json.RawMessage) (StoryContentType, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeStoryContentTypePhoto: - return UnmarshalStoryContentTypePhoto(data) - - case TypeStoryContentTypeVideo: - return UnmarshalStoryContentTypeVideo(data) - - case TypeStoryContentTypeLive: - return UnmarshalStoryContentTypeLive(data) - - case TypeStoryContentTypeUnsupported: - return UnmarshalStoryContentTypeUnsupported(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfStoryContentType(dataList []json.RawMessage) ([]StoryContentType, error) { - list := []StoryContentType{} - - for _, data := range dataList { - entity, err := UnmarshalStoryContentType(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { var meta meta @@ -5188,9 +4280,6 @@ func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) - case TypeStoryContentLive: - return UnmarshalStoryContentLive(data) - case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -5481,8 +4570,8 @@ func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) case TypeCallDiscardReasonHungUp: return UnmarshalCallDiscardReasonHungUp(data) - case TypeCallDiscardReasonUpgradeToGroupCall: - return UnmarshalCallDiscardReasonUpgradeToGroupCall(data) + case TypeCallDiscardReasonAllowGroupCall: + return UnmarshalCallDiscardReasonAllowGroupCall(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -5620,114 +4709,6 @@ func UnmarshalListOfGroupCallVideoQuality(dataList []json.RawMessage) ([]GroupCa return list, nil } -func UnmarshalInviteGroupCallParticipantResult(data json.RawMessage) (InviteGroupCallParticipantResult, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInviteGroupCallParticipantResultUserPrivacyRestricted: - return UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data) - - case TypeInviteGroupCallParticipantResultUserAlreadyParticipant: - return UnmarshalInviteGroupCallParticipantResultUserAlreadyParticipant(data) - - case TypeInviteGroupCallParticipantResultUserWasBanned: - return UnmarshalInviteGroupCallParticipantResultUserWasBanned(data) - - case TypeInviteGroupCallParticipantResultSuccess: - return UnmarshalInviteGroupCallParticipantResultSuccess(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInviteGroupCallParticipantResult(dataList []json.RawMessage) ([]InviteGroupCallParticipantResult, error) { - list := []InviteGroupCallParticipantResult{} - - for _, data := range dataList { - entity, err := UnmarshalInviteGroupCallParticipantResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalGroupCallDataChannel(data json.RawMessage) (GroupCallDataChannel, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeGroupCallDataChannelMain: - return UnmarshalGroupCallDataChannelMain(data) - - case TypeGroupCallDataChannelScreenSharing: - return UnmarshalGroupCallDataChannelScreenSharing(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfGroupCallDataChannel(dataList []json.RawMessage) ([]GroupCallDataChannel, error) { - list := []GroupCallDataChannel{} - - for _, data := range dataList { - entity, err := UnmarshalGroupCallDataChannel(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalInputGroupCall(data json.RawMessage) (InputGroupCall, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInputGroupCallLink: - return UnmarshalInputGroupCallLink(data) - - case TypeInputGroupCallMessage: - return UnmarshalInputGroupCallMessage(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInputGroupCall(dataList []json.RawMessage) ([]InputGroupCall, error) { - list := []InputGroupCall{} - - for _, data := range dataList { - entity, err := UnmarshalInputGroupCall(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalCallProblem(data json.RawMessage) (CallProblem, error) { var meta meta @@ -6315,9 +5296,6 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventShowMessageSenderToggled: return UnmarshalChatEventShowMessageSenderToggled(data) - case TypeChatEventAutomaticTranslationToggled: - return UnmarshalChatEventAutomaticTranslationToggled(data) - case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -6470,11 +5448,11 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeActiveStoryCount: return UnmarshalPremiumLimitTypeActiveStoryCount(data) - case TypePremiumLimitTypeWeeklyPostedStoryCount: - return UnmarshalPremiumLimitTypeWeeklyPostedStoryCount(data) + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) - case TypePremiumLimitTypeMonthlyPostedStoryCount: - return UnmarshalPremiumLimitTypeMonthlyPostedStoryCount(data) + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) case TypePremiumLimitTypeStoryCaptionLength: return UnmarshalPremiumLimitTypeStoryCaptionLength(data) @@ -6585,12 +5563,6 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureMessageEffects: return UnmarshalPremiumFeatureMessageEffects(data) - case TypePremiumFeatureChecklists: - return UnmarshalPremiumFeatureChecklists(data) - - case TypePremiumFeaturePaidMessages: - return UnmarshalPremiumFeaturePaidMessages(data) - default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -7076,7 +6048,7 @@ func UnmarshalListOfInputBackground(dataList []json.RawMessage) ([]InputBackgrou return list, nil } -func UnmarshalChatTheme(data json.RawMessage) (ChatTheme, error) { +func UnmarshalCanSendStoryResult(data json.RawMessage) (CanSendStoryResult, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -7085,139 +6057,34 @@ func UnmarshalChatTheme(data json.RawMessage) (ChatTheme, error) { } switch meta.Type { - case TypeChatThemeEmoji: - return UnmarshalChatThemeEmoji(data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) - case TypeChatThemeGift: - return UnmarshalChatThemeGift(data) + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) + + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) + + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) + + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfChatTheme(dataList []json.RawMessage) ([]ChatTheme, error) { - list := []ChatTheme{} +func UnmarshalListOfCanSendStoryResult(dataList []json.RawMessage) ([]CanSendStoryResult, error) { + list := []CanSendStoryResult{} for _, data := range dataList { - entity, err := UnmarshalChatTheme(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalInputChatTheme(data json.RawMessage) (InputChatTheme, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeInputChatThemeEmoji: - return UnmarshalInputChatThemeEmoji(data) - - case TypeInputChatThemeGift: - return UnmarshalInputChatThemeGift(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfInputChatTheme(dataList []json.RawMessage) ([]InputChatTheme, error) { - list := []InputChatTheme{} - - for _, data := range dataList { - entity, err := UnmarshalInputChatTheme(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - -func UnmarshalCanPostStoryResult(data json.RawMessage) (CanPostStoryResult, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeCanPostStoryResultOk: - return UnmarshalCanPostStoryResultOk(data) - - case TypeCanPostStoryResultPremiumNeeded: - return UnmarshalCanPostStoryResultPremiumNeeded(data) - - case TypeCanPostStoryResultBoostNeeded: - return UnmarshalCanPostStoryResultBoostNeeded(data) - - case TypeCanPostStoryResultActiveStoryLimitExceeded: - return UnmarshalCanPostStoryResultActiveStoryLimitExceeded(data) - - case TypeCanPostStoryResultWeeklyLimitExceeded: - return UnmarshalCanPostStoryResultWeeklyLimitExceeded(data) - - case TypeCanPostStoryResultMonthlyLimitExceeded: - return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) - - case TypeCanPostStoryResultLiveStoryIsActive: - return UnmarshalCanPostStoryResultLiveStoryIsActive(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfCanPostStoryResult(dataList []json.RawMessage) ([]CanPostStoryResult, error) { - list := []CanPostStoryResult{} - - for _, data := range dataList { - entity, err := UnmarshalCanPostStoryResult(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - 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) + entity, err := UnmarshalCanSendStoryResult(data) if err != nil { return nil, err } @@ -7496,9 +6363,6 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) - case TypePushMessageContentChecklist: - return UnmarshalPushMessageContentChecklist(data) - case TypePushMessageContentVideo: return UnmarshalPushMessageContentVideo(data) @@ -7550,18 +6414,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentSuggestProfilePhoto: return UnmarshalPushMessageContentSuggestProfilePhoto(data) - case TypePushMessageContentSuggestBirthdate: - return UnmarshalPushMessageContentSuggestBirthdate(data) - case TypePushMessageContentProximityAlertTriggered: return UnmarshalPushMessageContentProximityAlertTriggered(data) - case TypePushMessageContentChecklistTasksAdded: - return UnmarshalPushMessageContentChecklistTasksAdded(data) - - case TypePushMessageContentChecklistTasksDone: - return UnmarshalPushMessageContentChecklistTasksDone(data) - case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -7881,9 +6736,6 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) - case TypeUserPrivacySettingShowProfileAudio: - return UnmarshalUserPrivacySettingShowProfileAudio(data) - case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -8178,97 +7030,6 @@ func UnmarshalListOfReportStoryResult(dataList []json.RawMessage) ([]ReportStory return list, nil } -func UnmarshalSettingsSection(data json.RawMessage) (SettingsSection, error) { - var meta meta - - err := json.Unmarshal(data, &meta) - if err != nil { - return nil, err - } - - switch meta.Type { - case TypeSettingsSectionAppearance: - return UnmarshalSettingsSectionAppearance(data) - - case TypeSettingsSectionAskQuestion: - return UnmarshalSettingsSectionAskQuestion(data) - - case TypeSettingsSectionBusiness: - return UnmarshalSettingsSectionBusiness(data) - - case TypeSettingsSectionChatFolders: - return UnmarshalSettingsSectionChatFolders(data) - - case TypeSettingsSectionDataAndStorage: - return UnmarshalSettingsSectionDataAndStorage(data) - - case TypeSettingsSectionDevices: - return UnmarshalSettingsSectionDevices(data) - - case TypeSettingsSectionEditProfile: - return UnmarshalSettingsSectionEditProfile(data) - - case TypeSettingsSectionFaq: - return UnmarshalSettingsSectionFaq(data) - - case TypeSettingsSectionFeatures: - return UnmarshalSettingsSectionFeatures(data) - - case TypeSettingsSectionInAppBrowser: - return UnmarshalSettingsSectionInAppBrowser(data) - - case TypeSettingsSectionLanguage: - return UnmarshalSettingsSectionLanguage(data) - - case TypeSettingsSectionMyStars: - return UnmarshalSettingsSectionMyStars(data) - - case TypeSettingsSectionMyToncoins: - return UnmarshalSettingsSectionMyToncoins(data) - - case TypeSettingsSectionNotifications: - return UnmarshalSettingsSectionNotifications(data) - - case TypeSettingsSectionPowerSaving: - return UnmarshalSettingsSectionPowerSaving(data) - - case TypeSettingsSectionPremium: - return UnmarshalSettingsSectionPremium(data) - - case TypeSettingsSectionPrivacyAndSecurity: - return UnmarshalSettingsSectionPrivacyAndSecurity(data) - - case TypeSettingsSectionPrivacyPolicy: - return UnmarshalSettingsSectionPrivacyPolicy(data) - - case TypeSettingsSectionQrCode: - return UnmarshalSettingsSectionQrCode(data) - - case TypeSettingsSectionSearch: - return UnmarshalSettingsSectionSearch(data) - - case TypeSettingsSectionSendGift: - return UnmarshalSettingsSectionSendGift(data) - - default: - return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) - } -} - -func UnmarshalListOfSettingsSection(dataList []json.RawMessage) ([]SettingsSection, error) { - list := []SettingsSection{} - - for _, data := range dataList { - entity, err := UnmarshalSettingsSection(data) - if err != nil { - return nil, err - } - list = append(list, entity) - } - - return list, nil -} - func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { var meta meta @@ -8278,6 +7039,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { } switch meta.Type { + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) + case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -8299,8 +7063,11 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeCallsPage: - return UnmarshalInternalLinkTypeCallsPage(data) + case TypeInternalLinkTypeBuyStars: + return UnmarshalInternalLinkTypeBuyStars(data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -8311,30 +7078,21 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeChatSelection: - return UnmarshalInternalLinkTypeChatSelection(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) - case TypeInternalLinkTypeContactsPage: - return UnmarshalInternalLinkTypeContactsPage(data) - - case TypeInternalLinkTypeDirectMessagesChat: - return UnmarshalInternalLinkTypeDirectMessagesChat(data) + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) - case TypeInternalLinkTypeGiftAuction: - return UnmarshalInternalLinkTypeGiftAuction(data) - - case TypeInternalLinkTypeGiftCollection: - return UnmarshalInternalLinkTypeGiftCollection(data) - - case TypeInternalLinkTypeGroupCall: - return UnmarshalInternalLinkTypeGroupCall(data) - case TypeInternalLinkTypeInstantView: return UnmarshalInternalLinkTypeInstantView(data) @@ -8344,8 +7102,8 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLiveStory: - return UnmarshalInternalLinkTypeLiveStory(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -8356,35 +7114,23 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyProfilePage: - return UnmarshalInternalLinkTypeMyProfilePage(data) - - case TypeInternalLinkTypeNewChannelChat: - return UnmarshalInternalLinkTypeNewChannelChat(data) - - case TypeInternalLinkTypeNewGroupChat: - return UnmarshalInternalLinkTypeNewGroupChat(data) - - case TypeInternalLinkTypeNewPrivateChat: - return UnmarshalInternalLinkTypeNewPrivateChat(data) - - case TypeInternalLinkTypeNewStory: - return UnmarshalInternalLinkTypeNewStory(data) - case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePremiumFeaturesPage: - return UnmarshalInternalLinkTypePremiumFeaturesPage(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePremiumGiftPurchase: - return UnmarshalInternalLinkTypePremiumGiftPurchase(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -8398,33 +7144,27 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) - case TypeInternalLinkTypeSavedMessages: - return UnmarshalInternalLinkTypeSavedMessages(data) - - case TypeInternalLinkTypeSearch: - return UnmarshalInternalLinkTypeSearch(data) - case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) - case TypeInternalLinkTypeStarPurchase: - return UnmarshalInternalLinkTypeStarPurchase(data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(data) - case TypeInternalLinkTypeStoryAlbum: - return UnmarshalInternalLinkTypeStoryAlbum(data) - case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -8893,15 +7633,6 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionExtendStarSubscriptions: return UnmarshalSuggestedActionExtendStarSubscriptions(data) - 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) } @@ -9143,20 +7874,14 @@ func UnmarshalChatRevenueTransactionType(data json.RawMessage) (ChatRevenueTrans } switch meta.Type { - case TypeChatRevenueTransactionTypeUnsupported: - return UnmarshalChatRevenueTransactionTypeUnsupported(data) + case TypeChatRevenueTransactionTypeEarnings: + return UnmarshalChatRevenueTransactionTypeEarnings(data) - case TypeChatRevenueTransactionTypeSponsoredMessageEarnings: - return UnmarshalChatRevenueTransactionTypeSponsoredMessageEarnings(data) + case TypeChatRevenueTransactionTypeWithdrawal: + return UnmarshalChatRevenueTransactionTypeWithdrawal(data) - case TypeChatRevenueTransactionTypeSuggestedPostEarnings: - return UnmarshalChatRevenueTransactionTypeSuggestedPostEarnings(data) - - case TypeChatRevenueTransactionTypeFragmentWithdrawal: - return UnmarshalChatRevenueTransactionTypeFragmentWithdrawal(data) - - case TypeChatRevenueTransactionTypeFragmentRefund: - return UnmarshalChatRevenueTransactionTypeFragmentRefund(data) + case TypeChatRevenueTransactionTypeRefund: + return UnmarshalChatRevenueTransactionTypeRefund(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -9345,9 +8070,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateMessageFactCheck: return UnmarshalUpdateMessageFactCheck(data) - case TypeUpdateMessageSuggestedPostInfo: - return UnmarshalUpdateMessageSuggestedPostInfo(data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -9465,12 +8187,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateSavedMessagesTopicCount: return UnmarshalUpdateSavedMessagesTopicCount(data) - case TypeUpdateDirectMessagesChatTopic: - return UnmarshalUpdateDirectMessagesChatTopic(data) - - case TypeUpdateTopicMessageCount: - return UnmarshalUpdateTopicMessageCount(data) - case TypeUpdateQuickReplyShortcut: return UnmarshalUpdateQuickReplyShortcut(data) @@ -9513,9 +8229,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(data) - case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -9579,36 +8292,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateGroupCallParticipant: return UnmarshalUpdateGroupCallParticipant(data) - case TypeUpdateGroupCallParticipants: - return UnmarshalUpdateGroupCallParticipants(data) - - case TypeUpdateGroupCallVerificationState: - return UnmarshalUpdateGroupCallVerificationState(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) @@ -9624,11 +8310,11 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(data) - case TypeUpdateStoryPostSucceeded: - return UnmarshalUpdateStoryPostSucceeded(data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) - case TypeUpdateStoryPostFailed: - return UnmarshalUpdateStoryPostFailed(data) + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(data) @@ -9639,9 +8325,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) - case TypeUpdateTrustedMiniAppBots: - return UnmarshalUpdateTrustedMiniAppBots(data) - case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -9669,8 +8352,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(data) - case TypeUpdateEmojiChatThemes: - return UnmarshalUpdateEmojiChatThemes(data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) @@ -9687,9 +8370,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) - case TypeUpdateAgeVerificationParameters: - return UnmarshalUpdateAgeVerificationParameters(data) - case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) @@ -9723,30 +8403,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(data) - case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(data) - 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) @@ -10068,22 +8736,6 @@ 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 @@ -10516,38 +9168,6 @@ func UnmarshalPollTypeQuiz(data json.RawMessage) (*PollTypeQuiz, error) { return &resp, err } -func UnmarshalChecklistTask(data json.RawMessage) (*ChecklistTask, error) { - var resp ChecklistTask - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChecklistTask(data json.RawMessage) (*InputChecklistTask, error) { - var resp InputChecklistTask - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChecklist(data json.RawMessage) (*Checklist, error) { - var resp Checklist - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChecklist(data json.RawMessage) (*InputChecklist, error) { - var resp InputChecklist - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalAnimation(data json.RawMessage) (*Animation, error) { var resp Animation @@ -10564,14 +9184,6 @@ func UnmarshalAudio(data json.RawMessage) (*Audio, error) { return &resp, err } -func UnmarshalAudios(data json.RawMessage) (*Audios, error) { - var resp Audios - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalDocument(data json.RawMessage) (*Document, error) { var resp Document @@ -10660,14 +9272,6 @@ 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 @@ -10692,14 +9296,6 @@ func UnmarshalAlternativeVideo(data json.RawMessage) (*AlternativeVideo, error) return &resp, err } -func UnmarshalVideoStoryboard(data json.RawMessage) (*VideoStoryboard, error) { - var resp VideoStoryboard - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalBackground(data json.RawMessage) (*Background, error) { var resp Background @@ -10740,70 +9336,6 @@ func UnmarshalChatPhotoInfo(data json.RawMessage) (*ChatPhotoInfo, error) { return &resp, err } -func UnmarshalProfileTabPosts(data json.RawMessage) (*ProfileTabPosts, error) { - var resp ProfileTabPosts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabGifts(data json.RawMessage) (*ProfileTabGifts, error) { - var resp ProfileTabGifts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabMedia(data json.RawMessage) (*ProfileTabMedia, error) { - var resp ProfileTabMedia - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabFiles(data json.RawMessage) (*ProfileTabFiles, error) { - var resp ProfileTabFiles - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabLinks(data json.RawMessage) (*ProfileTabLinks, error) { - var resp ProfileTabLinks - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabMusic(data json.RawMessage) (*ProfileTabMusic, error) { - var resp ProfileTabMusic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabVoice(data json.RawMessage) (*ProfileTabVoice, error) { - var resp ProfileTabVoice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalProfileTabGifs(data json.RawMessage) (*ProfileTabGifs, error) { - var resp ProfileTabGifs - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUserTypeRegular(data json.RawMessage) (*UserTypeRegular, error) { var resp UserTypeRegular @@ -11148,118 +9680,6 @@ func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorR return &resp, err } -func UnmarshalGiftResalePriceStar(data json.RawMessage) (*GiftResalePriceStar, error) { - var resp GiftResalePriceStar - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftResalePriceTon(data json.RawMessage) (*GiftResalePriceTon, error) { - var resp GiftResalePriceTon - - err := json.Unmarshal(data, &resp) - - 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostPriceTon(data json.RawMessage) (*SuggestedPostPriceTon, error) { - var resp SuggestedPostPriceTon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostStatePending(data json.RawMessage) (*SuggestedPostStatePending, error) { - var resp SuggestedPostStatePending - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostStateApproved(data json.RawMessage) (*SuggestedPostStateApproved, error) { - var resp SuggestedPostStateApproved - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostStateDeclined(data json.RawMessage) (*SuggestedPostStateDeclined, error) { - var resp SuggestedPostStateDeclined - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostInfo(data json.RawMessage) (*SuggestedPostInfo, error) { - var resp SuggestedPostInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputSuggestedPostInfo(data json.RawMessage) (*InputSuggestedPostInfo, error) { - var resp InputSuggestedPostInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostRefundReasonPostDeleted(data json.RawMessage) (*SuggestedPostRefundReasonPostDeleted, error) { - var resp SuggestedPostRefundReasonPostDeleted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSuggestedPostRefundReasonPaymentRefunded(data json.RawMessage) (*SuggestedPostRefundReasonPaymentRefunded, error) { - var resp SuggestedPostRefundReasonPaymentRefunded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStarAmount(data json.RawMessage) (*StarAmount, error) { var resp StarAmount @@ -11532,166 +9952,6 @@ 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftResaleParameters(data json.RawMessage) (*GiftResaleParameters, error) { - var resp GiftResaleParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftCollection(data json.RawMessage) (*GiftCollection, error) { - var resp GiftCollection - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftCollections(data json.RawMessage) (*GiftCollections, error) { - var resp GiftCollections - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCanSendGiftResultOk(data json.RawMessage) (*CanSendGiftResultOk, error) { - var resp CanSendGiftResultOk - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCanSendGiftResultFail(data json.RawMessage) (*CanSendGiftResultFail, error) { - var resp CanSendGiftResultFail - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginUpgrade(data json.RawMessage) (*UpgradedGiftOriginUpgrade, error) { - var resp UpgradedGiftOriginUpgrade - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginTransfer(data json.RawMessage) (*UpgradedGiftOriginTransfer, error) { - var resp UpgradedGiftOriginTransfer - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginResale(data json.RawMessage) (*UpgradedGiftOriginResale, error) { - var resp UpgradedGiftOriginResale - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginBlockchain(data json.RawMessage) (*UpgradedGiftOriginBlockchain, error) { - var resp UpgradedGiftOriginBlockchain - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginPrepaidUpgrade(data json.RawMessage) (*UpgradedGiftOriginPrepaidUpgrade, error) { - var resp UpgradedGiftOriginPrepaidUpgrade - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginOffer(data json.RawMessage) (*UpgradedGiftOriginOffer, error) { - var resp UpgradedGiftOriginOffer - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftOriginCraft(data json.RawMessage) (*UpgradedGiftOriginCraft, error) { - var resp UpgradedGiftOriginCraft - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeRarityPerMille(data json.RawMessage) (*UpgradedGiftAttributeRarityPerMille, error) { - var resp UpgradedGiftAttributeRarityPerMille - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeRarityUncommon(data json.RawMessage) (*UpgradedGiftAttributeRarityUncommon, error) { - var resp UpgradedGiftAttributeRarityUncommon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeRarityRare(data json.RawMessage) (*UpgradedGiftAttributeRarityRare, error) { - var resp UpgradedGiftAttributeRarityRare - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeRarityEpic(data json.RawMessage) (*UpgradedGiftAttributeRarityEpic, error) { - var resp UpgradedGiftAttributeRarityEpic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeRarityLegendary(data json.RawMessage) (*UpgradedGiftAttributeRarityLegendary, error) { - var resp UpgradedGiftAttributeRarityLegendary - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) { var resp UpgradedGiftModel @@ -11732,16 +9992,16 @@ func UnmarshalUpgradedGiftOriginalDetails(data json.RawMessage) (*UpgradedGiftOr return &resp, err } -func UnmarshalUpgradedGiftColors(data json.RawMessage) (*UpgradedGiftColors, error) { - var resp UpgradedGiftColors +func UnmarshalGift(data json.RawMessage) (*Gift, error) { + var resp Gift err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalGift(data json.RawMessage) (*Gift, error) { - var resp Gift +func UnmarshalGifts(data json.RawMessage) (*Gifts, error) { + var resp Gifts err := json.Unmarshal(data, &resp) @@ -11756,14 +10016,6 @@ func UnmarshalUpgradedGift(data json.RawMessage) (*UpgradedGift, error) { return &resp, err } -func UnmarshalUpgradedGiftValueInfo(data json.RawMessage) (*UpgradedGiftValueInfo, error) { - var resp UpgradedGiftValueInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error) { var resp UpgradeGiftResult @@ -11772,166 +10024,6 @@ func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error return &resp, err } -func UnmarshalCraftGiftResultSuccess(data json.RawMessage) (*CraftGiftResultSuccess, error) { - var resp CraftGiftResultSuccess - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCraftGiftResultTooEarly(data json.RawMessage) (*CraftGiftResultTooEarly, error) { - var resp CraftGiftResultTooEarly - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCraftGiftResultInvalidGift(data json.RawMessage) (*CraftGiftResultInvalidGift, error) { - var resp CraftGiftResultInvalidGift - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalCraftGiftResultFail(data json.RawMessage) (*CraftGiftResultFail, error) { - var resp CraftGiftResultFail - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAvailableGift(data json.RawMessage) (*AvailableGift, error) { - var resp AvailableGift - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalAvailableGifts(data json.RawMessage) (*AvailableGifts, error) { - var resp AvailableGifts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftUpgradePrice(data json.RawMessage) (*GiftUpgradePrice, error) { - var resp GiftUpgradePrice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeIdModel(data json.RawMessage) (*UpgradedGiftAttributeIdModel, error) { - var resp UpgradedGiftAttributeIdModel - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeIdSymbol(data json.RawMessage) (*UpgradedGiftAttributeIdSymbol, error) { - var resp UpgradedGiftAttributeIdSymbol - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftAttributeIdBackdrop(data json.RawMessage) (*UpgradedGiftAttributeIdBackdrop, error) { - var resp UpgradedGiftAttributeIdBackdrop - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftModelCount(data json.RawMessage) (*UpgradedGiftModelCount, error) { - var resp UpgradedGiftModelCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftSymbolCount(data json.RawMessage) (*UpgradedGiftSymbolCount, error) { - var resp UpgradedGiftSymbolCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpgradedGiftBackdropCount(data json.RawMessage) (*UpgradedGiftBackdropCount, error) { - var resp UpgradedGiftBackdropCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftForResaleOrderPrice(data json.RawMessage) (*GiftForResaleOrderPrice, error) { - var resp GiftForResaleOrderPrice - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftForResaleOrderPriceChangeDate(data json.RawMessage) (*GiftForResaleOrderPriceChangeDate, error) { - var resp GiftForResaleOrderPriceChangeDate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftForResaleOrderNumber(data json.RawMessage) (*GiftForResaleOrderNumber, error) { - var resp GiftForResaleOrderNumber - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftForResale(data json.RawMessage) (*GiftForResale, error) { - var resp GiftForResale - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftsForResale(data json.RawMessage) (*GiftsForResale, error) { - var resp GiftsForResale - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftResaleResultOk(data json.RawMessage) (*GiftResaleResultOk, error) { - var resp GiftResaleResultOk - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftResaleResultPriceIncreased(data json.RawMessage) (*GiftResaleResultPriceIncreased, error) { - var resp GiftResaleResultPriceIncreased - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSentGiftRegular(data json.RawMessage) (*SentGiftRegular, error) { var resp SentGiftRegular @@ -11964,22 +10056,6 @@ func UnmarshalReceivedGifts(data json.RawMessage) (*ReceivedGifts, error) { return &resp, err } -func UnmarshalAttributeCraftPersistenceProbability(data json.RawMessage) (*AttributeCraftPersistenceProbability, error) { - var resp AttributeCraftPersistenceProbability - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftsForCrafting(data json.RawMessage) (*GiftsForCrafting, error) { - var resp GiftsForCrafting - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, error) { var resp GiftUpgradePreview @@ -11988,88 +10064,16 @@ func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, err return &resp, err } -func UnmarshalGiftUpgradeVariants(data json.RawMessage) (*GiftUpgradeVariants, error) { - var resp GiftUpgradeVariants +func UnmarshalStarTransactionDirectionIncoming(data json.RawMessage) (*StarTransactionDirectionIncoming, error) { + var resp StarTransactionDirectionIncoming 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTransactionDirectionOutgoing(data json.RawMessage) (*TransactionDirectionOutgoing, error) { - var resp TransactionDirectionOutgoing +func UnmarshalStarTransactionDirectionOutgoing(data json.RawMessage) (*StarTransactionDirectionOutgoing, error) { + var resp StarTransactionDirectionOutgoing err := json.Unmarshal(data, &resp) @@ -12228,14 +10232,6 @@ 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 @@ -12244,14 +10240,6 @@ 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 @@ -12260,14 +10248,6 @@ func UnmarshalStarTransactionTypeGiftTransfer(data json.RawMessage) (*StarTransa return &resp, err } -func UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data json.RawMessage) (*StarTransactionTypeGiftOriginalDetailsDrop, error) { - var resp StarTransactionTypeGiftOriginalDetailsDrop - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStarTransactionTypeGiftSale(data json.RawMessage) (*StarTransactionTypeGiftSale, error) { var resp StarTransactionTypeGiftSale @@ -12284,30 +10264,6 @@ func UnmarshalStarTransactionTypeGiftUpgrade(data json.RawMessage) (*StarTransac return &resp, err } -func UnmarshalStarTransactionTypeGiftUpgradePurchase(data json.RawMessage) (*StarTransactionTypeGiftUpgradePurchase, error) { - var resp StarTransactionTypeGiftUpgradePurchase - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStarTransactionTypeUpgradedGiftPurchase(data json.RawMessage) (*StarTransactionTypeUpgradedGiftPurchase, error) { - var resp StarTransactionTypeUpgradedGiftPurchase - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStarTransactionTypeUpgradedGiftSale(data json.RawMessage) (*StarTransactionTypeUpgradedGiftSale, error) { - var resp StarTransactionTypeUpgradedGiftSale - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStarTransactionTypeChannelPaidReactionSend(data json.RawMessage) (*StarTransactionTypeChannelPaidReactionSend, error) { var resp StarTransactionTypeChannelPaidReactionSend @@ -12348,54 +10304,6 @@ 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStarTransactionTypeSuggestedPostPaymentReceive(data json.RawMessage) (*StarTransactionTypeSuggestedPostPaymentReceive, error) { - var resp StarTransactionTypeSuggestedPostPaymentReceive - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStarTransactionTypePremiumPurchase(data json.RawMessage) (*StarTransactionTypePremiumPurchase, error) { var resp StarTransactionTypePremiumPurchase @@ -12420,14 +10328,6 @@ func UnmarshalStarTransactionTypeBusinessBotTransferReceive(data json.RawMessage return &resp, err } -func UnmarshalStarTransactionTypePublicPostSearch(data json.RawMessage) (*StarTransactionTypePublicPostSearch, error) { - var resp StarTransactionTypePublicPostSearch - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStarTransactionTypeUnsupported(data json.RawMessage) (*StarTransactionTypeUnsupported, error) { var resp StarTransactionTypeUnsupported @@ -12452,118 +10352,6 @@ func UnmarshalStarTransactions(data json.RawMessage) (*StarTransactions, error) return &resp, err } -func UnmarshalTonTransactionTypeFragmentDeposit(data json.RawMessage) (*TonTransactionTypeFragmentDeposit, error) { - var resp TonTransactionTypeFragmentDeposit - - err := json.Unmarshal(data, &resp) - - 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 - - err := json.Unmarshal(data, &resp) - - 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransactionTypeUpgradedGiftSale(data json.RawMessage) (*TonTransactionTypeUpgradedGiftSale, error) { - var resp TonTransactionTypeUpgradedGiftSale - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransactionTypeStakeDiceStake(data json.RawMessage) (*TonTransactionTypeStakeDiceStake, error) { - var resp TonTransactionTypeStakeDiceStake - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransactionTypeStakeDicePayout(data json.RawMessage) (*TonTransactionTypeStakeDicePayout, error) { - var resp TonTransactionTypeStakeDicePayout - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransactionTypeUnsupported(data json.RawMessage) (*TonTransactionTypeUnsupported, error) { - var resp TonTransactionTypeUnsupported - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransaction(data json.RawMessage) (*TonTransaction, error) { - var resp TonTransaction - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonTransactions(data json.RawMessage) (*TonTransactions, error) { - var resp TonTransactions - - err := json.Unmarshal(data, &resp) - - 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 @@ -12660,22 +10448,6 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err return &resp, err } -func UnmarshalUserRating(data json.RawMessage) (*UserRating, error) { - var resp UserRating - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalRestrictionInfo(data json.RawMessage) (*RestrictionInfo, error) { - var resp RestrictionInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalEmojiStatusTypeCustomEmoji(data json.RawMessage) (*EmojiStatusTypeCustomEmoji, error) { var resp EmojiStatusTypeCustomEmoji @@ -13140,14 +10912,6 @@ func UnmarshalSecretChat(data json.RawMessage) (*SecretChat, error) { return &resp, err } -func UnmarshalPublicPostSearchLimits(data json.RawMessage) (*PublicPostSearchLimits, error) { - var resp PublicPostSearchLimits - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageSenderUser(data json.RawMessage) (*MessageSenderUser, error) { var resp MessageSenderUser @@ -13340,14 +11104,6 @@ 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 @@ -13404,38 +11160,6 @@ func UnmarshalUnreadReaction(data json.RawMessage) (*UnreadReaction, error) { return &resp, err } -func UnmarshalMessageTopicThread(data json.RawMessage) (*MessageTopicThread, error) { - var resp MessageTopicThread - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageTopicForum(data json.RawMessage) (*MessageTopicForum, error) { - var resp MessageTopicForum - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageTopicDirectMessages(data json.RawMessage) (*MessageTopicDirectMessages, error) { - var resp MessageTopicDirectMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageTopicSavedMessages(data json.RawMessage) (*MessageTopicSavedMessages, error) { - var resp MessageTopicSavedMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageEffectTypeEmojiReaction(data json.RawMessage) (*MessageEffectTypeEmojiReaction, error) { var resp MessageEffectTypeEmojiReaction @@ -13572,14 +11296,6 @@ func UnmarshalFoundChatMessages(data json.RawMessage) (*FoundChatMessages, error return &resp, err } -func UnmarshalFoundPublicPosts(data json.RawMessage) (*FoundPublicPosts, error) { - var resp FoundPublicPosts - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessagePosition(data json.RawMessage) (*MessagePosition, error) { var resp MessagePosition @@ -13652,14 +11368,6 @@ func UnmarshalMessageSourceForumTopicHistory(data json.RawMessage) (*MessageSour return &resp, err } -func UnmarshalMessageSourceDirectMessagesChatTopicHistory(data json.RawMessage) (*MessageSourceDirectMessagesChatTopicHistory, error) { - var resp MessageSourceDirectMessagesChatTopicHistory - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageSourceHistoryPreview(data json.RawMessage) (*MessageSourceHistoryPreview, error) { var resp MessageSourceHistoryPreview @@ -13716,8 +11424,8 @@ func UnmarshalMessageSourceOther(data json.RawMessage) (*MessageSourceOther, err return &resp, err } -func UnmarshalAdvertisementSponsor(data json.RawMessage) (*AdvertisementSponsor, error) { - var resp AdvertisementSponsor +func UnmarshalMessageSponsor(data json.RawMessage) (*MessageSponsor, error) { + var resp MessageSponsor err := json.Unmarshal(data, &resp) @@ -13756,22 +11464,6 @@ func UnmarshalSponsoredChats(data json.RawMessage) (*SponsoredChats, error) { return &resp, err } -func UnmarshalVideoMessageAdvertisement(data json.RawMessage) (*VideoMessageAdvertisement, error) { - var resp VideoMessageAdvertisement - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalVideoMessageAdvertisements(data json.RawMessage) (*VideoMessageAdvertisements, error) { - var resp VideoMessageAdvertisements - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalReportOption(data json.RawMessage) (*ReportOption, error) { var resp ReportOption @@ -14252,38 +11944,6 @@ func UnmarshalChatActionBarJoinRequest(data json.RawMessage) (*ChatActionBarJoin return &resp, err } -func UnmarshalButtonStyleDefault(data json.RawMessage) (*ButtonStyleDefault, error) { - var resp ButtonStyleDefault - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalButtonStylePrimary(data json.RawMessage) (*ButtonStylePrimary, error) { - var resp ButtonStylePrimary - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalButtonStyleDanger(data json.RawMessage) (*ButtonStyleDanger, error) { - var resp ButtonStyleDanger - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalButtonStyleSuccess(data json.RawMessage) (*ButtonStyleSuccess, error) { - var resp ButtonStyleSuccess - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalKeyboardButtonTypeText(data json.RawMessage) (*KeyboardButtonTypeText, error) { var resp KeyboardButtonTypeText @@ -14588,14 +12248,6 @@ func UnmarshalSavedMessagesTopic(data json.RawMessage) (*SavedMessagesTopic, err return &resp, err } -func UnmarshalDirectMessagesChatTopic(data json.RawMessage) (*DirectMessagesChatTopic, error) { - var resp DirectMessagesChatTopic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) { var resp ForumTopicIcon @@ -14652,46 +12304,6 @@ func UnmarshalSharedChat(data json.RawMessage) (*SharedChat, error) { return &resp, err } -func UnmarshalBuiltInThemeClassic(data json.RawMessage) (*BuiltInThemeClassic, error) { - var resp BuiltInThemeClassic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBuiltInThemeDay(data json.RawMessage) (*BuiltInThemeDay, error) { - var resp BuiltInThemeDay - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBuiltInThemeNight(data json.RawMessage) (*BuiltInThemeNight, error) { - var resp BuiltInThemeNight - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBuiltInThemeTinted(data json.RawMessage) (*BuiltInThemeTinted, error) { - var resp BuiltInThemeTinted - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBuiltInThemeArctic(data json.RawMessage) (*BuiltInThemeArctic, error) { - var resp BuiltInThemeArctic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { var resp ThemeSettings @@ -15236,14 +12848,6 @@ func UnmarshalLinkPreviewTypeChat(data json.RawMessage) (*LinkPreviewTypeChat, e return &resp, err } -func UnmarshalLinkPreviewTypeDirectMessagesChat(data json.RawMessage) (*LinkPreviewTypeDirectMessagesChat, error) { - var resp LinkPreviewTypeDirectMessagesChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalLinkPreviewTypeDocument(data json.RawMessage) (*LinkPreviewTypeDocument, error) { var resp LinkPreviewTypeDocument @@ -15292,30 +12896,6 @@ 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalLinkPreviewTypeGroupCall(data json.RawMessage) (*LinkPreviewTypeGroupCall, error) { - var resp LinkPreviewTypeGroupCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalLinkPreviewTypeInvoice(data json.RawMessage) (*LinkPreviewTypeInvoice, error) { var resp LinkPreviewTypeInvoice @@ -15324,14 +12904,6 @@ 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 @@ -15388,14 +12960,6 @@ func UnmarshalLinkPreviewTypeStory(data json.RawMessage) (*LinkPreviewTypeStory, return &resp, err } -func UnmarshalLinkPreviewTypeStoryAlbum(data json.RawMessage) (*LinkPreviewTypeStoryAlbum, error) { - var resp LinkPreviewTypeStoryAlbum - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalLinkPreviewTypeSupergroupBoost(data json.RawMessage) (*LinkPreviewTypeSupergroupBoost, error) { var resp LinkPreviewTypeSupergroupBoost @@ -16556,14 +14120,6 @@ 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 @@ -16572,14 +14128,6 @@ func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { return &resp, err } -func UnmarshalMessageChecklist(data json.RawMessage) (*MessageChecklist, error) { - var resp MessageChecklist - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageInvoice(data json.RawMessage) (*MessageInvoice, error) { var resp MessageInvoice @@ -16596,14 +14144,6 @@ func UnmarshalMessageCall(data json.RawMessage) (*MessageCall, error) { return &resp, err } -func UnmarshalMessageGroupCall(data json.RawMessage) (*MessageGroupCall, error) { - var resp MessageGroupCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageVideoChatScheduled(data json.RawMessage) (*MessageVideoChatScheduled, error) { var resp MessageVideoChatScheduled @@ -16676,22 +14216,6 @@ func UnmarshalMessageChatDeletePhoto(data json.RawMessage) (*MessageChatDeletePh return &resp, err } -func UnmarshalMessageChatOwnerLeft(data json.RawMessage) (*MessageChatOwnerLeft, error) { - var resp MessageChatOwnerLeft - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChatOwnerChanged(data json.RawMessage) (*MessageChatOwnerChanged, error) { - var resp MessageChatOwnerChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) { var resp MessageChatAddMembers @@ -16828,14 +14352,6 @@ func UnmarshalMessageSuggestProfilePhoto(data json.RawMessage) (*MessageSuggestP return &resp, err } -func UnmarshalMessageSuggestBirthdate(data json.RawMessage) (*MessageSuggestBirthdate, error) { - var resp MessageSuggestBirthdate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageCustomServiceAction(data json.RawMessage) (*MessageCustomServiceAction, error) { var resp MessageCustomServiceAction @@ -16932,14 +14448,6 @@ func UnmarshalMessageGiftedStars(data json.RawMessage) (*MessageGiftedStars, err return &resp, err } -func UnmarshalMessageGiftedTon(data json.RawMessage) (*MessageGiftedTon, error) { - var resp MessageGiftedTon - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageGiveawayPrizeStars(data json.RawMessage) (*MessageGiveawayPrizeStars, error) { var resp MessageGiveawayPrizeStars @@ -16972,22 +14480,6 @@ 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 @@ -17004,70 +14496,6 @@ func UnmarshalMessagePaidMessagePriceChanged(data json.RawMessage) (*MessagePaid return &resp, err } -func UnmarshalMessageDirectMessagePriceChanged(data json.RawMessage) (*MessageDirectMessagePriceChanged, error) { - var resp MessageDirectMessagePriceChanged - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChecklistTasksDone(data json.RawMessage) (*MessageChecklistTasksDone, error) { - var resp MessageChecklistTasksDone - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageChecklistTasksAdded(data json.RawMessage) (*MessageChecklistTasksAdded, error) { - var resp MessageChecklistTasksAdded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestedPostApprovalFailed(data json.RawMessage) (*MessageSuggestedPostApprovalFailed, error) { - var resp MessageSuggestedPostApprovalFailed - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestedPostApproved(data json.RawMessage) (*MessageSuggestedPostApproved, error) { - var resp MessageSuggestedPostApproved - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestedPostDeclined(data json.RawMessage) (*MessageSuggestedPostDeclined, error) { - var resp MessageSuggestedPostDeclined - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestedPostPaid(data json.RawMessage) (*MessageSuggestedPostPaid, error) { - var resp MessageSuggestedPostPaid - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageSuggestedPostRefunded(data json.RawMessage) (*MessageSuggestedPostRefunded, error) { - var resp MessageSuggestedPostRefunded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -17548,14 +14976,6 @@ 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 @@ -17564,14 +14984,6 @@ func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error return &resp, err } -func UnmarshalInputMessageChecklist(data json.RawMessage) (*InputMessageChecklist, error) { - var resp InputMessageChecklist - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { var resp InputMessageForwarded @@ -18212,38 +15624,6 @@ func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { return &resp, err } -func UnmarshalStoryContentTypePhoto(data json.RawMessage) (*StoryContentTypePhoto, error) { - var resp StoryContentTypePhoto - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStoryContentTypeVideo(data json.RawMessage) (*StoryContentTypeVideo, error) { - var resp StoryContentTypeVideo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStoryContentTypeLive(data json.RawMessage) (*StoryContentTypeLive, error) { - var resp StoryContentTypeLive - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStoryContentTypeUnsupported(data json.RawMessage) (*StoryContentTypeUnsupported, error) { - var resp StoryContentTypeUnsupported - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { var resp StoryContentPhoto @@ -18260,14 +15640,6 @@ 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 @@ -18364,22 +15736,6 @@ func UnmarshalFoundStories(data json.RawMessage) (*FoundStories, error) { return &resp, err } -func UnmarshalStoryAlbum(data json.RawMessage) (*StoryAlbum, error) { - var resp StoryAlbum - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalStoryAlbums(data json.RawMessage) (*StoryAlbums, error) { - var resp StoryAlbums - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalStoryFullId(data json.RawMessage) (*StoryFullId, error) { var resp StoryFullId @@ -18660,8 +16016,8 @@ func UnmarshalCallDiscardReasonHungUp(data json.RawMessage) (*CallDiscardReasonH return &resp, err } -func UnmarshalCallDiscardReasonUpgradeToGroupCall(data json.RawMessage) (*CallDiscardReasonUpgradeToGroupCall, error) { - var resp CallDiscardReasonUpgradeToGroupCall +func UnmarshalCallDiscardReasonAllowGroupCall(data json.RawMessage) (*CallDiscardReasonAllowGroupCall, error) { + var resp CallDiscardReasonAllowGroupCall err := json.Unmarshal(data, &resp) @@ -18764,14 +16120,6 @@ func UnmarshalCallStateError(data json.RawMessage) (*CallStateError, error) { return &resp, err } -func UnmarshalGroupCallJoinParameters(data json.RawMessage) (*GroupCallJoinParameters, error) { - var resp GroupCallJoinParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalGroupCallVideoQualityThumbnail(data json.RawMessage) (*GroupCallVideoQualityThumbnail, error) { var resp GroupCallVideoQualityThumbnail @@ -18860,102 +16208,6 @@ func UnmarshalGroupCallParticipant(data json.RawMessage) (*GroupCallParticipant, return &resp, err } -func UnmarshalGroupCallParticipants(data json.RawMessage) (*GroupCallParticipants, error) { - var resp GroupCallParticipants - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallInfo(data json.RawMessage) (*GroupCallInfo, error) { - var resp GroupCallInfo - - err := json.Unmarshal(data, &resp) - - 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInviteGroupCallParticipantResultUserAlreadyParticipant(data json.RawMessage) (*InviteGroupCallParticipantResultUserAlreadyParticipant, error) { - var resp InviteGroupCallParticipantResultUserAlreadyParticipant - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInviteGroupCallParticipantResultUserWasBanned(data json.RawMessage) (*InviteGroupCallParticipantResultUserWasBanned, error) { - var resp InviteGroupCallParticipantResultUserWasBanned - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInviteGroupCallParticipantResultSuccess(data json.RawMessage) (*InviteGroupCallParticipantResultSuccess, error) { - var resp InviteGroupCallParticipantResultSuccess - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallDataChannelMain(data json.RawMessage) (*GroupCallDataChannelMain, error) { - var resp GroupCallDataChannelMain - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGroupCallDataChannelScreenSharing(data json.RawMessage) (*GroupCallDataChannelScreenSharing, error) { - var resp GroupCallDataChannelScreenSharing - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputGroupCallLink(data json.RawMessage) (*InputGroupCallLink, error) { - var resp InputGroupCallLink - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputGroupCallMessage(data json.RawMessage) (*InputGroupCallMessage, error) { - var resp InputGroupCallMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalCallProblemEcho(data json.RawMessage) (*CallProblemEcho, error) { var resp CallProblemEcho @@ -19140,14 +16392,6 @@ func UnmarshalDiceStickersSlotMachine(data json.RawMessage) (*DiceStickersSlotMa return &resp, err } -func UnmarshalImportedContact(data json.RawMessage) (*ImportedContact, error) { - var resp ImportedContact - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error) { var resp ImportedContacts @@ -19876,14 +17120,6 @@ func UnmarshalChatEventShowMessageSenderToggled(data json.RawMessage) (*ChatEven return &resp, err } -func UnmarshalChatEventAutomaticTranslationToggled(data json.RawMessage) (*ChatEventAutomaticTranslationToggled, error) { - var resp ChatEventAutomaticTranslationToggled - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatEventInviteLinkEdited(data json.RawMessage) (*ChatEventInviteLinkEdited, error) { var resp ChatEventInviteLinkEdited @@ -20196,16 +17432,16 @@ func UnmarshalPremiumLimitTypeActiveStoryCount(data json.RawMessage) (*PremiumLi return &resp, err } -func UnmarshalPremiumLimitTypeWeeklyPostedStoryCount(data json.RawMessage) (*PremiumLimitTypeWeeklyPostedStoryCount, error) { - var resp PremiumLimitTypeWeeklyPostedStoryCount +func UnmarshalPremiumLimitTypeWeeklySentStoryCount(data json.RawMessage) (*PremiumLimitTypeWeeklySentStoryCount, error) { + var resp PremiumLimitTypeWeeklySentStoryCount err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalPremiumLimitTypeMonthlyPostedStoryCount(data json.RawMessage) (*PremiumLimitTypeMonthlyPostedStoryCount, error) { - var resp PremiumLimitTypeMonthlyPostedStoryCount +func UnmarshalPremiumLimitTypeMonthlySentStoryCount(data json.RawMessage) (*PremiumLimitTypeMonthlySentStoryCount, error) { + var resp PremiumLimitTypeMonthlySentStoryCount err := json.Unmarshal(data, &resp) @@ -20428,22 +17664,6 @@ func UnmarshalPremiumFeatureMessageEffects(data json.RawMessage) (*PremiumFeatur return &resp, err } -func UnmarshalPremiumFeatureChecklists(data json.RawMessage) (*PremiumFeatureChecklists, error) { - var resp PremiumFeatureChecklists - - err := json.Unmarshal(data, &resp) - - 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 @@ -20996,56 +18216,8 @@ func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPre return &resp, err } -func UnmarshalEmojiChatTheme(data json.RawMessage) (*EmojiChatTheme, error) { - var resp EmojiChatTheme - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftChatTheme(data json.RawMessage) (*GiftChatTheme, error) { - var resp GiftChatTheme - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalGiftChatThemes(data json.RawMessage) (*GiftChatThemes, error) { - var resp GiftChatThemes - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatThemeEmoji(data json.RawMessage) (*ChatThemeEmoji, error) { - var resp ChatThemeEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatThemeGift(data json.RawMessage) (*ChatThemeGift, error) { - var resp ChatThemeGift - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChatThemeEmoji(data json.RawMessage) (*InputChatThemeEmoji, error) { - var resp InputChatThemeEmoji - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInputChatThemeGift(data json.RawMessage) (*InputChatThemeGift, error) { - var resp InputChatThemeGift +func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) { + var resp ChatTheme err := json.Unmarshal(data, &resp) @@ -21076,72 +18248,48 @@ func UnmarshalHashtags(data json.RawMessage) (*Hashtags, error) { return &resp, err } -func UnmarshalCanPostStoryResultOk(data json.RawMessage) (*CanPostStoryResultOk, error) { - var resp CanPostStoryResultOk +func UnmarshalCanSendStoryResultOk(data json.RawMessage) (*CanSendStoryResultOk, error) { + var resp CanSendStoryResultOk err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalCanPostStoryResultPremiumNeeded(data json.RawMessage) (*CanPostStoryResultPremiumNeeded, error) { - var resp CanPostStoryResultPremiumNeeded +func UnmarshalCanSendStoryResultPremiumNeeded(data json.RawMessage) (*CanSendStoryResultPremiumNeeded, error) { + var resp CanSendStoryResultPremiumNeeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalCanPostStoryResultBoostNeeded(data json.RawMessage) (*CanPostStoryResultBoostNeeded, error) { - var resp CanPostStoryResultBoostNeeded +func UnmarshalCanSendStoryResultBoostNeeded(data json.RawMessage) (*CanSendStoryResultBoostNeeded, error) { + var resp CanSendStoryResultBoostNeeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalCanPostStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanPostStoryResultActiveStoryLimitExceeded, error) { - var resp CanPostStoryResultActiveStoryLimitExceeded +func UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanSendStoryResultActiveStoryLimitExceeded, error) { + var resp CanSendStoryResultActiveStoryLimitExceeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalCanPostStoryResultWeeklyLimitExceeded(data json.RawMessage) (*CanPostStoryResultWeeklyLimitExceeded, error) { - var resp CanPostStoryResultWeeklyLimitExceeded +func UnmarshalCanSendStoryResultWeeklyLimitExceeded(data json.RawMessage) (*CanSendStoryResultWeeklyLimitExceeded, error) { + var resp CanSendStoryResultWeeklyLimitExceeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalCanPostStoryResultMonthlyLimitExceeded(data json.RawMessage) (*CanPostStoryResultMonthlyLimitExceeded, error) { - var resp CanPostStoryResultMonthlyLimitExceeded - - err := json.Unmarshal(data, &resp) - - 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 +func UnmarshalCanSendStoryResultMonthlyLimitExceeded(data json.RawMessage) (*CanSendStoryResultMonthlyLimitExceeded, error) { + var resp CanSendStoryResultMonthlyLimitExceeded err := json.Unmarshal(data, &resp) @@ -21468,14 +18616,6 @@ func UnmarshalPushMessageContentText(data json.RawMessage) (*PushMessageContentT return &resp, err } -func UnmarshalPushMessageContentChecklist(data json.RawMessage) (*PushMessageContentChecklist, error) { - var resp PushMessageContentChecklist - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPushMessageContentVideo(data json.RawMessage) (*PushMessageContentVideo, error) { var resp PushMessageContentVideo @@ -21612,14 +18752,6 @@ func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*Push return &resp, err } -func UnmarshalPushMessageContentSuggestBirthdate(data json.RawMessage) (*PushMessageContentSuggestBirthdate, error) { - var resp PushMessageContentSuggestBirthdate - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPushMessageContentProximityAlertTriggered(data json.RawMessage) (*PushMessageContentProximityAlertTriggered, error) { var resp PushMessageContentProximityAlertTriggered @@ -21628,22 +18760,6 @@ func UnmarshalPushMessageContentProximityAlertTriggered(data json.RawMessage) (* return &resp, err } -func UnmarshalPushMessageContentChecklistTasksAdded(data json.RawMessage) (*PushMessageContentChecklistTasksAdded, error) { - var resp PushMessageContentChecklistTasksAdded - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalPushMessageContentChecklistTasksDone(data json.RawMessage) (*PushMessageContentChecklistTasksDone, error) { - var resp PushMessageContentChecklistTasksDone - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { var resp PushMessageContentMessageForwards @@ -21756,14 +18872,6 @@ func UnmarshalNotificationGroup(data json.RawMessage) (*NotificationGroup, error return &resp, err } -func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { - var resp Proxy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalOptionValueBoolean(data json.RawMessage) (*OptionValueBoolean, error) { var resp OptionValueBoolean @@ -22028,14 +19136,6 @@ 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 @@ -22468,168 +19568,8 @@ func UnmarshalReportStoryResultTextRequired(data json.RawMessage) (*ReportStoryR return &resp, err } -func UnmarshalSettingsSectionAppearance(data json.RawMessage) (*SettingsSectionAppearance, error) { - var resp SettingsSectionAppearance - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionAskQuestion(data json.RawMessage) (*SettingsSectionAskQuestion, error) { - var resp SettingsSectionAskQuestion - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionBusiness(data json.RawMessage) (*SettingsSectionBusiness, error) { - var resp SettingsSectionBusiness - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionChatFolders(data json.RawMessage) (*SettingsSectionChatFolders, error) { - var resp SettingsSectionChatFolders - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionDataAndStorage(data json.RawMessage) (*SettingsSectionDataAndStorage, error) { - var resp SettingsSectionDataAndStorage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionDevices(data json.RawMessage) (*SettingsSectionDevices, error) { - var resp SettingsSectionDevices - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionEditProfile(data json.RawMessage) (*SettingsSectionEditProfile, error) { - var resp SettingsSectionEditProfile - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionFaq(data json.RawMessage) (*SettingsSectionFaq, error) { - var resp SettingsSectionFaq - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionFeatures(data json.RawMessage) (*SettingsSectionFeatures, error) { - var resp SettingsSectionFeatures - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionInAppBrowser(data json.RawMessage) (*SettingsSectionInAppBrowser, error) { - var resp SettingsSectionInAppBrowser - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionLanguage(data json.RawMessage) (*SettingsSectionLanguage, error) { - var resp SettingsSectionLanguage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionMyStars(data json.RawMessage) (*SettingsSectionMyStars, error) { - var resp SettingsSectionMyStars - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionMyToncoins(data json.RawMessage) (*SettingsSectionMyToncoins, error) { - var resp SettingsSectionMyToncoins - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionNotifications(data json.RawMessage) (*SettingsSectionNotifications, error) { - var resp SettingsSectionNotifications - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionPowerSaving(data json.RawMessage) (*SettingsSectionPowerSaving, error) { - var resp SettingsSectionPowerSaving - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionPremium(data json.RawMessage) (*SettingsSectionPremium, error) { - var resp SettingsSectionPremium - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionPrivacyAndSecurity(data json.RawMessage) (*SettingsSectionPrivacyAndSecurity, error) { - var resp SettingsSectionPrivacyAndSecurity - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionPrivacyPolicy(data json.RawMessage) (*SettingsSectionPrivacyPolicy, error) { - var resp SettingsSectionPrivacyPolicy - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionQrCode(data json.RawMessage) (*SettingsSectionQrCode, error) { - var resp SettingsSectionQrCode - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionSearch(data json.RawMessage) (*SettingsSectionSearch, error) { - var resp SettingsSectionSearch - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalSettingsSectionSendGift(data json.RawMessage) (*SettingsSectionSendGift, error) { - var resp SettingsSectionSendGift +func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLinkTypeActiveSessions, error) { + var resp InternalLinkTypeActiveSessions err := json.Unmarshal(data, &resp) @@ -22692,8 +19632,16 @@ func UnmarshalInternalLinkTypeBusinessChat(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeCallsPage(data json.RawMessage) (*InternalLinkTypeCallsPage, error) { - var resp InternalLinkTypeCallsPage +func UnmarshalInternalLinkTypeBuyStars(data json.RawMessage) (*InternalLinkTypeBuyStars, error) { + var resp InternalLinkTypeBuyStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) { + var resp InternalLinkTypeChangePhoneNumber err := json.Unmarshal(data, &resp) @@ -22724,6 +19672,14 @@ func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeChatFolderSettings(data json.RawMessage) (*InternalLinkTypeChatFolderSettings, error) { + var resp InternalLinkTypeChatFolderSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTypeChatInvite, error) { var resp InternalLinkTypeChatInvite @@ -22732,24 +19688,16 @@ func UnmarshalInternalLinkTypeChatInvite(data json.RawMessage) (*InternalLinkTyp return &resp, err } -func UnmarshalInternalLinkTypeChatSelection(data json.RawMessage) (*InternalLinkTypeChatSelection, error) { - var resp InternalLinkTypeChatSelection +func UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data json.RawMessage) (*InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, error) { + var resp InternalLinkTypeDefaultMessageAutoDeleteTimerSettings err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalInternalLinkTypeContactsPage(data json.RawMessage) (*InternalLinkTypeContactsPage, error) { - var resp InternalLinkTypeContactsPage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeDirectMessagesChat(data json.RawMessage) (*InternalLinkTypeDirectMessagesChat, error) { - var resp InternalLinkTypeDirectMessagesChat +func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*InternalLinkTypeEditProfileSettings, error) { + var resp InternalLinkTypeEditProfileSettings err := json.Unmarshal(data, &resp) @@ -22764,30 +19712,6 @@ 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 - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeGroupCall(data json.RawMessage) (*InternalLinkTypeGroupCall, error) { - var resp InternalLinkTypeGroupCall - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeInstantView(data json.RawMessage) (*InternalLinkTypeInstantView, error) { var resp InternalLinkTypeInstantView @@ -22812,8 +19736,8 @@ func UnmarshalInternalLinkTypeLanguagePack(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeLiveStory(data json.RawMessage) (*InternalLinkTypeLiveStory, error) { - var resp InternalLinkTypeLiveStory +func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalLinkTypeLanguageSettings, error) { + var resp InternalLinkTypeLanguageSettings err := json.Unmarshal(data, &resp) @@ -22844,46 +19768,6 @@ func UnmarshalInternalLinkTypeMessageDraft(data json.RawMessage) (*InternalLinkT return &resp, err } -func UnmarshalInternalLinkTypeMyProfilePage(data json.RawMessage) (*InternalLinkTypeMyProfilePage, error) { - var resp InternalLinkTypeMyProfilePage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeNewChannelChat(data json.RawMessage) (*InternalLinkTypeNewChannelChat, error) { - var resp InternalLinkTypeNewChannelChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeNewGroupChat(data json.RawMessage) (*InternalLinkTypeNewGroupChat, error) { - var resp InternalLinkTypeNewGroupChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeNewPrivateChat(data json.RawMessage) (*InternalLinkTypeNewPrivateChat, error) { - var resp InternalLinkTypeNewPrivateChat - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeNewStory(data json.RawMessage) (*InternalLinkTypeNewStory, error) { - var resp InternalLinkTypeNewStory - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypePassportDataRequest(data json.RawMessage) (*InternalLinkTypePassportDataRequest, error) { var resp InternalLinkTypePassportDataRequest @@ -22900,8 +19784,16 @@ func UnmarshalInternalLinkTypePhoneNumberConfirmation(data json.RawMessage) (*In return &resp, err } -func UnmarshalInternalLinkTypePremiumFeaturesPage(data json.RawMessage) (*InternalLinkTypePremiumFeaturesPage, error) { - var resp InternalLinkTypePremiumFeaturesPage +func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLinkTypePremiumFeatures, error) { + var resp InternalLinkTypePremiumFeatures + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) { + var resp InternalLinkTypePremiumGift err := json.Unmarshal(data, &resp) @@ -22916,8 +19808,8 @@ func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLi return &resp, err } -func UnmarshalInternalLinkTypePremiumGiftPurchase(data json.RawMessage) (*InternalLinkTypePremiumGiftPurchase, error) { - var resp InternalLinkTypePremiumGiftPurchase +func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { + var resp InternalLinkTypePrivacyAndSecuritySettings err := json.Unmarshal(data, &resp) @@ -22956,22 +19848,6 @@ func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalL return &resp, err } -func UnmarshalInternalLinkTypeSavedMessages(data json.RawMessage) (*InternalLinkTypeSavedMessages, error) { - var resp InternalLinkTypeSavedMessages - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalInternalLinkTypeSearch(data json.RawMessage) (*InternalLinkTypeSearch, error) { - var resp InternalLinkTypeSearch - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { var resp InternalLinkTypeSettings @@ -22980,14 +19856,6 @@ func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeS return &resp, err } -func UnmarshalInternalLinkTypeStarPurchase(data json.RawMessage) (*InternalLinkTypeStarPurchase, error) { - var resp InternalLinkTypeStarPurchase - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { var resp InternalLinkTypeStickerSet @@ -23004,14 +19872,6 @@ func UnmarshalInternalLinkTypeStory(data json.RawMessage) (*InternalLinkTypeStor return &resp, err } -func UnmarshalInternalLinkTypeStoryAlbum(data json.RawMessage) (*InternalLinkTypeStoryAlbum, error) { - var resp InternalLinkTypeStoryAlbum - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { var resp InternalLinkTypeTheme @@ -23020,6 +19880,14 @@ func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeThem return &resp, err } +func UnmarshalInternalLinkTypeThemeSettings(data json.RawMessage) (*InternalLinkTypeThemeSettings, error) { + var resp InternalLinkTypeThemeSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLinkTypeUnknownDeepLink, error) { var resp InternalLinkTypeUnknownDeepLink @@ -23028,6 +19896,14 @@ func UnmarshalInternalLinkTypeUnknownDeepLink(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalLinkTypeUnsupportedProxy, error) { + var resp InternalLinkTypeUnsupportedProxy + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeUpgradedGift(data json.RawMessage) (*InternalLinkTypeUpgradedGift, error) { var resp InternalLinkTypeUpgradedGift @@ -23116,6 +19992,14 @@ func UnmarshalBlockListStories(data json.RawMessage) (*BlockListStories, error) return &resp, err } +func UnmarshalFilePart(data json.RawMessage) (*FilePart, error) { + var resp FilePart + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeNone(data json.RawMessage) (*FileTypeNone, error) { var resp FileTypeNone @@ -23516,14 +20400,6 @@ func UnmarshalConnectionStateReady(data json.RawMessage) (*ConnectionStateReady, return &resp, err } -func UnmarshalAgeVerificationParameters(data json.RawMessage) (*AgeVerificationParameters, error) { - var resp AgeVerificationParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalTopChatCategoryUsers(data json.RawMessage) (*TopChatCategoryUsers, error) { var resp TopChatCategoryUsers @@ -23764,30 +20640,6 @@ func UnmarshalSuggestedActionExtendStarSubscriptions(data json.RawMessage) (*Sug return &resp, err } -func UnmarshalSuggestedActionCustom(data json.RawMessage) (*SuggestedActionCustom, error) { - var resp SuggestedActionCustom - - err := json.Unmarshal(data, &resp) - - 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 @@ -23804,14 +20656,6 @@ func UnmarshalText(data json.RawMessage) (*Text, error) { return &resp, err } -func UnmarshalData(data json.RawMessage) (*Data, error) { - var resp Data - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalSeconds(data json.RawMessage) (*Seconds, error) { var resp Seconds @@ -23884,16 +20728,16 @@ func UnmarshalProxyTypeMtproto(data json.RawMessage) (*ProxyTypeMtproto, error) return &resp, err } -func UnmarshalAddedProxy(data json.RawMessage) (*AddedProxy, error) { - var resp AddedProxy +func UnmarshalProxy(data json.RawMessage) (*Proxy, error) { + var resp Proxy err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalAddedProxies(data json.RawMessage) (*AddedProxies, error) { - var resp AddedProxies +func UnmarshalProxies(data json.RawMessage) (*Proxies, error) { + var resp Proxies err := json.Unmarshal(data, &resp) @@ -24068,40 +20912,24 @@ func UnmarshalRevenueWithdrawalStateFailed(data json.RawMessage) (*RevenueWithdr return &resp, err } -func UnmarshalChatRevenueTransactionTypeUnsupported(data json.RawMessage) (*ChatRevenueTransactionTypeUnsupported, error) { - var resp ChatRevenueTransactionTypeUnsupported +func UnmarshalChatRevenueTransactionTypeEarnings(data json.RawMessage) (*ChatRevenueTransactionTypeEarnings, error) { + var resp ChatRevenueTransactionTypeEarnings err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatRevenueTransactionTypeSponsoredMessageEarnings(data json.RawMessage) (*ChatRevenueTransactionTypeSponsoredMessageEarnings, error) { - var resp ChatRevenueTransactionTypeSponsoredMessageEarnings +func UnmarshalChatRevenueTransactionTypeWithdrawal(data json.RawMessage) (*ChatRevenueTransactionTypeWithdrawal, error) { + var resp ChatRevenueTransactionTypeWithdrawal err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatRevenueTransactionTypeSuggestedPostEarnings(data json.RawMessage) (*ChatRevenueTransactionTypeSuggestedPostEarnings, error) { - var resp ChatRevenueTransactionTypeSuggestedPostEarnings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatRevenueTransactionTypeFragmentWithdrawal(data json.RawMessage) (*ChatRevenueTransactionTypeFragmentWithdrawal, error) { - var resp ChatRevenueTransactionTypeFragmentWithdrawal - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalChatRevenueTransactionTypeFragmentRefund(data json.RawMessage) (*ChatRevenueTransactionTypeFragmentRefund, error) { - var resp ChatRevenueTransactionTypeFragmentRefund +func UnmarshalChatRevenueTransactionTypeRefund(data json.RawMessage) (*ChatRevenueTransactionTypeRefund, error) { + var resp ChatRevenueTransactionTypeRefund err := json.Unmarshal(data, &resp) @@ -24140,22 +20968,6 @@ func UnmarshalStarRevenueStatistics(data json.RawMessage) (*StarRevenueStatistic return &resp, err } -func UnmarshalTonRevenueStatus(data json.RawMessage) (*TonRevenueStatus, error) { - var resp TonRevenueStatus - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalTonRevenueStatistics(data json.RawMessage) (*TonRevenueStatistics, error) { - var resp TonRevenueStatistics - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalPoint(data json.RawMessage) (*Point, error) { var resp Point @@ -24364,14 +21176,6 @@ func UnmarshalUpdateMessageFactCheck(data json.RawMessage) (*UpdateMessageFactCh return &resp, err } -func UnmarshalUpdateMessageSuggestedPostInfo(data json.RawMessage) (*UpdateMessageSuggestedPostInfo, error) { - var resp UpdateMessageSuggestedPostInfo - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMessageLiveLocationViewed, error) { var resp UpdateMessageLiveLocationViewed @@ -24684,22 +21488,6 @@ func UnmarshalUpdateSavedMessagesTopicCount(data json.RawMessage) (*UpdateSavedM return &resp, err } -func UnmarshalUpdateDirectMessagesChatTopic(data json.RawMessage) (*UpdateDirectMessagesChatTopic, error) { - var resp UpdateDirectMessagesChatTopic - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateTopicMessageCount(data json.RawMessage) (*UpdateTopicMessageCount, error) { - var resp UpdateTopicMessageCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateQuickReplyShortcut(data json.RawMessage) (*UpdateQuickReplyShortcut, error) { var resp UpdateQuickReplyShortcut @@ -24812,14 +21600,6 @@ func UnmarshalUpdateChatAction(data json.RawMessage) (*UpdateChatAction, error) return &resp, err } -func UnmarshalUpdatePendingTextMessage(data json.RawMessage) (*UpdatePendingTextMessage, error) { - var resp UpdatePendingTextMessage - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateUserStatus(data json.RawMessage) (*UpdateUserStatus, error) { var resp UpdateUserStatus @@ -24988,62 +21768,6 @@ func UnmarshalUpdateGroupCallParticipant(data json.RawMessage) (*UpdateGroupCall return &resp, err } -func UnmarshalUpdateGroupCallParticipants(data json.RawMessage) (*UpdateGroupCallParticipants, error) { - var resp UpdateGroupCallParticipants - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalUpdateGroupCallVerificationState(data json.RawMessage) (*UpdateGroupCallVerificationState, error) { - var resp UpdateGroupCallVerificationState - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -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) - - return &resp, err -} - func UnmarshalUpdateNewCallSignalingData(data json.RawMessage) (*UpdateNewCallSignalingData, error) { var resp UpdateNewCallSignalingData @@ -25052,22 +21776,6 @@ 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 @@ -25108,16 +21816,16 @@ func UnmarshalUpdateStoryDeleted(data json.RawMessage) (*UpdateStoryDeleted, err return &resp, err } -func UnmarshalUpdateStoryPostSucceeded(data json.RawMessage) (*UpdateStoryPostSucceeded, error) { - var resp UpdateStoryPostSucceeded +func UnmarshalUpdateStorySendSucceeded(data json.RawMessage) (*UpdateStorySendSucceeded, error) { + var resp UpdateStorySendSucceeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalUpdateStoryPostFailed(data json.RawMessage) (*UpdateStoryPostFailed, error) { - var resp UpdateStoryPostFailed +func UnmarshalUpdateStorySendFailed(data json.RawMessage) (*UpdateStorySendFailed, error) { + var resp UpdateStorySendFailed err := json.Unmarshal(data, &resp) @@ -25148,14 +21856,6 @@ 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 @@ -25228,8 +21928,8 @@ func UnmarshalUpdateDefaultBackground(data json.RawMessage) (*UpdateDefaultBackg return &resp, err } -func UnmarshalUpdateEmojiChatThemes(data json.RawMessage) (*UpdateEmojiChatThemes, error) { - var resp UpdateEmojiChatThemes +func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) { + var resp UpdateChatThemes err := json.Unmarshal(data, &resp) @@ -25276,14 +21976,6 @@ func UnmarshalUpdateFreezeState(data json.RawMessage) (*UpdateFreezeState, error return &resp, err } -func UnmarshalUpdateAgeVerificationParameters(data json.RawMessage) (*UpdateAgeVerificationParameters, error) { - var resp UpdateAgeVerificationParameters - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService, error) { var resp UpdateTermsOfService @@ -25372,14 +22064,6 @@ func UnmarshalUpdateOwnedStarCount(data json.RawMessage) (*UpdateOwnedStarCount, return &resp, err } -func UnmarshalUpdateOwnedTonCount(data json.RawMessage) (*UpdateOwnedTonCount, error) { - var resp UpdateOwnedTonCount - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateChatRevenueAmount(data json.RawMessage) (*UpdateChatRevenueAmount, error) { var resp UpdateChatRevenueAmount @@ -25396,14 +22080,6 @@ func UnmarshalUpdateStarRevenueStatus(data json.RawMessage) (*UpdateStarRevenueS return &resp, err } -func UnmarshalUpdateTonRevenueStatus(data json.RawMessage) (*UpdateTonRevenueStatus, error) { - var resp UpdateTonRevenueStatus - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) { var resp UpdateSpeechRecognitionTrial @@ -25412,14 +22088,6 @@ 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 @@ -25428,14 +22096,6 @@ 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 @@ -25842,12 +22502,6 @@ 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) @@ -26010,27 +22664,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePollTypeQuiz: return UnmarshalPollTypeQuiz(data) - case TypeChecklistTask: - return UnmarshalChecklistTask(data) - - case TypeInputChecklistTask: - return UnmarshalInputChecklistTask(data) - - case TypeChecklist: - return UnmarshalChecklist(data) - - case TypeInputChecklist: - return UnmarshalInputChecklist(data) - case TypeAnimation: return UnmarshalAnimation(data) case TypeAudio: return UnmarshalAudio(data) - case TypeAudios: - return UnmarshalAudios(data) - case TypeDocument: return UnmarshalDocument(data) @@ -26064,9 +22703,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGame: return UnmarshalGame(data) - case TypeStakeDiceState: - return UnmarshalStakeDiceState(data) - case TypeWebApp: return UnmarshalWebApp(data) @@ -26076,9 +22712,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAlternativeVideo: return UnmarshalAlternativeVideo(data) - case TypeVideoStoryboard: - return UnmarshalVideoStoryboard(data) - case TypeBackground: return UnmarshalBackground(data) @@ -26094,30 +22727,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatPhotoInfo: return UnmarshalChatPhotoInfo(data) - case TypeProfileTabPosts: - return UnmarshalProfileTabPosts(data) - - case TypeProfileTabGifts: - return UnmarshalProfileTabGifts(data) - - case TypeProfileTabMedia: - return UnmarshalProfileTabMedia(data) - - case TypeProfileTabFiles: - return UnmarshalProfileTabFiles(data) - - case TypeProfileTabLinks: - return UnmarshalProfileTabLinks(data) - - case TypeProfileTabMusic: - return UnmarshalProfileTabMusic(data) - - case TypeProfileTabVoice: - return UnmarshalProfileTabVoice(data) - - case TypeProfileTabGifs: - return UnmarshalProfileTabGifs(data) - case TypeUserTypeRegular: return UnmarshalUserTypeRegular(data) @@ -26247,48 +22856,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatAdministratorRights: return UnmarshalChatAdministratorRights(data) - case TypeGiftResalePriceStar: - return UnmarshalGiftResalePriceStar(data) - - 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) - - case TypeSuggestedPostPriceTon: - return UnmarshalSuggestedPostPriceTon(data) - - case TypeSuggestedPostStatePending: - return UnmarshalSuggestedPostStatePending(data) - - case TypeSuggestedPostStateApproved: - return UnmarshalSuggestedPostStateApproved(data) - - case TypeSuggestedPostStateDeclined: - return UnmarshalSuggestedPostStateDeclined(data) - - case TypeSuggestedPostInfo: - return UnmarshalSuggestedPostInfo(data) - - case TypeInputSuggestedPostInfo: - return UnmarshalInputSuggestedPostInfo(data) - - case TypeSuggestedPostRefundReasonPostDeleted: - return UnmarshalSuggestedPostRefundReasonPostDeleted(data) - - case TypeSuggestedPostRefundReasonPaymentRefunded: - return UnmarshalSuggestedPostRefundReasonPaymentRefunded(data) - case TypeStarAmount: return UnmarshalStarAmount(data) @@ -26391,66 +22958,6 @@ 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) - - case TypeGiftResaleParameters: - return UnmarshalGiftResaleParameters(data) - - case TypeGiftCollection: - return UnmarshalGiftCollection(data) - - case TypeGiftCollections: - return UnmarshalGiftCollections(data) - - case TypeCanSendGiftResultOk: - return UnmarshalCanSendGiftResultOk(data) - - case TypeCanSendGiftResultFail: - return UnmarshalCanSendGiftResultFail(data) - - case TypeUpgradedGiftOriginUpgrade: - return UnmarshalUpgradedGiftOriginUpgrade(data) - - case TypeUpgradedGiftOriginTransfer: - return UnmarshalUpgradedGiftOriginTransfer(data) - - case TypeUpgradedGiftOriginResale: - return UnmarshalUpgradedGiftOriginResale(data) - - case TypeUpgradedGiftOriginBlockchain: - return UnmarshalUpgradedGiftOriginBlockchain(data) - - case TypeUpgradedGiftOriginPrepaidUpgrade: - return UnmarshalUpgradedGiftOriginPrepaidUpgrade(data) - - case TypeUpgradedGiftOriginOffer: - return UnmarshalUpgradedGiftOriginOffer(data) - - case TypeUpgradedGiftOriginCraft: - return UnmarshalUpgradedGiftOriginCraft(data) - - case TypeUpgradedGiftAttributeRarityPerMille: - return UnmarshalUpgradedGiftAttributeRarityPerMille(data) - - case TypeUpgradedGiftAttributeRarityUncommon: - return UnmarshalUpgradedGiftAttributeRarityUncommon(data) - - case TypeUpgradedGiftAttributeRarityRare: - return UnmarshalUpgradedGiftAttributeRarityRare(data) - - case TypeUpgradedGiftAttributeRarityEpic: - return UnmarshalUpgradedGiftAttributeRarityEpic(data) - - case TypeUpgradedGiftAttributeRarityLegendary: - return UnmarshalUpgradedGiftAttributeRarityLegendary(data) - case TypeUpgradedGiftModel: return UnmarshalUpgradedGiftModel(data) @@ -26466,81 +22973,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpgradedGiftOriginalDetails: return UnmarshalUpgradedGiftOriginalDetails(data) - case TypeUpgradedGiftColors: - return UnmarshalUpgradedGiftColors(data) - case TypeGift: return UnmarshalGift(data) + case TypeGifts: + return UnmarshalGifts(data) + case TypeUpgradedGift: return UnmarshalUpgradedGift(data) - case TypeUpgradedGiftValueInfo: - return UnmarshalUpgradedGiftValueInfo(data) - case TypeUpgradeGiftResult: return UnmarshalUpgradeGiftResult(data) - case TypeCraftGiftResultSuccess: - return UnmarshalCraftGiftResultSuccess(data) - - case TypeCraftGiftResultTooEarly: - return UnmarshalCraftGiftResultTooEarly(data) - - case TypeCraftGiftResultInvalidGift: - return UnmarshalCraftGiftResultInvalidGift(data) - - case TypeCraftGiftResultFail: - return UnmarshalCraftGiftResultFail(data) - - case TypeAvailableGift: - return UnmarshalAvailableGift(data) - - case TypeAvailableGifts: - return UnmarshalAvailableGifts(data) - - case TypeGiftUpgradePrice: - return UnmarshalGiftUpgradePrice(data) - - case TypeUpgradedGiftAttributeIdModel: - return UnmarshalUpgradedGiftAttributeIdModel(data) - - case TypeUpgradedGiftAttributeIdSymbol: - return UnmarshalUpgradedGiftAttributeIdSymbol(data) - - case TypeUpgradedGiftAttributeIdBackdrop: - return UnmarshalUpgradedGiftAttributeIdBackdrop(data) - - case TypeUpgradedGiftModelCount: - return UnmarshalUpgradedGiftModelCount(data) - - case TypeUpgradedGiftSymbolCount: - return UnmarshalUpgradedGiftSymbolCount(data) - - case TypeUpgradedGiftBackdropCount: - return UnmarshalUpgradedGiftBackdropCount(data) - - case TypeGiftForResaleOrderPrice: - return UnmarshalGiftForResaleOrderPrice(data) - - case TypeGiftForResaleOrderPriceChangeDate: - return UnmarshalGiftForResaleOrderPriceChangeDate(data) - - case TypeGiftForResaleOrderNumber: - return UnmarshalGiftForResaleOrderNumber(data) - - case TypeGiftForResale: - return UnmarshalGiftForResale(data) - - case TypeGiftsForResale: - return UnmarshalGiftsForResale(data) - - case TypeGiftResaleResultOk: - return UnmarshalGiftResaleResultOk(data) - - case TypeGiftResaleResultPriceIncreased: - return UnmarshalGiftResaleResultPriceIncreased(data) - case TypeSentGiftRegular: return UnmarshalSentGiftRegular(data) @@ -26553,47 +22997,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReceivedGifts: return UnmarshalReceivedGifts(data) - case TypeAttributeCraftPersistenceProbability: - return UnmarshalAttributeCraftPersistenceProbability(data) - - case TypeGiftsForCrafting: - return UnmarshalGiftsForCrafting(data) - case TypeGiftUpgradePreview: return UnmarshalGiftUpgradePreview(data) - case TypeGiftUpgradeVariants: - return UnmarshalGiftUpgradeVariants(data) + case TypeStarTransactionDirectionIncoming: + return UnmarshalStarTransactionDirectionIncoming(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) - - case TypeTransactionDirectionOutgoing: - return UnmarshalTransactionDirectionOutgoing(data) + case TypeStarTransactionDirectionOutgoing: + return UnmarshalStarTransactionDirectionOutgoing(data) case TypeStarTransactionTypePremiumBotDeposit: return UnmarshalStarTransactionTypePremiumBotDeposit(data) @@ -26652,36 +23063,18 @@ 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) - case TypeStarTransactionTypeGiftOriginalDetailsDrop: - return UnmarshalStarTransactionTypeGiftOriginalDetailsDrop(data) - case TypeStarTransactionTypeGiftSale: return UnmarshalStarTransactionTypeGiftSale(data) case TypeStarTransactionTypeGiftUpgrade: return UnmarshalStarTransactionTypeGiftUpgrade(data) - case TypeStarTransactionTypeGiftUpgradePurchase: - return UnmarshalStarTransactionTypeGiftUpgradePurchase(data) - - case TypeStarTransactionTypeUpgradedGiftPurchase: - return UnmarshalStarTransactionTypeUpgradedGiftPurchase(data) - - case TypeStarTransactionTypeUpgradedGiftSale: - return UnmarshalStarTransactionTypeUpgradedGiftSale(data) - case TypeStarTransactionTypeChannelPaidReactionSend: return UnmarshalStarTransactionTypeChannelPaidReactionSend(data) @@ -26697,24 +23090,6 @@ 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) - - case TypeStarTransactionTypeSuggestedPostPaymentReceive: - return UnmarshalStarTransactionTypeSuggestedPostPaymentReceive(data) - case TypeStarTransactionTypePremiumPurchase: return UnmarshalStarTransactionTypePremiumPurchase(data) @@ -26724,9 +23099,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionTypeBusinessBotTransferReceive: return UnmarshalStarTransactionTypeBusinessBotTransferReceive(data) - case TypeStarTransactionTypePublicPostSearch: - return UnmarshalStarTransactionTypePublicPostSearch(data) - case TypeStarTransactionTypeUnsupported: return UnmarshalStarTransactionTypeUnsupported(data) @@ -26736,48 +23108,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactions: return UnmarshalStarTransactions(data) - 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) - - case TypeTonTransactionTypeUpgradedGiftSale: - return UnmarshalTonTransactionTypeUpgradedGiftSale(data) - - case TypeTonTransactionTypeStakeDiceStake: - return UnmarshalTonTransactionTypeStakeDiceStake(data) - - case TypeTonTransactionTypeStakeDicePayout: - return UnmarshalTonTransactionTypeStakeDicePayout(data) - - case TypeTonTransactionTypeUnsupported: - return UnmarshalTonTransactionTypeUnsupported(data) - - case TypeTonTransaction: - return UnmarshalTonTransaction(data) - - 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) @@ -26814,12 +23144,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProfileAccentColor: return UnmarshalProfileAccentColor(data) - case TypeUserRating: - return UnmarshalUserRating(data) - - case TypeRestrictionInfo: - return UnmarshalRestrictionInfo(data) - case TypeEmojiStatusTypeCustomEmoji: return UnmarshalEmojiStatusTypeCustomEmoji(data) @@ -26994,9 +23318,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSecretChat: return UnmarshalSecretChat(data) - case TypePublicPostSearchLimits: - return UnmarshalPublicPostSearchLimits(data) - case TypeMessageSenderUser: return UnmarshalMessageSenderUser(data) @@ -27069,9 +23390,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePaidReactor: return UnmarshalPaidReactor(data) - case TypeLiveStoryDonors: - return UnmarshalLiveStoryDonors(data) - case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) @@ -27093,18 +23411,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUnreadReaction: return UnmarshalUnreadReaction(data) - case TypeMessageTopicThread: - return UnmarshalMessageTopicThread(data) - - case TypeMessageTopicForum: - return UnmarshalMessageTopicForum(data) - - case TypeMessageTopicDirectMessages: - return UnmarshalMessageTopicDirectMessages(data) - - case TypeMessageTopicSavedMessages: - return UnmarshalMessageTopicSavedMessages(data) - case TypeMessageEffectTypeEmojiReaction: return UnmarshalMessageEffectTypeEmojiReaction(data) @@ -27156,9 +23462,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundChatMessages: return UnmarshalFoundChatMessages(data) - case TypeFoundPublicPosts: - return UnmarshalFoundPublicPosts(data) - case TypeMessagePosition: return UnmarshalMessagePosition(data) @@ -27186,9 +23489,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSourceForumTopicHistory: return UnmarshalMessageSourceForumTopicHistory(data) - case TypeMessageSourceDirectMessagesChatTopicHistory: - return UnmarshalMessageSourceDirectMessagesChatTopicHistory(data) - case TypeMessageSourceHistoryPreview: return UnmarshalMessageSourceHistoryPreview(data) @@ -27210,8 +23510,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSourceOther: return UnmarshalMessageSourceOther(data) - case TypeAdvertisementSponsor: - return UnmarshalAdvertisementSponsor(data) + case TypeMessageSponsor: + return UnmarshalMessageSponsor(data) case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) @@ -27225,12 +23525,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSponsoredChats: return UnmarshalSponsoredChats(data) - case TypeVideoMessageAdvertisement: - return UnmarshalVideoMessageAdvertisement(data) - - case TypeVideoMessageAdvertisements: - return UnmarshalVideoMessageAdvertisements(data) - case TypeReportOption: return UnmarshalReportOption(data) @@ -27411,18 +23705,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActionBarJoinRequest: return UnmarshalChatActionBarJoinRequest(data) - case TypeButtonStyleDefault: - return UnmarshalButtonStyleDefault(data) - - case TypeButtonStylePrimary: - return UnmarshalButtonStylePrimary(data) - - case TypeButtonStyleDanger: - return UnmarshalButtonStyleDanger(data) - - case TypeButtonStyleSuccess: - return UnmarshalButtonStyleSuccess(data) - case TypeKeyboardButtonTypeText: return UnmarshalKeyboardButtonTypeText(data) @@ -27537,9 +23819,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSavedMessagesTopic: return UnmarshalSavedMessagesTopic(data) - case TypeDirectMessagesChatTopic: - return UnmarshalDirectMessagesChatTopic(data) - case TypeForumTopicIcon: return UnmarshalForumTopicIcon(data) @@ -27561,21 +23840,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSharedChat: return UnmarshalSharedChat(data) - case TypeBuiltInThemeClassic: - return UnmarshalBuiltInThemeClassic(data) - - case TypeBuiltInThemeDay: - return UnmarshalBuiltInThemeDay(data) - - case TypeBuiltInThemeNight: - return UnmarshalBuiltInThemeNight(data) - - case TypeBuiltInThemeTinted: - return UnmarshalBuiltInThemeTinted(data) - - case TypeBuiltInThemeArctic: - return UnmarshalBuiltInThemeArctic(data) - case TypeThemeSettings: return UnmarshalThemeSettings(data) @@ -27780,9 +24044,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeChat: return UnmarshalLinkPreviewTypeChat(data) - case TypeLinkPreviewTypeDirectMessagesChat: - return UnmarshalLinkPreviewTypeDirectMessagesChat(data) - case TypeLinkPreviewTypeDocument: return UnmarshalLinkPreviewTypeDocument(data) @@ -27801,21 +24062,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeExternalVideo: return UnmarshalLinkPreviewTypeExternalVideo(data) - case TypeLinkPreviewTypeGiftAuction: - return UnmarshalLinkPreviewTypeGiftAuction(data) - - case TypeLinkPreviewTypeGiftCollection: - return UnmarshalLinkPreviewTypeGiftCollection(data) - - case TypeLinkPreviewTypeGroupCall: - return UnmarshalLinkPreviewTypeGroupCall(data) - case TypeLinkPreviewTypeInvoice: return UnmarshalLinkPreviewTypeInvoice(data) - case TypeLinkPreviewTypeLiveStory: - return UnmarshalLinkPreviewTypeLiveStory(data) - case TypeLinkPreviewTypeMessage: return UnmarshalLinkPreviewTypeMessage(data) @@ -27837,9 +24086,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypeStory: return UnmarshalLinkPreviewTypeStory(data) - case TypeLinkPreviewTypeStoryAlbum: - return UnmarshalLinkPreviewTypeStoryAlbum(data) - case TypeLinkPreviewTypeSupergroupBoost: return UnmarshalLinkPreviewTypeSupergroupBoost(data) @@ -28275,24 +24521,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) - case TypeMessageStakeDice: - return UnmarshalMessageStakeDice(data) - case TypeMessageStory: return UnmarshalMessageStory(data) - case TypeMessageChecklist: - return UnmarshalMessageChecklist(data) - case TypeMessageInvoice: return UnmarshalMessageInvoice(data) case TypeMessageCall: return UnmarshalMessageCall(data) - case TypeMessageGroupCall: - return UnmarshalMessageGroupCall(data) - case TypeMessageVideoChatScheduled: return UnmarshalMessageVideoChatScheduled(data) @@ -28320,12 +24557,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatDeletePhoto: return UnmarshalMessageChatDeletePhoto(data) - case TypeMessageChatOwnerLeft: - return UnmarshalMessageChatOwnerLeft(data) - - case TypeMessageChatOwnerChanged: - return UnmarshalMessageChatOwnerChanged(data) - case TypeMessageChatAddMembers: return UnmarshalMessageChatAddMembers(data) @@ -28377,9 +24608,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSuggestProfilePhoto: return UnmarshalMessageSuggestProfilePhoto(data) - case TypeMessageSuggestBirthdate: - return UnmarshalMessageSuggestBirthdate(data) - case TypeMessageCustomServiceAction: return UnmarshalMessageCustomServiceAction(data) @@ -28416,9 +24644,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageGiftedStars: return UnmarshalMessageGiftedStars(data) - case TypeMessageGiftedTon: - return UnmarshalMessageGiftedTon(data) - case TypeMessageGiveawayPrizeStars: return UnmarshalMessageGiveawayPrizeStars(data) @@ -28431,42 +24656,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) case TypeMessagePaidMessagePriceChanged: return UnmarshalMessagePaidMessagePriceChanged(data) - case TypeMessageDirectMessagePriceChanged: - return UnmarshalMessageDirectMessagePriceChanged(data) - - case TypeMessageChecklistTasksDone: - return UnmarshalMessageChecklistTasksDone(data) - - case TypeMessageChecklistTasksAdded: - return UnmarshalMessageChecklistTasksAdded(data) - - case TypeMessageSuggestedPostApprovalFailed: - return UnmarshalMessageSuggestedPostApprovalFailed(data) - - case TypeMessageSuggestedPostApproved: - return UnmarshalMessageSuggestedPostApproved(data) - - case TypeMessageSuggestedPostDeclined: - return UnmarshalMessageSuggestedPostDeclined(data) - - case TypeMessageSuggestedPostPaid: - return UnmarshalMessageSuggestedPostPaid(data) - - case TypeMessageSuggestedPostRefunded: - return UnmarshalMessageSuggestedPostRefunded(data) - case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -28647,15 +24842,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) - case TypeInputMessageStakeDice: - return UnmarshalInputMessageStakeDice(data) - case TypeInputMessageStory: return UnmarshalInputMessageStory(data) - case TypeInputMessageChecklist: - return UnmarshalInputMessageChecklist(data) - case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -28896,27 +25085,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryVideo: return UnmarshalStoryVideo(data) - case TypeStoryContentTypePhoto: - return UnmarshalStoryContentTypePhoto(data) - - case TypeStoryContentTypeVideo: - return UnmarshalStoryContentTypeVideo(data) - - case TypeStoryContentTypeLive: - return UnmarshalStoryContentTypeLive(data) - - case TypeStoryContentTypeUnsupported: - return UnmarshalStoryContentTypeUnsupported(data) - case TypeStoryContentPhoto: return UnmarshalStoryContentPhoto(data) case TypeStoryContentVideo: return UnmarshalStoryContentVideo(data) - case TypeStoryContentLive: - return UnmarshalStoryContentLive(data) - case TypeStoryContentUnsupported: return UnmarshalStoryContentUnsupported(data) @@ -28953,12 +25127,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFoundStories: return UnmarshalFoundStories(data) - case TypeStoryAlbum: - return UnmarshalStoryAlbum(data) - - case TypeStoryAlbums: - return UnmarshalStoryAlbums(data) - case TypeStoryFullId: return UnmarshalStoryFullId(data) @@ -29064,8 +25232,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallDiscardReasonHungUp: return UnmarshalCallDiscardReasonHungUp(data) - case TypeCallDiscardReasonUpgradeToGroupCall: - return UnmarshalCallDiscardReasonUpgradeToGroupCall(data) + case TypeCallDiscardReasonAllowGroupCall: + return UnmarshalCallDiscardReasonAllowGroupCall(data) case TypeCallProtocol: return UnmarshalCallProtocol(data) @@ -29103,9 +25271,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCallStateError: return UnmarshalCallStateError(data) - case TypeGroupCallJoinParameters: - return UnmarshalGroupCallJoinParameters(data) - case TypeGroupCallVideoQualityThumbnail: return UnmarshalGroupCallVideoQualityThumbnail(data) @@ -29139,42 +25304,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeGroupCallParticipant: return UnmarshalGroupCallParticipant(data) - case TypeGroupCallParticipants: - return UnmarshalGroupCallParticipants(data) - - case TypeGroupCallInfo: - return UnmarshalGroupCallInfo(data) - - case TypeGroupCallMessage: - return UnmarshalGroupCallMessage(data) - - case TypeGroupCallMessageLevel: - return UnmarshalGroupCallMessageLevel(data) - - case TypeInviteGroupCallParticipantResultUserPrivacyRestricted: - return UnmarshalInviteGroupCallParticipantResultUserPrivacyRestricted(data) - - case TypeInviteGroupCallParticipantResultUserAlreadyParticipant: - return UnmarshalInviteGroupCallParticipantResultUserAlreadyParticipant(data) - - case TypeInviteGroupCallParticipantResultUserWasBanned: - return UnmarshalInviteGroupCallParticipantResultUserWasBanned(data) - - case TypeInviteGroupCallParticipantResultSuccess: - return UnmarshalInviteGroupCallParticipantResultSuccess(data) - - case TypeGroupCallDataChannelMain: - return UnmarshalGroupCallDataChannelMain(data) - - case TypeGroupCallDataChannelScreenSharing: - return UnmarshalGroupCallDataChannelScreenSharing(data) - - case TypeInputGroupCallLink: - return UnmarshalInputGroupCallLink(data) - - case TypeInputGroupCallMessage: - return UnmarshalInputGroupCallMessage(data) - case TypeCallProblemEcho: return UnmarshalCallProblemEcho(data) @@ -29244,9 +25373,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeDiceStickersSlotMachine: return UnmarshalDiceStickersSlotMachine(data) - case TypeImportedContact: - return UnmarshalImportedContact(data) - case TypeImportedContacts: return UnmarshalImportedContacts(data) @@ -29520,9 +25646,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventShowMessageSenderToggled: return UnmarshalChatEventShowMessageSenderToggled(data) - case TypeChatEventAutomaticTranslationToggled: - return UnmarshalChatEventAutomaticTranslationToggled(data) - case TypeChatEventInviteLinkEdited: return UnmarshalChatEventInviteLinkEdited(data) @@ -29640,11 +25763,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeActiveStoryCount: return UnmarshalPremiumLimitTypeActiveStoryCount(data) - case TypePremiumLimitTypeWeeklyPostedStoryCount: - return UnmarshalPremiumLimitTypeWeeklyPostedStoryCount(data) + case TypePremiumLimitTypeWeeklySentStoryCount: + return UnmarshalPremiumLimitTypeWeeklySentStoryCount(data) - case TypePremiumLimitTypeMonthlyPostedStoryCount: - return UnmarshalPremiumLimitTypeMonthlyPostedStoryCount(data) + case TypePremiumLimitTypeMonthlySentStoryCount: + return UnmarshalPremiumLimitTypeMonthlySentStoryCount(data) case TypePremiumLimitTypeStoryCaptionLength: return UnmarshalPremiumLimitTypeStoryCaptionLength(data) @@ -29727,12 +25850,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureMessageEffects: return UnmarshalPremiumFeatureMessageEffects(data) - case TypePremiumFeatureChecklists: - return UnmarshalPremiumFeatureChecklists(data) - - case TypePremiumFeaturePaidMessages: - return UnmarshalPremiumFeaturePaidMessages(data) - case TypeBusinessFeatureLocation: return UnmarshalBusinessFeatureLocation(data) @@ -29940,26 +26057,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputBackgroundPrevious: return UnmarshalInputBackgroundPrevious(data) - case TypeEmojiChatTheme: - return UnmarshalEmojiChatTheme(data) - - case TypeGiftChatTheme: - return UnmarshalGiftChatTheme(data) - - case TypeGiftChatThemes: - return UnmarshalGiftChatThemes(data) - - case TypeChatThemeEmoji: - return UnmarshalChatThemeEmoji(data) - - case TypeChatThemeGift: - return UnmarshalChatThemeGift(data) - - case TypeInputChatThemeEmoji: - return UnmarshalInputChatThemeEmoji(data) - - case TypeInputChatThemeGift: - return UnmarshalInputChatThemeGift(data) + case TypeChatTheme: + return UnmarshalChatTheme(data) case TypeTimeZone: return UnmarshalTimeZone(data) @@ -29970,32 +26069,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeHashtags: return UnmarshalHashtags(data) - case TypeCanPostStoryResultOk: - return UnmarshalCanPostStoryResultOk(data) + case TypeCanSendStoryResultOk: + return UnmarshalCanSendStoryResultOk(data) - case TypeCanPostStoryResultPremiumNeeded: - return UnmarshalCanPostStoryResultPremiumNeeded(data) + case TypeCanSendStoryResultPremiumNeeded: + return UnmarshalCanSendStoryResultPremiumNeeded(data) - case TypeCanPostStoryResultBoostNeeded: - return UnmarshalCanPostStoryResultBoostNeeded(data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) - case TypeCanPostStoryResultActiveStoryLimitExceeded: - return UnmarshalCanPostStoryResultActiveStoryLimitExceeded(data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: + return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) - case TypeCanPostStoryResultWeeklyLimitExceeded: - return UnmarshalCanPostStoryResultWeeklyLimitExceeded(data) + case TypeCanSendStoryResultWeeklyLimitExceeded: + return UnmarshalCanSendStoryResultWeeklyLimitExceeded(data) - case TypeCanPostStoryResultMonthlyLimitExceeded: - return UnmarshalCanPostStoryResultMonthlyLimitExceeded(data) - - case TypeCanPostStoryResultLiveStoryIsActive: - return UnmarshalCanPostStoryResultLiveStoryIsActive(data) - - case TypeStartLiveStoryResultOk: - return UnmarshalStartLiveStoryResultOk(data) - - case TypeStartLiveStoryResultFail: - return UnmarshalStartLiveStoryResultFail(data) + case TypeCanSendStoryResultMonthlyLimitExceeded: + return UnmarshalCanSendStoryResultMonthlyLimitExceeded(data) case TypeCanTransferOwnershipResultOk: return UnmarshalCanTransferOwnershipResultOk(data) @@ -30117,9 +26207,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) - case TypePushMessageContentChecklist: - return UnmarshalPushMessageContentChecklist(data) - case TypePushMessageContentVideo: return UnmarshalPushMessageContentVideo(data) @@ -30171,18 +26258,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentSuggestProfilePhoto: return UnmarshalPushMessageContentSuggestProfilePhoto(data) - case TypePushMessageContentSuggestBirthdate: - return UnmarshalPushMessageContentSuggestBirthdate(data) - case TypePushMessageContentProximityAlertTriggered: return UnmarshalPushMessageContentProximityAlertTriggered(data) - case TypePushMessageContentChecklistTasksAdded: - return UnmarshalPushMessageContentChecklistTasksAdded(data) - - case TypePushMessageContentChecklistTasksDone: - return UnmarshalPushMessageContentChecklistTasksDone(data) - case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -30225,9 +26303,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeNotificationGroup: return UnmarshalNotificationGroup(data) - case TypeProxy: - return UnmarshalProxy(data) - case TypeOptionValueBoolean: return UnmarshalOptionValueBoolean(data) @@ -30327,9 +26402,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowBirthdate: return UnmarshalUserPrivacySettingShowBirthdate(data) - case TypeUserPrivacySettingShowProfileAudio: - return UnmarshalUserPrivacySettingShowProfileAudio(data) - case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -30492,68 +26564,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeReportStoryResultTextRequired: return UnmarshalReportStoryResultTextRequired(data) - case TypeSettingsSectionAppearance: - return UnmarshalSettingsSectionAppearance(data) - - case TypeSettingsSectionAskQuestion: - return UnmarshalSettingsSectionAskQuestion(data) - - case TypeSettingsSectionBusiness: - return UnmarshalSettingsSectionBusiness(data) - - case TypeSettingsSectionChatFolders: - return UnmarshalSettingsSectionChatFolders(data) - - case TypeSettingsSectionDataAndStorage: - return UnmarshalSettingsSectionDataAndStorage(data) - - case TypeSettingsSectionDevices: - return UnmarshalSettingsSectionDevices(data) - - case TypeSettingsSectionEditProfile: - return UnmarshalSettingsSectionEditProfile(data) - - case TypeSettingsSectionFaq: - return UnmarshalSettingsSectionFaq(data) - - case TypeSettingsSectionFeatures: - return UnmarshalSettingsSectionFeatures(data) - - case TypeSettingsSectionInAppBrowser: - return UnmarshalSettingsSectionInAppBrowser(data) - - case TypeSettingsSectionLanguage: - return UnmarshalSettingsSectionLanguage(data) - - case TypeSettingsSectionMyStars: - return UnmarshalSettingsSectionMyStars(data) - - case TypeSettingsSectionMyToncoins: - return UnmarshalSettingsSectionMyToncoins(data) - - case TypeSettingsSectionNotifications: - return UnmarshalSettingsSectionNotifications(data) - - case TypeSettingsSectionPowerSaving: - return UnmarshalSettingsSectionPowerSaving(data) - - case TypeSettingsSectionPremium: - return UnmarshalSettingsSectionPremium(data) - - case TypeSettingsSectionPrivacyAndSecurity: - return UnmarshalSettingsSectionPrivacyAndSecurity(data) - - case TypeSettingsSectionPrivacyPolicy: - return UnmarshalSettingsSectionPrivacyPolicy(data) - - case TypeSettingsSectionQrCode: - return UnmarshalSettingsSectionQrCode(data) - - case TypeSettingsSectionSearch: - return UnmarshalSettingsSectionSearch(data) - - case TypeSettingsSectionSendGift: - return UnmarshalSettingsSectionSendGift(data) + case TypeInternalLinkTypeActiveSessions: + return UnmarshalInternalLinkTypeActiveSessions(data) case TypeInternalLinkTypeAttachmentMenuBot: return UnmarshalInternalLinkTypeAttachmentMenuBot(data) @@ -30576,8 +26588,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeBusinessChat: return UnmarshalInternalLinkTypeBusinessChat(data) - case TypeInternalLinkTypeCallsPage: - return UnmarshalInternalLinkTypeCallsPage(data) + case TypeInternalLinkTypeBuyStars: + return UnmarshalInternalLinkTypeBuyStars(data) + + case TypeInternalLinkTypeChangePhoneNumber: + return UnmarshalInternalLinkTypeChangePhoneNumber(data) case TypeInternalLinkTypeChatAffiliateProgram: return UnmarshalInternalLinkTypeChatAffiliateProgram(data) @@ -30588,30 +26603,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) - case TypeInternalLinkTypeChatSelection: - return UnmarshalInternalLinkTypeChatSelection(data) + case TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings: + return UnmarshalInternalLinkTypeDefaultMessageAutoDeleteTimerSettings(data) - case TypeInternalLinkTypeContactsPage: - return UnmarshalInternalLinkTypeContactsPage(data) - - case TypeInternalLinkTypeDirectMessagesChat: - return UnmarshalInternalLinkTypeDirectMessagesChat(data) + case TypeInternalLinkTypeEditProfileSettings: + return UnmarshalInternalLinkTypeEditProfileSettings(data) case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) - case TypeInternalLinkTypeGiftAuction: - return UnmarshalInternalLinkTypeGiftAuction(data) - - case TypeInternalLinkTypeGiftCollection: - return UnmarshalInternalLinkTypeGiftCollection(data) - - case TypeInternalLinkTypeGroupCall: - return UnmarshalInternalLinkTypeGroupCall(data) - case TypeInternalLinkTypeInstantView: return UnmarshalInternalLinkTypeInstantView(data) @@ -30621,8 +26627,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguagePack: return UnmarshalInternalLinkTypeLanguagePack(data) - case TypeInternalLinkTypeLiveStory: - return UnmarshalInternalLinkTypeLiveStory(data) + case TypeInternalLinkTypeLanguageSettings: + return UnmarshalInternalLinkTypeLanguageSettings(data) case TypeInternalLinkTypeMainWebApp: return UnmarshalInternalLinkTypeMainWebApp(data) @@ -30633,35 +26639,23 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeMessageDraft: return UnmarshalInternalLinkTypeMessageDraft(data) - case TypeInternalLinkTypeMyProfilePage: - return UnmarshalInternalLinkTypeMyProfilePage(data) - - case TypeInternalLinkTypeNewChannelChat: - return UnmarshalInternalLinkTypeNewChannelChat(data) - - case TypeInternalLinkTypeNewGroupChat: - return UnmarshalInternalLinkTypeNewGroupChat(data) - - case TypeInternalLinkTypeNewPrivateChat: - return UnmarshalInternalLinkTypeNewPrivateChat(data) - - case TypeInternalLinkTypeNewStory: - return UnmarshalInternalLinkTypeNewStory(data) - case TypeInternalLinkTypePassportDataRequest: return UnmarshalInternalLinkTypePassportDataRequest(data) case TypeInternalLinkTypePhoneNumberConfirmation: return UnmarshalInternalLinkTypePhoneNumberConfirmation(data) - case TypeInternalLinkTypePremiumFeaturesPage: - return UnmarshalInternalLinkTypePremiumFeaturesPage(data) + case TypeInternalLinkTypePremiumFeatures: + return UnmarshalInternalLinkTypePremiumFeatures(data) + + case TypeInternalLinkTypePremiumGift: + return UnmarshalInternalLinkTypePremiumGift(data) case TypeInternalLinkTypePremiumGiftCode: return UnmarshalInternalLinkTypePremiumGiftCode(data) - case TypeInternalLinkTypePremiumGiftPurchase: - return UnmarshalInternalLinkTypePremiumGiftPurchase(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: + return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) case TypeInternalLinkTypeProxy: return UnmarshalInternalLinkTypeProxy(data) @@ -30675,33 +26669,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) - case TypeInternalLinkTypeSavedMessages: - return UnmarshalInternalLinkTypeSavedMessages(data) - - case TypeInternalLinkTypeSearch: - return UnmarshalInternalLinkTypeSearch(data) - case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) - case TypeInternalLinkTypeStarPurchase: - return UnmarshalInternalLinkTypeStarPurchase(data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) case TypeInternalLinkTypeStory: return UnmarshalInternalLinkTypeStory(data) - case TypeInternalLinkTypeStoryAlbum: - return UnmarshalInternalLinkTypeStoryAlbum(data) - case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) + case TypeInternalLinkTypeThemeSettings: + return UnmarshalInternalLinkTypeThemeSettings(data) + case TypeInternalLinkTypeUnknownDeepLink: return UnmarshalInternalLinkTypeUnknownDeepLink(data) + case TypeInternalLinkTypeUnsupportedProxy: + return UnmarshalInternalLinkTypeUnsupportedProxy(data) + case TypeInternalLinkTypeUpgradedGift: return UnmarshalInternalLinkTypeUpgradedGift(data) @@ -30735,6 +26723,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBlockListStories: return UnmarshalBlockListStories(data) + case TypeFilePart: + return UnmarshalFilePart(data) + case TypeFileTypeNone: return UnmarshalFileTypeNone(data) @@ -30885,9 +26876,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeConnectionStateReady: return UnmarshalConnectionStateReady(data) - case TypeAgeVerificationParameters: - return UnmarshalAgeVerificationParameters(data) - case TypeTopChatCategoryUsers: return UnmarshalTopChatCategoryUsers(data) @@ -30978,24 +26966,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionExtendStarSubscriptions: return UnmarshalSuggestedActionExtendStarSubscriptions(data) - case TypeSuggestedActionCustom: - return UnmarshalSuggestedActionCustom(data) - - case TypeSuggestedActionSetLoginEmailAddress: - return UnmarshalSuggestedActionSetLoginEmailAddress(data) - - case TypeSuggestedActionAddLoginPasskey: - return UnmarshalSuggestedActionAddLoginPasskey(data) - case TypeCount: return UnmarshalCount(data) case TypeText: return UnmarshalText(data) - case TypeData: - return UnmarshalData(data) - case TypeSeconds: return UnmarshalSeconds(data) @@ -31023,11 +26999,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeProxyTypeMtproto: return UnmarshalProxyTypeMtproto(data) - case TypeAddedProxy: - return UnmarshalAddedProxy(data) + case TypeProxy: + return UnmarshalProxy(data) - case TypeAddedProxies: - return UnmarshalAddedProxies(data) + case TypeProxies: + return UnmarshalProxies(data) case TypeInputSticker: return UnmarshalInputSticker(data) @@ -31092,20 +27068,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeRevenueWithdrawalStateFailed: return UnmarshalRevenueWithdrawalStateFailed(data) - case TypeChatRevenueTransactionTypeUnsupported: - return UnmarshalChatRevenueTransactionTypeUnsupported(data) + case TypeChatRevenueTransactionTypeEarnings: + return UnmarshalChatRevenueTransactionTypeEarnings(data) - case TypeChatRevenueTransactionTypeSponsoredMessageEarnings: - return UnmarshalChatRevenueTransactionTypeSponsoredMessageEarnings(data) + case TypeChatRevenueTransactionTypeWithdrawal: + return UnmarshalChatRevenueTransactionTypeWithdrawal(data) - case TypeChatRevenueTransactionTypeSuggestedPostEarnings: - return UnmarshalChatRevenueTransactionTypeSuggestedPostEarnings(data) - - case TypeChatRevenueTransactionTypeFragmentWithdrawal: - return UnmarshalChatRevenueTransactionTypeFragmentWithdrawal(data) - - case TypeChatRevenueTransactionTypeFragmentRefund: - return UnmarshalChatRevenueTransactionTypeFragmentRefund(data) + case TypeChatRevenueTransactionTypeRefund: + return UnmarshalChatRevenueTransactionTypeRefund(data) case TypeChatRevenueTransaction: return UnmarshalChatRevenueTransaction(data) @@ -31119,12 +27089,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarRevenueStatistics: return UnmarshalStarRevenueStatistics(data) - case TypeTonRevenueStatus: - return UnmarshalTonRevenueStatus(data) - - case TypeTonRevenueStatistics: - return UnmarshalTonRevenueStatistics(data) - case TypePoint: return UnmarshalPoint(data) @@ -31203,9 +27167,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateMessageFactCheck: return UnmarshalUpdateMessageFactCheck(data) - case TypeUpdateMessageSuggestedPostInfo: - return UnmarshalUpdateMessageSuggestedPostInfo(data) - case TypeUpdateMessageLiveLocationViewed: return UnmarshalUpdateMessageLiveLocationViewed(data) @@ -31323,12 +27284,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateSavedMessagesTopicCount: return UnmarshalUpdateSavedMessagesTopicCount(data) - case TypeUpdateDirectMessagesChatTopic: - return UnmarshalUpdateDirectMessagesChatTopic(data) - - case TypeUpdateTopicMessageCount: - return UnmarshalUpdateTopicMessageCount(data) - case TypeUpdateQuickReplyShortcut: return UnmarshalUpdateQuickReplyShortcut(data) @@ -31371,9 +27326,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatAction: return UnmarshalUpdateChatAction(data) - case TypeUpdatePendingTextMessage: - return UnmarshalUpdatePendingTextMessage(data) - case TypeUpdateUserStatus: return UnmarshalUpdateUserStatus(data) @@ -31437,36 +27389,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateGroupCallParticipant: return UnmarshalUpdateGroupCallParticipant(data) - case TypeUpdateGroupCallParticipants: - return UnmarshalUpdateGroupCallParticipants(data) - - case TypeUpdateGroupCallVerificationState: - return UnmarshalUpdateGroupCallVerificationState(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) @@ -31482,11 +27407,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryDeleted: return UnmarshalUpdateStoryDeleted(data) - case TypeUpdateStoryPostSucceeded: - return UnmarshalUpdateStoryPostSucceeded(data) + case TypeUpdateStorySendSucceeded: + return UnmarshalUpdateStorySendSucceeded(data) - case TypeUpdateStoryPostFailed: - return UnmarshalUpdateStoryPostFailed(data) + case TypeUpdateStorySendFailed: + return UnmarshalUpdateStorySendFailed(data) case TypeUpdateChatActiveStories: return UnmarshalUpdateChatActiveStories(data) @@ -31497,9 +27422,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateStoryStealthMode: return UnmarshalUpdateStoryStealthMode(data) - case TypeUpdateTrustedMiniAppBots: - return UnmarshalUpdateTrustedMiniAppBots(data) - case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -31527,8 +27449,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateDefaultBackground: return UnmarshalUpdateDefaultBackground(data) - case TypeUpdateEmojiChatThemes: - return UnmarshalUpdateEmojiChatThemes(data) + case TypeUpdateChatThemes: + return UnmarshalUpdateChatThemes(data) case TypeUpdateAccentColors: return UnmarshalUpdateAccentColors(data) @@ -31545,9 +27467,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateFreezeState: return UnmarshalUpdateFreezeState(data) - case TypeUpdateAgeVerificationParameters: - return UnmarshalUpdateAgeVerificationParameters(data) - case TypeUpdateTermsOfService: return UnmarshalUpdateTermsOfService(data) @@ -31581,30 +27500,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateOwnedStarCount: return UnmarshalUpdateOwnedStarCount(data) - case TypeUpdateOwnedTonCount: - return UnmarshalUpdateOwnedTonCount(data) - case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) case TypeUpdateStarRevenueStatus: return UnmarshalUpdateStarRevenueStatus(data) - case TypeUpdateTonRevenueStatus: - return UnmarshalUpdateTonRevenueStatus(data) - 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 1423dab..9247a4e 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -120,32 +120,18 @@ 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, getAuthenticationPasskeyParameters, 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 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 //@store_product_id Identifier of the store product that must be bought -//@support_email_address Email address to use for support if the user has issues with Telegram Premium purchase -//@support_email_subject Subject for the email sent to the support email address -authorizationStateWaitPremiumPurchase store_product_id:string support_email_address:string support_email_subject:string = AuthorizationState; +authorizationStateWaitPremiumPurchase store_product_id:string = AuthorizationState; //@description TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed //@allow_apple_id True, if authorization through Apple ID is allowed @@ -402,35 +388,6 @@ pollTypeRegular allow_multiple_answers:Bool = PollType; 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 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:MessageSender completion_date:int32 = ChecklistTask; - -//@description Describes a task in a checklist to be sent -//@id Unique identifier of the task; must be positive -//@text Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities -inputChecklistTask id:int32 text:formattedText = InputChecklistTask; - -//@description Describes a checklist -//@title Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities -//@tasks List of tasks in the checklist -//@others_can_add_tasks True, if users other than creator of the list can add tasks to the list -//@can_add_tasks True, if the current user can add tasks to the list if they have Telegram Premium subscription -//@others_can_mark_tasks_as_done True, if users other than creator of the list can mark tasks as done or not done. If true, then the checklist is called "group checklist" -//@can_mark_tasks_as_done True, if the current user can mark tasks as done or not done if they have Telegram Premium subscription -checklist title:formattedText tasks:vector others_can_add_tasks:Bool can_add_tasks:Bool others_can_mark_tasks_as_done:Bool can_mark_tasks_as_done:Bool = Checklist; - -//@description Describes a checklist to be sent -//@title Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities -//@tasks List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks -//@others_can_add_tasks True, if other users can add tasks to the list -//@others_can_mark_tasks_as_done True, if other users can mark tasks as done or not done -inputChecklist title:formattedText tasks:vector others_can_add_tasks:Bool others_can_mark_tasks_as_done:Bool = InputChecklist; - - //@description Describes an animation file. The animation must be encoded in GIF or MPEG4 format //@duration Duration of the animation, in seconds; as defined by the sender //@width Width of the animation @@ -455,9 +412,6 @@ animation duration:int32 width:int32 height:int32 file_name:string mime_type:str //@audio File containing the audio audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector audio:file = Audio; -//@description Contains a list of audio files @total_count Approximate total number of audio files found @audios List of audio files -audios total_count:int32 audios:vector