Update to TDLib 1.8.24

This commit is contained in:
c0re100 2024-01-29 03:02:25 +08:00
parent e30af65ec7
commit 8f4de4d76e
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
9 changed files with 2472 additions and 282 deletions

View file

@ -93,10 +93,6 @@ type SetTdlibParametersRequest struct {
SystemVersion string `json:"system_version"`
// Application version; must be non-empty
ApplicationVersion string `json:"application_version"`
// Pass true to automatically delete old files in background
EnableStorageOptimizer bool `json:"enable_storage_optimizer"`
// Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name
IgnoreFileNames bool `json:"ignore_file_names"`
}
// Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
@ -120,8 +116,6 @@ func (client *Client) SetTdlibParameters(req *SetTdlibParametersRequest) (*Ok, e
"device_model": req.DeviceModel,
"system_version": req.SystemVersion,
"application_version": req.ApplicationVersion,
"enable_storage_optimizer": req.EnableStorageOptimizer,
"ignore_file_names": req.IgnoreFileNames,
},
})
if err != nil {
@ -846,6 +840,25 @@ func (client *Client) ResendRecoveryEmailAddressCode() (*PasswordState, error) {
return UnmarshalPasswordState(result.Data)
}
// Cancels verification of the 2-step verification recovery email address
func (client *Client) CancelRecoveryEmailAddressVerification() (*PasswordState, error) {
result, err := client.Send(Request{
meta: meta{
Type: "cancelRecoveryEmailAddressVerification",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalPasswordState(result.Data)
}
// Requests to send a 2-step verification password recovery code to an email address that was previously set up
func (client *Client) RequestPasswordRecovery() (*EmailAddressAuthenticationCodeInfo, error) {
result, err := client.Send(Request{
@ -1451,6 +1464,53 @@ func (client *Client) GetMessageThread(req *GetMessageThreadRequest) (*MessageTh
return UnmarshalMessageThreadInfo(result.Data)
}
type GetMessageReadDateRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the message
MessageId int64 `json:"message_id"`
}
// Returns read date of a recent outgoing message in a private chat. The method can be called if message.can_get_read_date == true and the message is read
func (client *Client) GetMessageReadDate(req *GetMessageReadDateRequest) (MessageReadDate, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getMessageReadDate",
},
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)
}
switch result.Type {
case TypeMessageReadDateRead:
return UnmarshalMessageReadDateRead(result.Data)
case TypeMessageReadDateUnread:
return UnmarshalMessageReadDateUnread(result.Data)
case TypeMessageReadDateTooOld:
return UnmarshalMessageReadDateTooOld(result.Data)
case TypeMessageReadDateUserPrivacyRestricted:
return UnmarshalMessageReadDateUserPrivacyRestricted(result.Data)
case TypeMessageReadDateMyPrivacyRestricted:
return UnmarshalMessageReadDateMyPrivacyRestricted(result.Data)
default:
return nil, errors.New("invalid type")
}
}
type GetMessageViewersRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -2137,6 +2197,231 @@ func (client *Client) GetInactiveSupergroupChats() (*Chats, error) {
return UnmarshalChats(result.Data)
}
// Returns list of all pinned Saved Messages topics
func (client *Client) GetPinnedSavedMessagesTopics() (*FoundSavedMessagesTopics, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPinnedSavedMessagesTopics",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalFoundSavedMessagesTopics(result.Data)
}
type GetSavedMessagesTopicsRequest 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 Saved Messages topics to be returned; up to 100
Limit int32 `json:"limit"`
}
// Returns list of non-pinned Saved Messages topics from the specified offset
func (client *Client) GetSavedMessagesTopics(req *GetSavedMessagesTopicsRequest) (*FoundSavedMessagesTopics, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedMessagesTopics",
},
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 UnmarshalFoundSavedMessagesTopics(result.Data)
}
type GetSavedMessagesTopicHistoryRequest struct {
// Saved Messages topic which messages will be fetched
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
// 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 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, 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 Saved Messages topic. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
func (client *Client) GetSavedMessagesTopicHistory(req *GetSavedMessagesTopicHistoryRequest) (*Messages, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedMessagesTopicHistory",
},
Data: map[string]interface{}{
"saved_messages_topic": req.SavedMessagesTopic,
"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 GetSavedMessagesTopicMessageByDateRequest struct {
// Saved Messages topic which message will be returned
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
// Point in time (Unix timestamp) relative to which to search for messages
Date int32 `json:"date"`
}
// Returns the last message sent in a Saved Messages topic no later than the specified date
func (client *Client) GetSavedMessagesTopicMessageByDate(req *GetSavedMessagesTopicMessageByDateRequest) (*Message, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedMessagesTopicMessageByDate",
},
Data: map[string]interface{}{
"saved_messages_topic": req.SavedMessagesTopic,
"date": req.Date,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalMessage(result.Data)
}
type DeleteSavedMessagesTopicHistoryRequest struct {
// Saved Messages topic which messages will be deleted
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
}
// Deletes all messages in a Saved Messages topic
func (client *Client) DeleteSavedMessagesTopicHistory(req *DeleteSavedMessagesTopicHistoryRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "deleteSavedMessagesTopicHistory",
},
Data: map[string]interface{}{
"saved_messages_topic": req.SavedMessagesTopic,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type DeleteSavedMessagesTopicMessagesByDateRequest struct {
// Saved Messages topic which messages will be deleted
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
// 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 a Saved Messages topic. Messages sent in the last 30 seconds will not be deleted
func (client *Client) DeleteSavedMessagesTopicMessagesByDate(req *DeleteSavedMessagesTopicMessagesByDateRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "deleteSavedMessagesTopicMessagesByDate",
},
Data: map[string]interface{}{
"saved_messages_topic": req.SavedMessagesTopic,
"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 ToggleSavedMessagesTopicIsPinnedRequest struct {
// Saved Messages topic to pin or unpin
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
// Pass true to pin the topic; pass false to unpin it
IsPinned bool `json:"is_pinned"`
}
// Changes the pinned state of a Saved Messages topic. There can be up to getOption("pinned_saved_messages_topic_count_max") pinned topics. The limit can be increased with Telegram Premium
func (client *Client) ToggleSavedMessagesTopicIsPinned(req *ToggleSavedMessagesTopicIsPinnedRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleSavedMessagesTopicIsPinned",
},
Data: map[string]interface{}{
"saved_messages_topic": req.SavedMessagesTopic,
"is_pinned": req.IsPinned,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetPinnedSavedMessagesTopicsRequest struct {
// The new list of pinned Saved Messages topics
SavedMessagesTopics []SavedMessagesTopic `json:"saved_messages_topics"`
}
// Changes the order of pinned Saved Messages topics
func (client *Client) SetPinnedSavedMessagesTopics(req *SetPinnedSavedMessagesTopicsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setPinnedSavedMessagesTopics",
},
Data: map[string]interface{}{
"saved_messages_topics": req.SavedMessagesTopics,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetGroupsInCommonRequest struct {
// User identifier
UserId int64 `json:"user_id"`
@ -2174,7 +2459,7 @@ 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 from_message_id or a negative offset up to 99 to get additionally some 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, 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"`
@ -2214,7 +2499,7 @@ 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 from_message_id or a negative offset up to 99 to get additionally some 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, 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"`
@ -2312,7 +2597,7 @@ type SearchChatMessagesRequest struct {
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 from_message_id or a negative offset 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, 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"`
@ -2320,6 +2605,8 @@ type SearchChatMessagesRequest struct {
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 null, only messages in the specified Saved Messages topic will be returned; pass null to return all messages, or for chats other than Saved Messages
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
}
// 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
@ -2337,6 +2624,7 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Found
"limit": req.Limit,
"filter": req.Filter,
"message_thread_id": req.MessageThreadId,
"saved_messages_topic": req.SavedMessagesTopic,
},
})
if err != nil {
@ -2432,6 +2720,44 @@ func (client *Client) SearchSecretMessages(req *SearchSecretMessagesRequest) (*F
return UnmarshalFoundMessages(result.Data)
}
type SearchSavedMessagesRequest struct {
// Tag to search for; pass null to return all suitable messages
Tag ReactionType `json:"tag"`
// Query to search for
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 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, 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"`
}
// Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only. 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 and can be smaller than the specified limit
func (client *Client) SearchSavedMessages(req *SearchSavedMessagesRequest) (*FoundChatMessages, error) {
result, err := client.Send(Request{
meta: meta{
Type: "searchSavedMessages",
},
Data: map[string]interface{}{
"tag": req.Tag,
"query": req.Query,
"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 UnmarshalFoundChatMessages(result.Data)
}
type SearchCallMessagesRequest 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"`
@ -2605,6 +2931,8 @@ type GetChatSparseMessagePositionsRequest struct {
FromMessageId int64 `json:"from_message_id"`
// The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages
Limit int32 `json:"limit"`
// If not null, only messages in the specified Saved Messages topic will be considered; pass null to consider all messages, or for chats other than Saved Messages
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
}
// Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database
@ -2618,6 +2946,7 @@ func (client *Client) GetChatSparseMessagePositions(req *GetChatSparseMessagePos
"filter": req.Filter,
"from_message_id": req.FromMessageId,
"limit": req.Limit,
"saved_messages_topic": req.SavedMessagesTopic,
},
})
if err != nil {
@ -2638,6 +2967,8 @@ type GetChatMessageCalendarRequest struct {
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 not null, only messages in the specified Saved Messages topic will be considered; pass null to consider all messages, or for chats other than Saved Messages
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
}
// 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"
@ -2650,6 +2981,7 @@ func (client *Client) GetChatMessageCalendar(req *GetChatMessageCalendarRequest)
"chat_id": req.ChatId,
"filter": req.Filter,
"from_message_id": req.FromMessageId,
"saved_messages_topic": req.SavedMessagesTopic,
},
})
if err != nil {
@ -2668,6 +3000,8 @@ type GetChatMessageCountRequest struct {
ChatId int64 `json:"chat_id"`
// Filter for message content; searchMessagesFilterEmpty is unsupported in this function
Filter SearchMessagesFilter `json:"filter"`
// If not null, only messages in the specified Saved Messages topic will be counted; pass null to count all messages, or for chats other than Saved Messages
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
// 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"`
}
@ -2681,6 +3015,7 @@ func (client *Client) GetChatMessageCount(req *GetChatMessageCountRequest) (*Cou
Data: map[string]interface{}{
"chat_id": req.ChatId,
"filter": req.Filter,
"saved_messages_topic": req.SavedMessagesTopic,
"return_local": req.ReturnLocal,
},
})
@ -2704,6 +3039,8 @@ type GetChatMessagePositionRequest struct {
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 null, only messages in the specified Saved Messages topic will be considered; pass null to consider all relevant messages, or for chats other than Saved Messages
SavedMessagesTopic SavedMessagesTopic `json:"saved_messages_topic"`
}
// 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
@ -2717,6 +3054,7 @@ func (client *Client) GetChatMessagePosition(req *GetChatMessagePositionRequest)
"message_id": req.MessageId,
"filter": req.Filter,
"message_thread_id": req.MessageThreadId,
"saved_messages_topic": req.SavedMessagesTopic,
},
})
if err != nil {
@ -3934,7 +4272,7 @@ type CreateForumTopicRequest struct {
Icon *ForumTopicIcon `json:"icon"`
}
// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
// Creates a topic in a forum supergroup chat; requires can_manage_topics or can_create_topics rights in the supergroup
func (client *Client) CreateForumTopic(req *CreateForumTopicRequest) (*ForumTopicInfo, error) {
result, err := client.Send(Request{
meta: meta{
@ -3970,7 +4308,7 @@ type EditForumTopicRequest struct {
IconCustomEmojiId JsonInt64 `json:"icon_custom_emoji_id"`
}
// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup 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{
@ -4135,7 +4473,7 @@ type ToggleForumTopicIsClosedRequest struct {
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{
@ -4165,7 +4503,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{
@ -4196,7 +4534,7 @@ type ToggleForumTopicIsPinnedRequest struct {
IsPinned bool `json:"is_pinned"`
}
// Changes the pinned state of a forum topic; 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{
@ -4226,7 +4564,7 @@ type SetPinnedForumTopicsRequest struct {
MessageThreadIds []int64 `json:"message_thread_ids"`
}
// Changes the order of pinned forum topics
// 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{
@ -4282,7 +4620,7 @@ type GetEmojiReactionRequest struct {
Emoji string `json:"emoji"`
}
// Returns information about a emoji reaction. Returns a 404 error if the reaction is not found
// Returns information about an emoji reaction. Returns a 404 error if the reaction is not found
func (client *Client) GetEmojiReaction(req *GetEmojiReactionRequest) (*EmojiReaction, error) {
result, err := client.Send(Request{
meta: meta{
@ -4382,11 +4720,11 @@ type AddMessageReactionRequest struct {
ReactionType ReactionType `json:"reaction_type"`
// Pass true if the reaction is added with a big animation
IsBig bool `json:"is_big"`
// Pass true if the reaction needs to be added to recent reactions
// Pass true if the reaction needs to be added to recent reactions; tags are never added to the list of recent reactions
UpdateRecentReactions bool `json:"update_recent_reactions"`
}
// Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message
// Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message
func (client *Client) AddMessageReaction(req *AddMessageReactionRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -4542,6 +4880,54 @@ func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest)
return UnmarshalOk(result.Data)
}
// Returns tags used in Saved Messages; for Telegram Premium users only
func (client *Client) GetSavedMessagesTags() (*SavedMessagesTags, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedMessagesTags",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalSavedMessagesTags(result.Data)
}
type SetSavedMessagesTagLabelRequest struct {
// The tag which label will be changed
Tag ReactionType `json:"tag"`
// New label for the tag; 0-12 characters
Label string `json:"label"`
}
// Changes label of a Saved Messages tag; for Telegram Premium users only
func (client *Client) SetSavedMessagesTagLabel(req *SetSavedMessagesTagLabelRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setSavedMessagesTagLabel",
},
Data: map[string]interface{}{
"tag": req.Tag,
"label": req.Label,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SearchQuoteRequest struct {
// Text in which to search for the quote
Text *FormattedText `json:"text"`
@ -4706,6 +5092,37 @@ func GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) {
func (client *Client) GetMarkdownText(req *GetMarkdownTextRequest) (*FormattedText, error) {
return GetMarkdownText(req)}
type GetCountryFlagEmojiRequest struct {
// A two-letter ISO 3166-1 alpha-2 country code as received from getCountries
CountryCode string `json:"country_code"`
}
// Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously
func GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) {
result, err := Execute(Request{
meta: meta{
Type: "getCountryFlagEmoji",
},
Data: map[string]interface{}{
"country_code": req.CountryCode,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalText(result.Data)
}
// deprecated
// Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously
func (client *Client) GetCountryFlagEmoji(req *GetCountryFlagEmojiRequest) (*Text, error) {
return GetCountryFlagEmoji(req)}
type GetFileMimeTypeRequest struct {
// The name of the file or path to the file
FileName string `json:"file_name"`
@ -13191,21 +13608,47 @@ func (client *Client) GetStickerEmojis(req *GetStickerEmojisRequest) (*Emojis, e
type SearchEmojisRequest struct {
// Text to search for
Text string `json:"text"`
// Pass true if only emojis, which exactly match the text, needs to be returned
ExactMatch bool `json:"exact_match"`
// List of possible IETF language tags of the user's input language; may be empty if unknown
InputLanguageCodes []string `json:"input_language_codes"`
}
// Searches for emojis by keywords. Supported only if the file database is enabled
func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*Emojis, error) {
// Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified
func (client *Client) SearchEmojis(req *SearchEmojisRequest) (*EmojiKeywords, error) {
result, err := client.Send(Request{
meta: meta{
Type: "searchEmojis",
},
Data: map[string]interface{}{
"text": req.Text,
"exact_match": req.ExactMatch,
"input_language_codes": req.InputLanguageCodes,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojiKeywords(result.Data)
}
type GetKeywordEmojisRequest struct {
// Text to search for
Text string `json:"text"`
// List of possible IETF language tags of the user's input language; may be empty if unknown
InputLanguageCodes []string `json:"input_language_codes"`
}
// 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{
Type: "getKeywordEmojis",
},
Data: map[string]interface{}{
"text": req.Text,
"input_language_codes": req.InputLanguageCodes,
},
})
@ -16157,6 +16600,137 @@ func (client *Client) GetUserPrivacySettingRules(req *GetUserPrivacySettingRules
return UnmarshalUserPrivacySettingRules(result.Data)
}
type SetReadDatePrivacySettingsRequest struct {
// New settings
Settings *ReadDatePrivacySettings `json:"settings"`
}
// Changes privacy settings for message read date
func (client *Client) SetReadDatePrivacySettings(req *SetReadDatePrivacySettingsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setReadDatePrivacySettings",
},
Data: map[string]interface{}{
"settings": req.Settings,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
// Returns privacy settings for message read date
func (client *Client) GetReadDatePrivacySettings() (*ReadDatePrivacySettings, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getReadDatePrivacySettings",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalReadDatePrivacySettings(result.Data)
}
type SetNewChatPrivacySettingsRequest struct {
// New settings
Settings *NewChatPrivacySettings `json:"settings"`
}
// Changes privacy settings for new chat creation; for Telegram Premium users only
func (client *Client) SetNewChatPrivacySettings(req *SetNewChatPrivacySettingsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setNewChatPrivacySettings",
},
Data: map[string]interface{}{
"settings": req.Settings,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
// Returns privacy settings for new chat creation
func (client *Client) GetNewChatPrivacySettings() (*NewChatPrivacySettings, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getNewChatPrivacySettings",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalNewChatPrivacySettings(result.Data)
}
type CanSendMessageToUserRequest struct {
// Identifier of the other user
UserId int64 `json:"user_id"`
// Pass true to get only locally available information without sending network requests
OnlyLocal bool `json:"only_local"`
}
// 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{
Type: "canSendMessageToUser",
},
Data: map[string]interface{}{
"user_id": req.UserId,
"only_local": req.OnlyLocal,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
switch result.Type {
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(result.Data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(result.Data)
case TypeCanSendMessageToUserResultUserRestrictsNewChats:
return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(result.Data)
default:
return nil, errors.New("invalid type")
}
}
type GetOptionRequest struct {
// The name of the option
Name string `json:"name"`
@ -19777,6 +20351,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(result.Data)
case TypeUpdatePinnedSavedMessagesTopics:
return UnmarshalUpdatePinnedSavedMessagesTopics(result.Data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(result.Data)
@ -19954,6 +20531,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateDefaultReactionType:
return UnmarshalUpdateDefaultReactionType(result.Data)
case TypeUpdateSavedMessagesTags:
return UnmarshalUpdateSavedMessagesTags(result.Data)
case TypeUpdateSpeechRecognitionTrial:
return UnmarshalUpdateSpeechRecognitionTrial(result.Data)

File diff suppressed because it is too large Load diff

View file

@ -914,6 +914,49 @@ func UnmarshalListOfMessageSender(dataList []json.RawMessage) ([]MessageSender,
return list, nil
}
func UnmarshalMessageReadDate(data json.RawMessage) (MessageReadDate, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeMessageReadDateRead:
return UnmarshalMessageReadDateRead(data)
case TypeMessageReadDateUnread:
return UnmarshalMessageReadDateUnread(data)
case TypeMessageReadDateTooOld:
return UnmarshalMessageReadDateTooOld(data)
case TypeMessageReadDateUserPrivacyRestricted:
return UnmarshalMessageReadDateUserPrivacyRestricted(data)
case TypeMessageReadDateMyPrivacyRestricted:
return UnmarshalMessageReadDateMyPrivacyRestricted(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfMessageReadDate(dataList []json.RawMessage) ([]MessageReadDate, error) {
list := []MessageReadDate{}
for _, data := range dataList {
entity, err := UnmarshalMessageReadDate(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalMessageOrigin(data json.RawMessage) (MessageOrigin, error) {
var meta meta
@ -1634,6 +1677,43 @@ func UnmarshalListOfLoginUrlInfo(dataList []json.RawMessage) ([]LoginUrlInfo, er
return list, nil
}
func UnmarshalSavedMessagesTopic(data json.RawMessage) (SavedMessagesTopic, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeSavedMessagesTopicMyNotes:
return UnmarshalSavedMessagesTopicMyNotes(data)
case TypeSavedMessagesTopicAuthorHidden:
return UnmarshalSavedMessagesTopicAuthorHidden(data)
case TypeSavedMessagesTopicSavedFromChat:
return UnmarshalSavedMessagesTopicSavedFromChat(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfSavedMessagesTopic(dataList []json.RawMessage) ([]SavedMessagesTopic, error) {
list := []SavedMessagesTopic{}
for _, data := range dataList {
entity, err := UnmarshalSavedMessagesTopic(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalRichText(data json.RawMessage) (RichText, error) {
var meta meta
@ -2391,24 +2471,30 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessagePhoto:
return UnmarshalMessagePhoto(data)
case TypeMessageExpiredPhoto:
return UnmarshalMessageExpiredPhoto(data)
case TypeMessageSticker:
return UnmarshalMessageSticker(data)
case TypeMessageVideo:
return UnmarshalMessageVideo(data)
case TypeMessageExpiredVideo:
return UnmarshalMessageExpiredVideo(data)
case TypeMessageVideoNote:
return UnmarshalMessageVideoNote(data)
case TypeMessageVoiceNote:
return UnmarshalMessageVoiceNote(data)
case TypeMessageExpiredPhoto:
return UnmarshalMessageExpiredPhoto(data)
case TypeMessageExpiredVideo:
return UnmarshalMessageExpiredVideo(data)
case TypeMessageExpiredVideoNote:
return UnmarshalMessageExpiredVideoNote(data)
case TypeMessageExpiredVoiceNote:
return UnmarshalMessageExpiredVoiceNote(data)
case TypeMessageLocation:
return UnmarshalMessageLocation(data)
@ -3648,6 +3734,40 @@ func UnmarshalListOfFirebaseAuthenticationSettings(dataList []json.RawMessage) (
return list, nil
}
func UnmarshalReactionUnavailabilityReason(data json.RawMessage) (ReactionUnavailabilityReason, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeReactionUnavailabilityReasonAnonymousAdministrator:
return UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data)
case TypeReactionUnavailabilityReasonGuest:
return UnmarshalReactionUnavailabilityReasonGuest(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfReactionUnavailabilityReason(dataList []json.RawMessage) ([]ReactionUnavailabilityReason, error) {
list := []ReactionUnavailabilityReason{}
for _, data := range dataList {
entity, err := UnmarshalReactionUnavailabilityReason(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalDiceStickers(data json.RawMessage) (DiceStickers, error) {
var meta meta
@ -4200,6 +4320,9 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) {
case TypePremiumLimitTypePinnedArchivedChatCount:
return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data)
case TypePremiumLimitTypePinnedSavedMessagesTopicCount:
return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data)
case TypePremiumLimitTypeCaptionLength:
return UnmarshalPremiumLimitTypeCaptionLength(data)
@ -5364,6 +5487,43 @@ func UnmarshalListOfUserPrivacySetting(dataList []json.RawMessage) ([]UserPrivac
return list, nil
}
func UnmarshalCanSendMessageToUserResult(data json.RawMessage) (CanSendMessageToUserResult, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(data)
case TypeCanSendMessageToUserResultUserRestrictsNewChats:
return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfCanSendMessageToUserResult(dataList []json.RawMessage) ([]CanSendMessageToUserResult, error) {
list := []CanSendMessageToUserResult{}
for _, data := range dataList {
entity, err := UnmarshalCanSendMessageToUserResult(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalSessionType(data json.RawMessage) (SessionType, error) {
var meta meta
@ -6524,6 +6684,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdatePinnedSavedMessagesTopics:
return UnmarshalUpdatePinnedSavedMessagesTopics(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
@ -6701,6 +6864,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateDefaultReactionType:
return UnmarshalUpdateDefaultReactionType(data)
case TypeUpdateSavedMessagesTags:
return UnmarshalUpdateSavedMessagesTags(data)
case TypeUpdateSpeechRecognitionTrial:
return UnmarshalUpdateSpeechRecognitionTrial(data)
@ -8295,6 +8461,46 @@ func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, err
return &resp, err
}
func UnmarshalMessageReadDateRead(data json.RawMessage) (*MessageReadDateRead, error) {
var resp MessageReadDateRead
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageReadDateUnread(data json.RawMessage) (*MessageReadDateUnread, error) {
var resp MessageReadDateUnread
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageReadDateTooOld(data json.RawMessage) (*MessageReadDateTooOld, error) {
var resp MessageReadDateTooOld
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageReadDateUserPrivacyRestricted(data json.RawMessage) (*MessageReadDateUserPrivacyRestricted, error) {
var resp MessageReadDateUserPrivacyRestricted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageReadDateMyPrivacyRestricted(data json.RawMessage) (*MessageReadDateMyPrivacyRestricted, error) {
var resp MessageReadDateMyPrivacyRestricted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageViewer(data json.RawMessage) (*MessageViewer, error) {
var resp MessageViewer
@ -8343,6 +8549,14 @@ func UnmarshalMessageOriginChannel(data json.RawMessage) (*MessageOriginChannel,
return &resp, err
}
func UnmarshalForwardSource(data json.RawMessage) (*ForwardSource, error) {
var resp ForwardSource
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalReactionTypeEmoji(data json.RawMessage) (*ReactionTypeEmoji, error) {
var resp ReactionTypeEmoji
@ -8391,6 +8605,14 @@ func UnmarshalMessageReaction(data json.RawMessage) (*MessageReaction, error) {
return &resp, err
}
func UnmarshalMessageReactions(data json.RawMessage) (*MessageReactions, error) {
var resp MessageReactions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageInteractionInfo(data json.RawMessage) (*MessageInteractionInfo, error) {
var resp MessageInteractionInfo
@ -8927,6 +9149,22 @@ func UnmarshalChatAvailableReactionsSome(data json.RawMessage) (*ChatAvailableRe
return &resp, err
}
func UnmarshalSavedMessagesTag(data json.RawMessage) (*SavedMessagesTag, error) {
var resp SavedMessagesTag
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSavedMessagesTags(data json.RawMessage) (*SavedMessagesTags, error) {
var resp SavedMessagesTags
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalVideoChat(data json.RawMessage) (*VideoChat, error) {
var resp VideoChat
@ -9255,6 +9493,46 @@ func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error
return &resp, err
}
func UnmarshalSavedMessagesTopicMyNotes(data json.RawMessage) (*SavedMessagesTopicMyNotes, error) {
var resp SavedMessagesTopicMyNotes
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSavedMessagesTopicAuthorHidden(data json.RawMessage) (*SavedMessagesTopicAuthorHidden, error) {
var resp SavedMessagesTopicAuthorHidden
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSavedMessagesTopicSavedFromChat(data json.RawMessage) (*SavedMessagesTopicSavedFromChat, error) {
var resp SavedMessagesTopicSavedFromChat
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalFoundSavedMessagesTopic(data json.RawMessage) (*FoundSavedMessagesTopic, error) {
var resp FoundSavedMessagesTopic
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalFoundSavedMessagesTopics(data json.RawMessage) (*FoundSavedMessagesTopics, error) {
var resp FoundSavedMessagesTopics
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalForumTopicIcon(data json.RawMessage) (*ForumTopicIcon, error) {
var resp ForumTopicIcon
@ -10639,14 +10917,6 @@ func UnmarshalMessagePhoto(data json.RawMessage) (*MessagePhoto, error) {
return &resp, err
}
func UnmarshalMessageExpiredPhoto(data json.RawMessage) (*MessageExpiredPhoto, error) {
var resp MessageExpiredPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageSticker(data json.RawMessage) (*MessageSticker, error) {
var resp MessageSticker
@ -10663,14 +10933,6 @@ func UnmarshalMessageVideo(data json.RawMessage) (*MessageVideo, error) {
return &resp, err
}
func UnmarshalMessageExpiredVideo(data json.RawMessage) (*MessageExpiredVideo, error) {
var resp MessageExpiredVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageVideoNote(data json.RawMessage) (*MessageVideoNote, error) {
var resp MessageVideoNote
@ -10687,6 +10949,38 @@ func UnmarshalMessageVoiceNote(data json.RawMessage) (*MessageVoiceNote, error)
return &resp, err
}
func UnmarshalMessageExpiredPhoto(data json.RawMessage) (*MessageExpiredPhoto, error) {
var resp MessageExpiredPhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExpiredVideo(data json.RawMessage) (*MessageExpiredVideo, error) {
var resp MessageExpiredVideo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExpiredVideoNote(data json.RawMessage) (*MessageExpiredVideoNote, error) {
var resp MessageExpiredVideoNote
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageExpiredVoiceNote(data json.RawMessage) (*MessageExpiredVoiceNote, error) {
var resp MessageExpiredVoiceNote
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageLocation(data json.RawMessage) (*MessageLocation, error) {
var resp MessageLocation
@ -11799,6 +12093,22 @@ func UnmarshalUserStatusLastMonth(data json.RawMessage) (*UserStatusLastMonth, e
return &resp, err
}
func UnmarshalEmojiKeyword(data json.RawMessage) (*EmojiKeyword, error) {
var resp EmojiKeyword
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalEmojiKeywords(data json.RawMessage) (*EmojiKeywords, error) {
var resp EmojiKeywords
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStickers(data json.RawMessage) (*Stickers, error) {
var resp Stickers
@ -12647,6 +12957,22 @@ func UnmarshalEmojiReaction(data json.RawMessage) (*EmojiReaction, error) {
return &resp, err
}
func UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data json.RawMessage) (*ReactionUnavailabilityReasonAnonymousAdministrator, error) {
var resp ReactionUnavailabilityReasonAnonymousAdministrator
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalReactionUnavailabilityReasonGuest(data json.RawMessage) (*ReactionUnavailabilityReasonGuest, error) {
var resp ReactionUnavailabilityReasonGuest
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAnimations(data json.RawMessage) (*Animations, error) {
var resp Animations
@ -13583,6 +13909,14 @@ func UnmarshalPremiumLimitTypePinnedArchivedChatCount(data json.RawMessage) (*Pr
return &resp, err
}
func UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data json.RawMessage) (*PremiumLimitTypePinnedSavedMessagesTopicCount, error) {
var resp PremiumLimitTypePinnedSavedMessagesTopicCount
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumLimitTypeCaptionLength(data json.RawMessage) (*PremiumLimitTypeCaptionLength, error) {
var resp PremiumLimitTypeCaptionLength
@ -15031,6 +15365,46 @@ func UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data json.
return &resp, err
}
func UnmarshalReadDatePrivacySettings(data json.RawMessage) (*ReadDatePrivacySettings, error) {
var resp ReadDatePrivacySettings
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalNewChatPrivacySettings(data json.RawMessage) (*NewChatPrivacySettings, error) {
var resp NewChatPrivacySettings
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCanSendMessageToUserResultOk(data json.RawMessage) (*CanSendMessageToUserResultOk, error) {
var resp CanSendMessageToUserResultOk
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCanSendMessageToUserResultUserIsDeleted(data json.RawMessage) (*CanSendMessageToUserResultUserIsDeleted, error) {
var resp CanSendMessageToUserResultUserIsDeleted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data json.RawMessage) (*CanSendMessageToUserResultUserRestrictsNewChats, error) {
var resp CanSendMessageToUserResultUserRestrictsNewChats
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) {
var resp AccountTtl
@ -16959,6 +17333,14 @@ func UnmarshalUpdateChatOnlineMemberCount(data json.RawMessage) (*UpdateChatOnli
return &resp, err
}
func UnmarshalUpdatePinnedSavedMessagesTopics(data json.RawMessage) (*UpdatePinnedSavedMessagesTopics, error) {
var resp UpdatePinnedSavedMessagesTopics
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateForumTopicInfo(data json.RawMessage) (*UpdateForumTopicInfo, error) {
var resp UpdateForumTopicInfo
@ -17431,6 +17813,14 @@ func UnmarshalUpdateDefaultReactionType(data json.RawMessage) (*UpdateDefaultRea
return &resp, err
}
func UnmarshalUpdateSavedMessagesTags(data json.RawMessage) (*UpdateSavedMessagesTags, error) {
var resp UpdateSavedMessagesTags
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) {
var resp UpdateSpeechRecognitionTrial
@ -18280,6 +18670,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatMessageSenders:
return UnmarshalChatMessageSenders(data)
case TypeMessageReadDateRead:
return UnmarshalMessageReadDateRead(data)
case TypeMessageReadDateUnread:
return UnmarshalMessageReadDateUnread(data)
case TypeMessageReadDateTooOld:
return UnmarshalMessageReadDateTooOld(data)
case TypeMessageReadDateUserPrivacyRestricted:
return UnmarshalMessageReadDateUserPrivacyRestricted(data)
case TypeMessageReadDateMyPrivacyRestricted:
return UnmarshalMessageReadDateMyPrivacyRestricted(data)
case TypeMessageViewer:
return UnmarshalMessageViewer(data)
@ -18298,6 +18703,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageOriginChannel:
return UnmarshalMessageOriginChannel(data)
case TypeForwardSource:
return UnmarshalForwardSource(data)
case TypeReactionTypeEmoji:
return UnmarshalReactionTypeEmoji(data)
@ -18316,6 +18724,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageReaction:
return UnmarshalMessageReaction(data)
case TypeMessageReactions:
return UnmarshalMessageReactions(data)
case TypeMessageInteractionInfo:
return UnmarshalMessageInteractionInfo(data)
@ -18517,6 +18928,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatAvailableReactionsSome:
return UnmarshalChatAvailableReactionsSome(data)
case TypeSavedMessagesTag:
return UnmarshalSavedMessagesTag(data)
case TypeSavedMessagesTags:
return UnmarshalSavedMessagesTags(data)
case TypeVideoChat:
return UnmarshalVideoChat(data)
@ -18640,6 +19057,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageThreadInfo:
return UnmarshalMessageThreadInfo(data)
case TypeSavedMessagesTopicMyNotes:
return UnmarshalSavedMessagesTopicMyNotes(data)
case TypeSavedMessagesTopicAuthorHidden:
return UnmarshalSavedMessagesTopicAuthorHidden(data)
case TypeSavedMessagesTopicSavedFromChat:
return UnmarshalSavedMessagesTopicSavedFromChat(data)
case TypeFoundSavedMessagesTopic:
return UnmarshalFoundSavedMessagesTopic(data)
case TypeFoundSavedMessagesTopics:
return UnmarshalFoundSavedMessagesTopics(data)
case TypeForumTopicIcon:
return UnmarshalForumTopicIcon(data)
@ -19159,24 +19591,30 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessagePhoto:
return UnmarshalMessagePhoto(data)
case TypeMessageExpiredPhoto:
return UnmarshalMessageExpiredPhoto(data)
case TypeMessageSticker:
return UnmarshalMessageSticker(data)
case TypeMessageVideo:
return UnmarshalMessageVideo(data)
case TypeMessageExpiredVideo:
return UnmarshalMessageExpiredVideo(data)
case TypeMessageVideoNote:
return UnmarshalMessageVideoNote(data)
case TypeMessageVoiceNote:
return UnmarshalMessageVoiceNote(data)
case TypeMessageExpiredPhoto:
return UnmarshalMessageExpiredPhoto(data)
case TypeMessageExpiredVideo:
return UnmarshalMessageExpiredVideo(data)
case TypeMessageExpiredVideoNote:
return UnmarshalMessageExpiredVideoNote(data)
case TypeMessageExpiredVoiceNote:
return UnmarshalMessageExpiredVoiceNote(data)
case TypeMessageLocation:
return UnmarshalMessageLocation(data)
@ -19594,6 +20032,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUserStatusLastMonth:
return UnmarshalUserStatusLastMonth(data)
case TypeEmojiKeyword:
return UnmarshalEmojiKeyword(data)
case TypeEmojiKeywords:
return UnmarshalEmojiKeywords(data)
case TypeStickers:
return UnmarshalStickers(data)
@ -19912,6 +20356,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmojiReaction:
return UnmarshalEmojiReaction(data)
case TypeReactionUnavailabilityReasonAnonymousAdministrator:
return UnmarshalReactionUnavailabilityReasonAnonymousAdministrator(data)
case TypeReactionUnavailabilityReasonGuest:
return UnmarshalReactionUnavailabilityReasonGuest(data)
case TypeAnimations:
return UnmarshalAnimations(data)
@ -20263,6 +20713,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumLimitTypePinnedArchivedChatCount:
return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data)
case TypePremiumLimitTypePinnedSavedMessagesTopicCount:
return UnmarshalPremiumLimitTypePinnedSavedMessagesTopicCount(data)
case TypePremiumLimitTypeCaptionLength:
return UnmarshalPremiumLimitTypeCaptionLength(data)
@ -20806,6 +21259,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages:
return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data)
case TypeReadDatePrivacySettings:
return UnmarshalReadDatePrivacySettings(data)
case TypeNewChatPrivacySettings:
return UnmarshalNewChatPrivacySettings(data)
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(data)
case TypeCanSendMessageToUserResultUserRestrictsNewChats:
return UnmarshalCanSendMessageToUserResultUserRestrictsNewChats(data)
case TypeAccountTtl:
return UnmarshalAccountTtl(data)
@ -21529,6 +21997,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatOnlineMemberCount:
return UnmarshalUpdateChatOnlineMemberCount(data)
case TypeUpdatePinnedSavedMessagesTopics:
return UnmarshalUpdatePinnedSavedMessagesTopics(data)
case TypeUpdateForumTopicInfo:
return UnmarshalUpdateForumTopicInfo(data)
@ -21706,6 +22177,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateDefaultReactionType:
return UnmarshalUpdateDefaultReactionType(data)
case TypeUpdateSavedMessagesTags:
return UnmarshalUpdateSavedMessagesTags(data)
case TypeUpdateSpeechRecognitionTrial:
return UnmarshalUpdateSpeechRecognitionTrial(data)