diff --git a/client/function.go b/client/function.go index 8b2d6d4..dc0c71c 100755 --- a/client/function.go +++ b/client/function.go @@ -1227,7 +1227,7 @@ type GetChatRequest struct { ChatId int64 `json:"chat_id"` } -// Returns information about a chat by its identifier, this is an offline request if the current user is not a bot +// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot func (client *Client) GetChat(req *GetChatRequest) (*Chat, error) { result, err := client.Send(Request{ meta: meta{ @@ -1313,7 +1313,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively +// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1652,7 +1652,7 @@ type SearchChatsRequest struct { Limit int32 `json:"limit"` } -// Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list func (client *Client) SearchChats(req *SearchChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -1787,6 +1787,35 @@ func (client *Client) RemoveTopChat(req *RemoveTopChatRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SearchRecentlyFoundChatsRequest struct { + // Query to search for + Query string `json:"query"` + // The maximum number of chats to be returned + Limit int32 `json:"limit"` +} + +// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +func (client *Client) SearchRecentlyFoundChats(req *SearchRecentlyFoundChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchRecentlyFoundChats", + }, + Data: map[string]interface{}{ + "query": req.Query, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + type AddRecentlyFoundChatRequest struct { // Identifier of the chat to add ChatId int64 `json:"chat_id"` @@ -1863,7 +1892,7 @@ type GetRecentlyOpenedChatsRequest struct { Limit int32 `json:"limit"` } -// Returns recently opened chats, this is an offline request. Returns chats in the order of last opening +// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening func (client *Client) GetRecentlyOpenedChats(req *GetRecentlyOpenedChatsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -2704,6 +2733,35 @@ func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequ return UnmarshalSponsoredMessages(result.Data) } +type ClickChatSponsoredMessageRequest struct { + // Chat identifier of the sponsored message + ChatId int64 `json:"chat_id"` + // Identifier of the sponsored message + MessageId int64 `json:"message_id"` +} + +// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +func (client *Client) ClickChatSponsoredMessage(req *ClickChatSponsoredMessageRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "clickChatSponsoredMessage", + }, + 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 RemoveNotificationRequest struct { // Identifier of notification group to which the notification belongs NotificationGroupId int32 `json:"notification_group_id"` @@ -3040,8 +3098,8 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the replied message or story; pass null if none + ReplyTo MessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Markup for replying to the message; pass null if none; for bots only @@ -3059,7 +3117,7 @@ func (client *Client) SendMessage(req *SendMessageRequest) (*Message, error) { Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "reply_markup": req.ReplyMarkup, "input_message_content": req.InputMessageContent, @@ -3081,8 +3139,8 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the replied message or story; pass null if none + ReplyTo MessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album @@ -3100,7 +3158,7 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, "only_preview": req.OnlyPreview, @@ -3154,8 +3212,8 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of a replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the replied message or story; pass null if none + ReplyTo MessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Identifier of the inline query @@ -3175,7 +3233,7 @@ func (client *Client) SendInlineQueryResultMessage(req *SendInlineQueryResultMes Data: map[string]interface{}{ "chat_id": req.ChatId, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "options": req.Options, "query_id": req.QueryId, "result_id": req.ResultId, @@ -3269,39 +3327,13 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err return UnmarshalMessages(result.Data) } -type SendChatScreenshotTakenNotificationRequest struct { - // Chat identifier - ChatId int64 `json:"chat_id"` -} - -// Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats -func (client *Client) SendChatScreenshotTakenNotification(req *SendChatScreenshotTakenNotificationRequest) (*Ok, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "sendChatScreenshotTakenNotification", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalOk(result.Data) -} - type AddLocalMessageRequest struct { // Target chat ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the replied message or story; pass null if none + ReplyTo MessageReplyTo `json:"reply_to"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // The content of the message to be added @@ -3317,7 +3349,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er Data: map[string]interface{}{ "chat_id": req.ChatId, "sender_id": req.SenderId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, "disable_notification": req.DisableNotification, "input_message_content": req.InputMessageContent, }, @@ -4404,7 +4436,7 @@ func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest) } type GetTextEntitiesRequest struct { - // The text in which to look for entites + // The text in which to look for entities Text string `json:"text"` } @@ -4828,14 +4860,14 @@ type GetPollVotersRequest struct { MessageId int64 `json:"message_id"` // 0-based identifier of the answer option OptionId int32 `json:"option_id"` - // Number of users to skip in the result; must be non-negative + // Number of voters to skip in the result; must be non-negative Offset int32 `json:"offset"` - // The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached + // The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached Limit int32 `json:"limit"` } -// Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib -func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { +// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders, error) { result, err := client.Send(Request{ meta: meta{ Type: "getPollVoters", @@ -4856,7 +4888,7 @@ func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*Users, error) { return nil, buildResponseError(result.Data) } - return UnmarshalUsers(result.Data) + return UnmarshalMessageSenders(result.Data) } type StopPollRequest struct { @@ -5070,7 +5102,7 @@ func (client *Client) ShareChatWithBot(req *ShareChatWithBotRequest) (*Ok, error } type GetInlineQueryResultsRequest struct { - // The identifier of the target bot + // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` // Identifier of the chat where the query was sent ChatId int64 `json:"chat_id"` @@ -5261,7 +5293,7 @@ type SendWebAppDataRequest struct { BotUserId int64 `json:"bot_user_id"` // Text of the keyboardButtonTypeWebApp button, which opened the Web App ButtonText string `json:"button_text"` - // Received data + // The data Data string `json:"data"` } @@ -5301,8 +5333,8 @@ type OpenWebAppRequest struct { ApplicationName string `json:"application_name"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message for the message sent by the Web App; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Identifier of the replied message or story for the message sent by the Web App; pass null if none + ReplyTo MessageReplyTo `json:"reply_to"` } // Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once @@ -5318,7 +5350,7 @@ func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) { "theme": req.Theme, "application_name": req.ApplicationName, "message_thread_id": req.MessageThreadId, - "reply_to_message_id": req.ReplyToMessageId, + "reply_to": req.ReplyTo, }, }) if err != nil { @@ -5941,6 +5973,12 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(result.Data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(result.Data) @@ -5950,9 +5988,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeEditProfileSettings: return UnmarshalInternalLinkTypeEditProfileSettings(result.Data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(result.Data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(result.Data) @@ -6004,6 +6039,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(result.Data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(result.Data) @@ -6503,19 +6541,19 @@ func (client *Client) AddChatToList(req *AddChatToListRequest) (*Ok, error) { return UnmarshalOk(result.Data) } -type GetChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type GetChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -// Returns information about a chat filter by its identifier -func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, error) { +// Returns information about a chat folder by its identifier +func (client *Client) GetChatFolder(req *GetChatFolderRequest) (*ChatFolder, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getChatFilter", + Type: "getChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, }, }) if err != nil { @@ -6526,22 +6564,22 @@ func (client *Client) GetChatFilter(req *GetChatFilterRequest) (*ChatFilter, err return nil, buildResponseError(result.Data) } - return UnmarshalChatFilter(result.Data) + return UnmarshalChatFolder(result.Data) } -type CreateChatFilterRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type CreateChatFolderRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` } -// Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium -func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilterInfo, error) { +// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium +func (client *Client) CreateChatFolder(req *CreateChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "createChatFilter", + Type: "createChatFolder", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -6552,25 +6590,25 @@ func (client *Client) CreateChatFilter(req *CreateChatFilterRequest) (*ChatFilte return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type EditChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` - // The edited chat filter - Filter *ChatFilter `json:"filter"` +type EditChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // The edited chat folder + Folder *ChatFolder `json:"folder"` } -// Edits existing chat filter. Returns information about the edited chat filter -func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInfo, error) { +// Edits existing chat folder. Returns information about the edited chat folder +func (client *Client) EditChatFolder(req *EditChatFolderRequest) (*ChatFolderInfo, error) { result, err := client.Send(Request{ meta: meta{ - Type: "editChatFilter", + Type: "editChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, - "filter": req.Filter, + "chat_folder_id": req.ChatFolderId, + "folder": req.Folder, }, }) if err != nil { @@ -6581,22 +6619,25 @@ func (client *Client) EditChatFilter(req *EditChatFilterRequest) (*ChatFilterInf return nil, buildResponseError(result.Data) } - return UnmarshalChatFilterInfo(result.Data) + return UnmarshalChatFolderInfo(result.Data) } -type DeleteChatFilterRequest struct { - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` +type DeleteChatFolderRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the chats to leave. The chats must be pinned or always included in the folder + LeaveChatIds []int64 `json:"leave_chat_ids"` } -// Deletes existing chat filter -func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error) { +// Deletes existing chat folder +func (client *Client) DeleteChatFolder(req *DeleteChatFolderRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "deleteChatFilter", + Type: "deleteChatFolder", }, Data: map[string]interface{}{ - "chat_filter_id": req.ChatFilterId, + "chat_folder_id": req.ChatFolderId, + "leave_chat_ids": req.LeaveChatIds, }, }) if err != nil { @@ -6610,21 +6651,73 @@ func (client *Client) DeleteChatFilter(req *DeleteChatFilterRequest) (*Ok, error return UnmarshalOk(result.Data) } -type ReorderChatFiltersRequest struct { - // Identifiers of chat filters in the new correct order - ChatFilterIds []int32 `json:"chat_filter_ids"` - // Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users +type GetChatFolderChatsToLeaveRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted +func (client *Client) GetChatFolderChatsToLeave(req *GetChatFolderChatsToLeaveRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderChatsToLeave", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type GetChatFolderChatCountRequest struct { + // The new chat folder + Folder *ChatFolder `json:"folder"` +} + +// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly +func (client *Client) GetChatFolderChatCount(req *GetChatFolderChatCountRequest) (*Count, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderChatCount", + }, + Data: map[string]interface{}{ + "folder": req.Folder, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCount(result.Data) +} + +type ReorderChatFoldersRequest struct { + // Identifiers of chat folders in the new correct order + ChatFolderIds []int32 `json:"chat_folder_ids"` + // Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users MainChatListPosition int32 `json:"main_chat_list_position"` } -// Changes the order of chat filters -func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, error) { +// Changes the order of chat folders +func (client *Client) ReorderChatFolders(req *ReorderChatFoldersRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "reorderChatFilters", + Type: "reorderChatFolders", }, Data: map[string]interface{}{ - "chat_filter_ids": req.ChatFilterIds, + "chat_folder_ids": req.ChatFolderIds, "main_chat_list_position": req.MainChatListPosition, }, }) @@ -6639,11 +6732,11 @@ func (client *Client) ReorderChatFilters(req *ReorderChatFiltersRequest) (*Ok, e return UnmarshalOk(result.Data) } -// Returns recommended chat filters for the current user -func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, error) { +// Returns recommended chat folders for the current user +func (client *Client) GetRecommendedChatFolders() (*RecommendedChatFolders, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getRecommendedChatFilters", + Type: "getRecommendedChatFolders", }, Data: map[string]interface{}{}, }) @@ -6655,22 +6748,22 @@ func (client *Client) GetRecommendedChatFilters() (*RecommendedChatFilters, erro return nil, buildResponseError(result.Data) } - return UnmarshalRecommendedChatFilters(result.Data) + return UnmarshalRecommendedChatFolders(result.Data) } -type GetChatFilterDefaultIconNameRequest struct { - // Chat filter - Filter *ChatFilter `json:"filter"` +type GetChatFolderDefaultIconNameRequest struct { + // Chat folder + Folder *ChatFolder `json:"folder"` } -// Returns default icon name for a filter. Can be called synchronously -func GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { +// Returns default icon name for a folder. Can be called synchronously +func GetChatFolderDefaultIconName(req *GetChatFolderDefaultIconNameRequest) (*ChatFolderIcon, error) { result, err := Execute(Request{ meta: meta{ - Type: "getChatFilterDefaultIconName", + Type: "getChatFolderDefaultIconName", }, Data: map[string]interface{}{ - "filter": req.Filter, + "folder": req.Folder, }, }) if err != nil { @@ -6681,13 +6774,316 @@ func GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Te return nil, buildResponseError(result.Data) } - return UnmarshalText(result.Data) + return UnmarshalChatFolderIcon(result.Data) } // deprecated -// Returns default icon name for a filter. Can be called synchronously -func (client *Client) GetChatFilterDefaultIconName(req *GetChatFilterDefaultIconNameRequest) (*Text, error) { - return GetChatFilterDefaultIconName(req)} +// Returns default icon name for a folder. Can be called synchronously +func (client *Client) GetChatFolderDefaultIconName(req *GetChatFolderDefaultIconNameRequest) (*ChatFolderIcon, error) { + return GetChatFolderDefaultIconName(req)} + +type GetChatsForChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link +func (client *Client) GetChatsForChatFolderInviteLink(req *GetChatsForChatFolderInviteLinkRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsForChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CreateChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Name of the link; 0-32 characters + Name string `json:"name"` + // Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation + ChatIds []int64 `json:"chat_ids"` +} + +// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats +func (client *Client) CreateChatFolderInviteLink(req *CreateChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type GetChatFolderInviteLinksRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns invite links created by the current user for a shareable chat folder +func (client *Client) GetChatFolderInviteLinks(req *GetChatFolderInviteLinksRequest) (*ChatFolderInviteLinks, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderInviteLinks", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinks(result.Data) +} + +type EditChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be edited + InviteLink string `json:"invite_link"` + // New name of the link; 0-32 characters + Name string `json:"name"` + // New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing + ChatIds []int64 `json:"chat_ids"` +} + +// Edits an invite link for a chat folder +func (client *Client) EditChatFolderInviteLink(req *EditChatFolderInviteLinkRequest) (*ChatFolderInviteLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + "name": req.Name, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLink(result.Data) +} + +type DeleteChatFolderInviteLinkRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Invite link to be deleted + InviteLink string `json:"invite_link"` +} + +// Deletes an invite link for a chat folder +func (client *Client) DeleteChatFolderInviteLink(req *DeleteChatFolderInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CheckChatFolderInviteLinkRequest struct { + // Invite link to be checked + InviteLink string `json:"invite_link"` +} + +// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder +func (client *Client) CheckChatFolderInviteLink(req *CheckChatFolderInviteLinkRequest) (*ChatFolderInviteLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkChatFolderInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatFolderInviteLinkInfo(result.Data) +} + +type AddChatFolderByInviteLinkRequest struct { + // Invite link for the chat folder + InviteLink string `json:"invite_link"` + // Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet + ChatIds []int64 `json:"chat_ids"` +} + +// Adds a chat folder by an invite link +func (client *Client) AddChatFolderByInviteLink(req *AddChatFolderByInviteLinkRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addChatFolderByInviteLink", + }, + Data: map[string]interface{}{ + "invite_link": req.InviteLink, + "chat_ids": req.ChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` +} + +// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder +func (client *Client) GetChatFolderNewChats(req *GetChatFolderNewChatsRequest) (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type ProcessChatFolderNewChatsRequest struct { + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` + // Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet + AddedChatIds []int64 `json:"added_chat_ids"` +} + +// Process new chats added to a shareable chat folder by its owner +func (client *Client) ProcessChatFolderNewChats(req *ProcessChatFolderNewChatsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "processChatFolderNewChats", + }, + Data: map[string]interface{}{ + "chat_folder_id": req.ChatFolderId, + "added_chat_ids": req.AddedChatIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) GetArchiveChatListSettings() (*ArchiveChatListSettings, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getArchiveChatListSettings", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalArchiveChatListSettings(result.Data) +} + +type SetArchiveChatListSettingsRequest struct { + // New settings + Settings *ArchiveChatListSettings `json:"settings"` +} + +// Changes settings for automatic moving of chats to and from the Archive chat lists +func (client *Client) SetArchiveChatListSettings(req *SetArchiveChatListSettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setArchiveChatListSettings", + }, + 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) +} type SetChatTitleRequest struct { // Chat identifier @@ -6805,6 +7201,41 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetChatBackgroundRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The input background to use; pass null to create a new filled background or to remove the current background + Background InputBackground `json:"background"` + // Background type; pass null to remove the current background + Type BackgroundType `json:"type"` + // Dimming of the background in dark themes, as a percentage; 0-100 + DarkThemeDimming int32 `json:"dark_theme_dimming"` +} + +// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatBackground", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "background": req.Background, + "type": req.Type, + "dark_theme_dimming": req.DarkThemeDimming, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatThemeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -6931,7 +7362,7 @@ type ToggleChatIsTranslatableRequest struct { IsTranslatable bool `json:"is_translatable"` } -// Changes the tranlatable state of a chat; for Telegram Premium users only +// Changes the translatable state of a chat; for Telegram Premium users only func (client *Client) ToggleChatIsTranslatable(req *ToggleChatIsTranslatableRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -7770,7 +8201,7 @@ type GetChatNotificationSettingsExceptionsRequest struct { CompareSound bool `json:"compare_sound"` } -// Returns list of chats with non-default notification settings +// Returns list of chats with non-default notification settings for new messages func (client *Client) GetChatNotificationSettingsExceptions(req *GetChatNotificationSettingsExceptionsRequest) (*Chats, error) { result, err := client.Send(Request{ meta: meta{ @@ -7927,6 +8358,507 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type ReadChatListRequest struct { + // Chat list in which to mark all chats as read + ChatList ChatList `json:"chat_list"` +} + +// 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{ + Type: "readChatList", + }, + Data: map[string]interface{}{ + "chat_list": req.ChatList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryRequest struct { + // Identifier of the chat that posted the story + 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 + OnlyLocal bool `json:"only_local"` +} + +// Returns a story +func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "only_local": req.OnlyLocal, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +type SendStoryRequest struct { + // Content of the story + Content InputStoryContent `json:"content"` + // Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // The privacy settings for the story + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, 2 * 86400, 3 * 86400, or 7 * 86400 for Telegram Premium users, and 86400 otherwise + ActivePeriod int32 `json:"active_period"` + // Pass true to keep the story accessible after expiration + IsPinned bool `json:"is_pinned"` + // Pass true if the content of the story must be protected from forwarding and screenshotting + ProtectContent bool `json:"protect_content"` +} + +// Sends a new story. Returns a temporary story with identifier 0 +func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendStory", + }, + Data: map[string]interface{}{ + "content": req.Content, + "caption": req.Caption, + "privacy_settings": req.PrivacySettings, + "active_period": req.ActivePeriod, + "is_pinned": req.IsPinned, + "protect_content": req.ProtectContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStory(result.Data) +} + +type EditStoryRequest struct { + // Identifier of the story to edit + StoryId int32 `json:"story_id"` + // New content of the story; pass null to keep the current content + Content InputStoryContent `json:"content"` + // New story caption; pass null to keep the current caption + Caption *FormattedText `json:"caption"` +} + +// Changes content and caption of a previously sent story +func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editStory", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "content": req.Content, + "caption": req.Caption, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetStoryPrivacySettingsRequest struct { + // Identifier of the story + StoryId int32 `json:"story_id"` + // The new privacy settigs for the story + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` +} + +// Changes privacy settings of a previously sent story +func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setStoryPrivacySettings", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "privacy_settings": req.PrivacySettings, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleStoryIsPinnedRequest struct { + // Identifier of the story + StoryId int32 `json:"story_id"` + // Pass true to make the story accessible after expiration; pass false to make it private + IsPinned bool `json:"is_pinned"` +} + +// Toggles whether a story is accessible after expiration +func (client *Client) ToggleStoryIsPinned(req *ToggleStoryIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "toggleStoryIsPinned", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteStoryRequest struct { + // Identifier of the story to delete + StoryId int32 `json:"story_id"` +} + +// Deletes a previously sent story +func (client *Client) DeleteStory(req *DeleteStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteStory", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns list of chats with non-default notification settings for stories +func (client *Client) GetStoryNotificationSettingsExceptions() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryNotificationSettingsExceptions", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type LoadActiveStoriesRequest struct { + // The story list in which to load active stories + 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_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{ + Type: "loadActiveStories", + }, + Data: map[string]interface{}{ + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SetChatActiveStoriesListRequest struct { + // Identifier of the chat that posted stories + ChatId int64 `json:"chat_id"` + // New list for active stories posted by the chat + StoryList StoryList `json:"story_list"` +} + +// Changes story list in which stories from the chat are shown +func (client *Client) SetChatActiveStoriesList(req *SetChatActiveStoriesListRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatActiveStoriesList", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "story_list": req.StoryList, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetChatActiveStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Returns the list of active stories posted by the given chat +func (client *Client) GetChatActiveStories(req *GetChatActiveStoriesRequest) (*ChatActiveStories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatActiveStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatActiveStories(result.Data) +} + +type GetChatPinnedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // 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 pinned stories posted by the given chat. The stories are returned in a 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) GetChatPinnedStories(req *GetChatPinnedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatPinnedStories", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type GetArchivedStoriesRequest struct { + // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story + FromStoryId int32 `json:"from_story_id"` + // 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 all stories of the current user. The stories are returned in a 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) GetArchivedStories(req *GetArchivedStoriesRequest) (*Stories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getArchivedStories", + }, + Data: map[string]interface{}{ + "from_story_id": req.FromStoryId, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStories(result.Data) +} + +type OpenStoryRequest struct { + // 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"` +} + +// Informs TDLib that a story is opened and is being viewed by the user +func (client *Client) OpenStory(req *OpenStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "openStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type CloseStoryRequest struct { + // 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"` +} + +// Informs TDLib that a story is closed by the user +func (client *Client) CloseStory(req *CloseStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "closeStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetStoryViewersRequest struct { + // Story identifier + StoryId int32 `json:"story_id"` + // A viewer from which to return next viewers; pass null to get results from the beginning + OffsetViewer *MessageViewer `json:"offset_viewer"` + // The maximum number of story viewers to return 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 viewers of a recent outgoing story. The method can be called if story.can_get_viewers == true. The views are returned in a reverse chronological order (i.e., in order of decreasing view_date) For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*MessageViewers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStoryViewers", + }, + Data: map[string]interface{}{ + "story_id": req.StoryId, + "offset_viewer": req.OffsetViewer, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageViewers(result.Data) +} + +type ReportStoryRequest struct { + // 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"` + // The reason for reporting the story + Reason ReportReason `json:"reason"` + // Additional report details; 0-1024 characters + Text string `json:"text"` +} + +// Reports a story to the Telegram moderators +func (client *Client) ReportStory(req *ReportStoryRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reportStory", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "reason": req.Reason, + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetAttachmentMenuBotRequest struct { // Bot's user identifier BotUserId int64 `json:"bot_user_id"` @@ -10030,7 +10962,7 @@ type ToggleGroupCallParticipantIsMutedRequest struct { GroupCallId int32 `json:"group_call_id"` // Participant identifier ParticipantId MessageSender `json:"participant_id"` - // Pass true to mute the user; pass false to unmute the them + // Pass true to mute the user; pass false to unmute them IsMuted bool `json:"is_muted"` } @@ -10414,7 +11346,7 @@ func (client *Client) ImportContacts(req *ImportContactsRequest) (*ImportedConta return UnmarshalImportedContacts(result.Data) } -// Returns all user contacts +// Returns all contacts of the user func (client *Client) GetContacts() (*Users, error) { result, err := client.Send(Request{ meta: meta{ @@ -10552,6 +11484,51 @@ func (client *Client) ClearImportedContacts() (*Ok, error) { return UnmarshalOk(result.Data) } +type SetCloseFriendsRequest struct { + // User identifiers of close friends; the users must be contacts of the current user + UserIds []int64 `json:"user_ids"` +} + +// Changes the list of close friends of the current user +func (client *Client) SetCloseFriends(req *SetCloseFriendsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setCloseFriends", + }, + Data: map[string]interface{}{ + "user_ids": req.UserIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +// Returns all close friends of the current user +func (client *Client) GetCloseFriends() (*Users, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCloseFriends", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUsers(result.Data) +} + type SetUserPersonalProfilePhotoRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -11875,8 +12852,6 @@ func (client *Client) ReorderActiveUsernames(req *ReorderActiveUsernamesRequest) type SetEmojiStatusRequest struct { // New emoji status; pass null to switch to the default badge EmojiStatus *EmojiStatus `json:"emoji_status"` - // Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually - Duration int32 `json:"duration"` } // Changes the emoji status of the current user; for Telegram Premium users only @@ -11887,7 +12862,6 @@ func (client *Client) SetEmojiStatus(req *SetEmojiStatusRequest) (*Ok, error) { }, Data: map[string]interface{}{ "emoji_status": req.EmojiStatus, - "duration": req.Duration, }, }) if err != nil { @@ -11934,7 +12908,7 @@ type ChangePhoneNumberRequest struct { Settings *PhoneNumberAuthenticationSettings `json:"settings"` } -// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code +// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code func (client *Client) ChangePhoneNumber(req *ChangePhoneNumberRequest) (*AuthenticationCodeInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -12243,20 +13217,174 @@ func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChanne return UnmarshalOk(result.Data) } +type SetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name + LanguageCode string `json:"language_code"` + // New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty + Name string `json:"name"` +} + +// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) SetBotName(req *SetBotNameRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "name": req.Name, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetBotNameRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code or an empty string + LanguageCode string `json:"language_code"` +} + +// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) GetBotName(req *GetBotNameRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotName", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type SetBotProfilePhotoRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // Profile photo to set; pass null to delete the chat photo + Photo InputChatPhoto `json:"photo"` +} + +// Changes a profile photo for a bot +func (client *Client) SetBotProfilePhoto(req *SetBotProfilePhotoRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBotProfilePhoto", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "photo": req.Photo, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ToggleBotUsernameIsActiveRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The username to change + Username string `json:"username"` + // Pass true to activate the username; pass false to disable it + IsActive bool `json:"is_active"` +} + +// 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{ + Type: "toggleBotUsernameIsActive", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "username": req.Username, + "is_active": req.IsActive, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type ReorderBotActiveUsernamesRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The new order of active usernames. All currently active usernames must be specified + Usernames []string `json:"usernames"` +} + +// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true +func (client *Client) ReorderBotActiveUsernames(req *ReorderBotActiveUsernamesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderBotActiveUsernames", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "usernames": req.Usernames, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetBotInfoDescriptionRequest struct { - // A two-letter ISO 639-1 language code. If empty, the description will be shown to all users, for which language there are no dedicated description + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description LanguageCode string `json:"language_code"` // New bot's description on the specified language Description string `json:"description"` } -// Sets the text shown in the chat with the bot if the chat is empty; bots only +// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true func (client *Client) SetBotInfoDescription(req *SetBotInfoDescriptionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setBotInfoDescription", }, Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, "language_code": req.LanguageCode, "description": req.Description, }, @@ -12273,17 +13401,20 @@ func (client *Client) SetBotInfoDescription(req *SetBotInfoDescriptionRequest) ( } type GetBotInfoDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } -// Returns the text shown in the chat with the bot if the chat is empty in the given language; bots only +// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true func (client *Client) GetBotInfoDescription(req *GetBotInfoDescriptionRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ Type: "getBotInfoDescription", }, Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, "language_code": req.LanguageCode, }, }) @@ -12299,19 +13430,22 @@ func (client *Client) GetBotInfoDescription(req *GetBotInfoDescriptionRequest) ( } type SetBotInfoShortDescriptionRequest struct { - // A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users, for which language there are no dedicated description + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description LanguageCode string `json:"language_code"` // New bot's short description on the specified language ShortDescription string `json:"short_description"` } -// Sets the text shown on the bot's profile page and sent together with the link when users share the bot; bots only +// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true func (client *Client) SetBotInfoShortDescription(req *SetBotInfoShortDescriptionRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setBotInfoShortDescription", }, Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, "language_code": req.LanguageCode, "short_description": req.ShortDescription, }, @@ -12328,17 +13462,20 @@ func (client *Client) SetBotInfoShortDescription(req *SetBotInfoShortDescription } type GetBotInfoShortDescriptionRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` // A two-letter ISO 639-1 language code or an empty string LanguageCode string `json:"language_code"` } -// Returns the text shown on the bot's profile page and sent together with the link when users share the bot in the given language; bots only +// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true func (client *Client) GetBotInfoShortDescription(req *GetBotInfoShortDescriptionRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ Type: "getBotInfoShortDescription", }, Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, "language_code": req.LanguageCode, }, }) @@ -12449,7 +13586,7 @@ func (client *Client) ToggleSessionCanAcceptCalls(req *ToggleSessionCanAcceptCal type ToggleSessionCanAcceptSecretChatsRequest struct { // Session identifier SessionId JsonInt64 `json:"session_id"` - // Pass true to allow accepring secret chats by the session; pass false otherwise + // Pass true to allow accepting secret chats by the session; pass false otherwise CanAcceptSecretChats bool `json:"can_accept_secret_chats"` } @@ -13414,7 +14551,7 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun } type SetBackgroundRequest struct { - // The input background to use; pass null to create a new filled backgrounds or to remove the current background + // The input background to use; pass null to create a new filled background or to remove the current background Background InputBackground `json:"background"` // Background type; pass null to use the default type of the remote background or to remove the current background Type BackgroundType `json:"type"` @@ -14126,7 +15263,7 @@ type ReportChatRequest struct { // Identifiers of reported messages; may be empty to report the whole chat MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -14161,7 +15298,7 @@ type ReportChatPhotoRequest struct { // Identifier of the photo to report. Only full photos from chatPhoto can be reported FileId int32 `json:"file_id"` // The reason for reporting the chat photo - Reason ChatReportReason `json:"reason"` + Reason ReportReason `json:"reason"` // Additional report details; 0-1024 characters Text string `json:"text"` } @@ -16259,7 +17396,7 @@ type AddApplicationChangelogRequest struct { PreviousApplicationVersion string `json:"previous_application_version"` } -// Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed +// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -17246,6 +18383,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(result.Data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(result.Data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(result.Data) @@ -17276,8 +18416,8 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(result.Data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(result.Data) + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(result.Data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(result.Data) @@ -17375,6 +18515,18 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(result.Data) + case TypeUpdateStory: + return UnmarshalUpdateStory(result.Data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(result.Data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(result.Data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(result.Data) + case TypeUpdateOption: return UnmarshalUpdateOption(result.Data) diff --git a/client/type.go b/client/type.go index 81de6c1..0b5c612 100755 --- a/client/type.go +++ b/client/type.go @@ -29,7 +29,9 @@ const ( ClassMessageForwardOrigin = "MessageForwardOrigin" ClassReactionType = "ReactionType" ClassMessageSendingState = "MessageSendingState" + ClassMessageReplyTo = "MessageReplyTo" ClassMessageSource = "MessageSource" + ClassMessageSponsorType = "MessageSponsorType" ClassNotificationSettingsScope = "NotificationSettingsScope" ClassChatType = "ChatType" ClassChatList = "ChatList" @@ -94,12 +96,16 @@ const ( ClassNotificationGroupType = "NotificationGroupType" ClassOptionValue = "OptionValue" ClassJsonValue = "JsonValue" + ClassStoryPrivacySettings = "StoryPrivacySettings" ClassUserPrivacySettingRule = "UserPrivacySettingRule" ClassUserPrivacySetting = "UserPrivacySetting" ClassSessionType = "SessionType" - ClassChatReportReason = "ChatReportReason" + ClassReportReason = "ReportReason" ClassTargetChat = "TargetChat" ClassInternalLinkType = "InternalLinkType" + ClassStoryContent = "StoryContent" + ClassInputStoryContent = "InputStoryContent" + ClassStoryList = "StoryList" ClassFileType = "FileType" ClassNetworkType = "NetworkType" ClassNetworkStatisticsEntry = "NetworkStatisticsEntry" @@ -151,6 +157,9 @@ const ( ClassGame = "Game" ClassWebApp = "WebApp" ClassPoll = "Poll" + ClassBackground = "Background" + ClassBackgrounds = "Backgrounds" + ClassChatBackground = "ChatBackground" ClassProfilePhoto = "ProfilePhoto" ClassChatPhotoInfo = "ChatPhotoInfo" ClassBotCommand = "BotCommand" @@ -209,6 +218,7 @@ const ( ClassMessagePositions = "MessagePositions" ClassMessageCalendarDay = "MessageCalendarDay" ClassMessageCalendar = "MessageCalendar" + ClassMessageSponsor = "MessageSponsor" ClassSponsoredMessage = "SponsoredMessage" ClassSponsoredMessages = "SponsoredMessages" ClassFileDownload = "FileDownload" @@ -217,10 +227,15 @@ const ( ClassChatNotificationSettings = "ChatNotificationSettings" ClassScopeNotificationSettings = "ScopeNotificationSettings" ClassDraftMessage = "DraftMessage" - ClassChatFilter = "ChatFilter" - ClassChatFilterInfo = "ChatFilterInfo" - ClassRecommendedChatFilter = "RecommendedChatFilter" - ClassRecommendedChatFilters = "RecommendedChatFilters" + ClassChatFolderIcon = "ChatFolderIcon" + ClassChatFolder = "ChatFolder" + ClassChatFolderInfo = "ChatFolderInfo" + ClassChatFolderInviteLink = "ChatFolderInviteLink" + ClassChatFolderInviteLinks = "ChatFolderInviteLinks" + ClassChatFolderInviteLinkInfo = "ChatFolderInviteLinkInfo" + ClassRecommendedChatFolder = "RecommendedChatFolder" + ClassRecommendedChatFolders = "RecommendedChatFolders" + ClassArchiveChatListSettings = "ArchiveChatListSettings" ClassChatLists = "ChatLists" ClassChatPosition = "ChatPosition" ClassVideoChat = "VideoChat" @@ -331,8 +346,6 @@ const ( ClassPremiumFeaturePromotionAnimation = "PremiumFeaturePromotionAnimation" ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" - ClassBackground = "Background" - ClassBackgrounds = "Backgrounds" ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassHashtags = "Hashtags" @@ -350,6 +363,12 @@ const ( ClassConnectedWebsites = "ConnectedWebsites" ClassMessageLink = "MessageLink" ClassMessageLinkInfo = "MessageLinkInfo" + ClassStoryVideo = "StoryVideo" + ClassStoryInteractionInfo = "StoryInteractionInfo" + ClassStory = "Story" + ClassStories = "Stories" + ClassStoryInfo = "StoryInfo" + ClassChatActiveStories = "ChatActiveStories" ClassFilePart = "FilePart" ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" ClassStorageStatisticsByChat = "StorageStatisticsByChat" @@ -480,6 +499,9 @@ const ( TypeGame = "game" TypeWebApp = "webApp" TypePoll = "poll" + TypeBackground = "background" + TypeBackgrounds = "backgrounds" + TypeChatBackground = "chatBackground" TypeProfilePhoto = "profilePhoto" TypeChatPhotoInfo = "chatPhotoInfo" TypeUserTypeRegular = "userTypeRegular" @@ -575,6 +597,8 @@ const ( TypeUnreadReaction = "unreadReaction" TypeMessageSendingStatePending = "messageSendingStatePending" TypeMessageSendingStateFailed = "messageSendingStateFailed" + TypeMessageReplyToMessage = "messageReplyToMessage" + TypeMessageReplyToStory = "messageReplyToStory" TypeMessage = "message" TypeMessages = "messages" TypeFoundMessages = "foundMessages" @@ -591,7 +615,13 @@ const ( TypeMessageSourceSearch = "messageSourceSearch" TypeMessageSourceChatEventLog = "messageSourceChatEventLog" TypeMessageSourceNotification = "messageSourceNotification" + TypeMessageSourceScreenshot = "messageSourceScreenshot" TypeMessageSourceOther = "messageSourceOther" + TypeMessageSponsorTypeBot = "messageSponsorTypeBot" + TypeMessageSponsorTypePublicChannel = "messageSponsorTypePublicChannel" + TypeMessageSponsorTypePrivateChannel = "messageSponsorTypePrivateChannel" + TypeMessageSponsorTypeWebsite = "messageSponsorTypeWebsite" + TypeMessageSponsor = "messageSponsor" TypeSponsoredMessage = "sponsoredMessage" TypeSponsoredMessages = "sponsoredMessages" TypeFileDownload = "fileDownload" @@ -607,13 +637,18 @@ const ( TypeChatTypeBasicGroup = "chatTypeBasicGroup" TypeChatTypeSupergroup = "chatTypeSupergroup" TypeChatTypeSecret = "chatTypeSecret" - TypeChatFilter = "chatFilter" - TypeChatFilterInfo = "chatFilterInfo" - TypeRecommendedChatFilter = "recommendedChatFilter" - TypeRecommendedChatFilters = "recommendedChatFilters" + TypeChatFolderIcon = "chatFolderIcon" + TypeChatFolder = "chatFolder" + TypeChatFolderInfo = "chatFolderInfo" + TypeChatFolderInviteLink = "chatFolderInviteLink" + TypeChatFolderInviteLinks = "chatFolderInviteLinks" + TypeChatFolderInviteLinkInfo = "chatFolderInviteLinkInfo" + TypeRecommendedChatFolder = "recommendedChatFolder" + TypeRecommendedChatFolders = "recommendedChatFolders" + TypeArchiveChatListSettings = "archiveChatListSettings" TypeChatListMain = "chatListMain" TypeChatListArchive = "chatListArchive" - TypeChatListFilter = "chatListFilter" + TypeChatListFolder = "chatListFolder" TypeChatLists = "chatLists" TypeChatSourceMtprotoProxy = "chatSourceMtprotoProxy" TypeChatSourcePublicServiceAnnouncement = "chatSourcePublicServiceAnnouncement" @@ -844,6 +879,7 @@ const ( TypeMessageDice = "messageDice" TypeMessageGame = "messageGame" TypeMessagePoll = "messagePoll" + TypeMessageStory = "messageStory" TypeMessageInvoice = "messageInvoice" TypeMessageCall = "messageCall" TypeMessageVideoChatScheduled = "messageVideoChatScheduled" @@ -863,6 +899,7 @@ const ( TypeMessageChatUpgradeFrom = "messageChatUpgradeFrom" TypeMessagePinMessage = "messagePinMessage" TypeMessageScreenshotTaken = "messageScreenshotTaken" + TypeMessageChatSetBackground = "messageChatSetBackground" TypeMessageChatSetTheme = "messageChatSetTheme" TypeMessageChatSetMessageAutoDeleteTime = "messageChatSetMessageAutoDeleteTime" TypeMessageForumTopicCreated = "messageForumTopicCreated" @@ -927,6 +964,7 @@ const ( TypeInputMessageGame = "inputMessageGame" TypeInputMessageInvoice = "inputMessageInvoice" TypeInputMessagePoll = "inputMessagePoll" + TypeInputMessageStory = "inputMessageStory" TypeInputMessageForwarded = "inputMessageForwarded" TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" @@ -1129,11 +1167,14 @@ const ( TypePremiumLimitTypeCreatedPublicChatCount = "premiumLimitTypeCreatedPublicChatCount" TypePremiumLimitTypeSavedAnimationCount = "premiumLimitTypeSavedAnimationCount" TypePremiumLimitTypeFavoriteStickerCount = "premiumLimitTypeFavoriteStickerCount" - TypePremiumLimitTypeChatFilterCount = "premiumLimitTypeChatFilterCount" - TypePremiumLimitTypeChatFilterChosenChatCount = "premiumLimitTypeChatFilterChosenChatCount" + TypePremiumLimitTypeChatFolderCount = "premiumLimitTypeChatFolderCount" + TypePremiumLimitTypeChatFolderChosenChatCount = "premiumLimitTypeChatFolderChosenChatCount" TypePremiumLimitTypePinnedArchivedChatCount = "premiumLimitTypePinnedArchivedChatCount" TypePremiumLimitTypeCaptionLength = "premiumLimitTypeCaptionLength" TypePremiumLimitTypeBioLength = "premiumLimitTypeBioLength" + TypePremiumLimitTypeChatFolderInviteLinkCount = "premiumLimitTypeChatFolderInviteLinkCount" + TypePremiumLimitTypeShareableChatFolderCount = "premiumLimitTypeShareableChatFolderCount" + TypePremiumLimitTypeActiveStoryCount = "premiumLimitTypeActiveStoryCount" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -1178,10 +1219,9 @@ const ( TypeBackgroundTypeWallpaper = "backgroundTypeWallpaper" TypeBackgroundTypePattern = "backgroundTypePattern" TypeBackgroundTypeFill = "backgroundTypeFill" - TypeBackground = "background" - TypeBackgrounds = "backgrounds" TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" + TypeInputBackgroundPrevious = "inputBackgroundPrevious" TypeThemeSettings = "themeSettings" TypeChatTheme = "chatTheme" TypeHashtags = "hashtags" @@ -1218,6 +1258,7 @@ const ( TypePushMessageContentPoll = "pushMessageContentPoll" TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" TypePushMessageContentSticker = "pushMessageContentSticker" + TypePushMessageContentStory = "pushMessageContentStory" TypePushMessageContentText = "pushMessageContentText" TypePushMessageContentVideo = "pushMessageContentVideo" TypePushMessageContentVideoNote = "pushMessageContentVideoNote" @@ -1226,6 +1267,7 @@ const ( TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers" TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto" TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle" + TypePushMessageContentChatSetBackground = "pushMessageContentChatSetBackground" TypePushMessageContentChatSetTheme = "pushMessageContentChatSetTheme" TypePushMessageContentChatDeleteMember = "pushMessageContentChatDeleteMember" TypePushMessageContentChatJoinByLink = "pushMessageContentChatJoinByLink" @@ -1257,6 +1299,10 @@ const ( TypeJsonValueString = "jsonValueString" TypeJsonValueArray = "jsonValueArray" TypeJsonValueObject = "jsonValueObject" + TypeStoryPrivacySettingsEveryone = "storyPrivacySettingsEveryone" + TypeStoryPrivacySettingsContacts = "storyPrivacySettingsContacts" + TypeStoryPrivacySettingsCloseFriends = "storyPrivacySettingsCloseFriends" + TypeStoryPrivacySettingsSelectedContacts = "storyPrivacySettingsSelectedContacts" TypeUserPrivacySettingRuleAllowAll = "userPrivacySettingRuleAllowAll" TypeUserPrivacySettingRuleAllowContacts = "userPrivacySettingRuleAllowContacts" TypeUserPrivacySettingRuleAllowUsers = "userPrivacySettingRuleAllowUsers" @@ -1270,6 +1316,7 @@ const ( TypeUserPrivacySettingShowProfilePhoto = "userPrivacySettingShowProfilePhoto" TypeUserPrivacySettingShowLinkInForwardedMessages = "userPrivacySettingShowLinkInForwardedMessages" TypeUserPrivacySettingShowPhoneNumber = "userPrivacySettingShowPhoneNumber" + TypeUserPrivacySettingShowBio = "userPrivacySettingShowBio" TypeUserPrivacySettingAllowChatInvites = "userPrivacySettingAllowChatInvites" TypeUserPrivacySettingAllowCalls = "userPrivacySettingAllowCalls" TypeUserPrivacySettingAllowPeerToPeerCalls = "userPrivacySettingAllowPeerToPeerCalls" @@ -1298,16 +1345,16 @@ const ( TypeSessions = "sessions" TypeConnectedWebsite = "connectedWebsite" TypeConnectedWebsites = "connectedWebsites" - TypeChatReportReasonSpam = "chatReportReasonSpam" - TypeChatReportReasonViolence = "chatReportReasonViolence" - TypeChatReportReasonPornography = "chatReportReasonPornography" - TypeChatReportReasonChildAbuse = "chatReportReasonChildAbuse" - TypeChatReportReasonCopyright = "chatReportReasonCopyright" - TypeChatReportReasonUnrelatedLocation = "chatReportReasonUnrelatedLocation" - TypeChatReportReasonFake = "chatReportReasonFake" - TypeChatReportReasonIllegalDrugs = "chatReportReasonIllegalDrugs" - TypeChatReportReasonPersonalDetails = "chatReportReasonPersonalDetails" - TypeChatReportReasonCustom = "chatReportReasonCustom" + TypeReportReasonSpam = "reportReasonSpam" + TypeReportReasonViolence = "reportReasonViolence" + TypeReportReasonPornography = "reportReasonPornography" + TypeReportReasonChildAbuse = "reportReasonChildAbuse" + TypeReportReasonCopyright = "reportReasonCopyright" + TypeReportReasonUnrelatedLocation = "reportReasonUnrelatedLocation" + TypeReportReasonFake = "reportReasonFake" + TypeReportReasonIllegalDrugs = "reportReasonIllegalDrugs" + TypeReportReasonPersonalDetails = "reportReasonPersonalDetails" + TypeReportReasonCustom = "reportReasonCustom" TypeTargetChatCurrent = "targetChatCurrent" TypeTargetChatChosen = "targetChatChosen" TypeTargetChatInternalLink = "targetChatInternalLink" @@ -1319,10 +1366,11 @@ const ( TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" + TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" TypeInternalLinkTypeDefaultMessageAutoDeleteTimerSettings = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings" TypeInternalLinkTypeEditProfileSettings = "internalLinkTypeEditProfileSettings" - TypeInternalLinkTypeFilterSettings = "internalLinkTypeFilterSettings" TypeInternalLinkTypeGame = "internalLinkTypeGame" TypeInternalLinkTypeInstantView = "internalLinkTypeInstantView" TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" @@ -1340,6 +1388,7 @@ const ( TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" TypeInternalLinkTypeSettings = "internalLinkTypeSettings" TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" + TypeInternalLinkTypeStory = "internalLinkTypeStory" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" TypeInternalLinkTypeThemeSettings = "internalLinkTypeThemeSettings" TypeInternalLinkTypeUnknownDeepLink = "internalLinkTypeUnknownDeepLink" @@ -1350,6 +1399,19 @@ const ( TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" + TypeStoryVideo = "storyVideo" + TypeStoryContentPhoto = "storyContentPhoto" + TypeStoryContentVideo = "storyContentVideo" + TypeStoryContentUnsupported = "storyContentUnsupported" + TypeInputStoryContentPhoto = "inputStoryContentPhoto" + TypeInputStoryContentVideo = "inputStoryContentVideo" + TypeStoryListMain = "storyListMain" + TypeStoryListArchive = "storyListArchive" + TypeStoryInteractionInfo = "storyInteractionInfo" + TypeStory = "story" + TypeStories = "stories" + TypeStoryInfo = "storyInfo" + TypeChatActiveStories = "chatActiveStories" TypeFilePart = "filePart" TypeFileTypeNone = "fileTypeNone" TypeFileTypeAnimation = "fileTypeAnimation" @@ -1357,6 +1419,7 @@ const ( TypeFileTypeDocument = "fileTypeDocument" TypeFileTypeNotificationSound = "fileTypeNotificationSound" TypeFileTypePhoto = "fileTypePhoto" + TypeFileTypePhotoStory = "fileTypePhotoStory" TypeFileTypeProfilePhoto = "fileTypeProfilePhoto" TypeFileTypeSecret = "fileTypeSecret" TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" @@ -1366,6 +1429,7 @@ const ( TypeFileTypeUnknown = "fileTypeUnknown" TypeFileTypeVideo = "fileTypeVideo" TypeFileTypeVideoNote = "fileTypeVideoNote" + TypeFileTypeVideoStory = "fileTypeVideoStory" TypeFileTypeVoiceNote = "fileTypeVoiceNote" TypeFileTypeWallpaper = "fileTypeWallpaper" TypeStorageStatisticsByFileType = "storageStatisticsByFileType" @@ -1415,6 +1479,7 @@ const ( TypeSuggestedActionConvertToBroadcastGroup = "suggestedActionConvertToBroadcastGroup" TypeSuggestedActionSetPassword = "suggestedActionSetPassword" TypeSuggestedActionUpgradePremium = "suggestedActionUpgradePremium" + TypeSuggestedActionRestorePremium = "suggestedActionRestorePremium" TypeSuggestedActionSubscribeToAnnualPremium = "suggestedActionSubscribeToAnnualPremium" TypeCount = "count" TypeText = "text" @@ -1480,6 +1545,7 @@ const ( TypeUpdateChatNotificationSettings = "updateChatNotificationSettings" TypeUpdateChatPendingJoinRequests = "updateChatPendingJoinRequests" TypeUpdateChatReplyMarkup = "updateChatReplyMarkup" + TypeUpdateChatBackground = "updateChatBackground" TypeUpdateChatTheme = "updateChatTheme" TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" @@ -1490,7 +1556,7 @@ const ( TypeUpdateChatIsMarkedAsUnread = "updateChatIsMarkedAsUnread" TypeUpdateChatIsBlocked = "updateChatIsBlocked" TypeUpdateChatHasScheduledMessages = "updateChatHasScheduledMessages" - TypeUpdateChatFilters = "updateChatFilters" + TypeUpdateChatFolders = "updateChatFolders" TypeUpdateChatOnlineMemberCount = "updateChatOnlineMemberCount" TypeUpdateForumTopicInfo = "updateForumTopicInfo" TypeUpdateScopeNotificationSettings = "updateScopeNotificationSettings" @@ -1523,6 +1589,10 @@ const ( TypeUpdateUserPrivacySettingRules = "updateUserPrivacySettingRules" TypeUpdateUnreadMessageCount = "updateUnreadMessageCount" TypeUpdateUnreadChatCount = "updateUnreadChatCount" + TypeUpdateStory = "updateStory" + TypeUpdateStoryDeleted = "updateStoryDeleted" + TypeUpdateChatActiveStories = "updateChatActiveStories" + TypeUpdateStoryListChatCount = "updateStoryListChatCount" TypeUpdateOption = "updateOption" TypeUpdateStickerSet = "updateStickerSet" TypeUpdateInstalledStickerSets = "updateInstalledStickerSets" @@ -1685,11 +1755,21 @@ type MessageSendingState interface { MessageSendingStateType() string } +// Contains information about the message or the story a message is replying to +type MessageReplyTo interface { + MessageReplyToType() string +} + // Describes source of a message type MessageSource interface { MessageSourceType() string } +// Describes type of a message sponsor +type MessageSponsorType interface { + MessageSponsorTypeType() string +} + // Describes the types of chats to which notification settings are relevant type NotificationSettingsScope interface { NotificationSettingsScopeType() string @@ -2010,7 +2090,12 @@ type JsonValue interface { JsonValueType() string } -// Represents a single rule for managing privacy settings +// Describes privacy settings of a story +type StoryPrivacySettings interface { + StoryPrivacySettingsType() string +} + +// Represents a single rule for managing user privacy settings type UserPrivacySettingRule interface { UserPrivacySettingRuleType() string } @@ -2026,8 +2111,8 @@ type SessionType interface { } // Describes the reason why a chat is reported -type ChatReportReason interface { - ChatReportReasonType() string +type ReportReason interface { + ReportReasonType() string } // Describes the target chat to be opened @@ -2040,6 +2125,21 @@ type InternalLinkType interface { InternalLinkTypeType() string } +// Contains the content of a story +type StoryContent interface { + StoryContentType() string +} + +// The content of a story to send +type InputStoryContent interface { + InputStoryContentType() string +} + +// Describes a list of stories +type StoryList interface { + StoryListType() string +} + // Represents the type of a file type FileType interface { FileTypeType() string @@ -2729,7 +2829,7 @@ func (*TermsOfService) GetType() string { return TypeTermsOfService } -// Initializetion parameters are needed. Call setTdlibParameters to provide them +// Initialization parameters are needed. Call setTdlibParameters to provide them type AuthorizationStateWaitTdlibParameters struct{ meta } @@ -4311,7 +4411,7 @@ type Sticker struct { meta // Unique sticker identifier within the set; 0 if none Id JsonInt64 `json:"id"` - // The identifier of the sticker set to which the sticker belongs; 0 if none + // Identifier of the sticker set to which the sticker belongs; 0 if none SetId JsonInt64 `json:"set_id"` // Sticker width; as defined by the sender Width int32 `json:"width"` @@ -4744,8 +4844,8 @@ type Poll struct { Options []*PollOption `json:"options"` // Total number of voters, participating in the poll TotalVoterCount int32 `json:"total_voter_count"` - // User identifiers of recent voters, if the poll is non-anonymous - RecentVoterUserIds []int64 `json:"recent_voter_user_ids"` + // Identifiers of recent voters, if the poll is non-anonymous + RecentVoterIds []MessageSender `json:"recent_voter_ids"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous"` // Type of the poll @@ -4780,7 +4880,7 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { Question string `json:"question"` Options []*PollOption `json:"options"` TotalVoterCount int32 `json:"total_voter_count"` - RecentVoterUserIds []int64 `json:"recent_voter_user_ids"` + RecentVoterIds []json.RawMessage `json:"recent_voter_ids"` IsAnonymous bool `json:"is_anonymous"` Type json.RawMessage `json:"type"` OpenPeriod int32 `json:"open_period"` @@ -4797,18 +4897,128 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { poll.Question = tmp.Question poll.Options = tmp.Options poll.TotalVoterCount = tmp.TotalVoterCount - poll.RecentVoterUserIds = tmp.RecentVoterUserIds poll.IsAnonymous = tmp.IsAnonymous poll.OpenPeriod = tmp.OpenPeriod poll.CloseDate = tmp.CloseDate poll.IsClosed = tmp.IsClosed + fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds) + poll.RecentVoterIds = fieldRecentVoterIds + fieldType, _ := UnmarshalPollType(tmp.Type) poll.Type = fieldType return nil } +// Describes a chat background +type Background struct { + meta + // Unique background identifier + Id JsonInt64 `json:"id"` + // True, if this is one of default backgrounds + IsDefault bool `json:"is_default"` + // True, if the background is dark and is recommended to be used with dark theme + IsDark bool `json:"is_dark"` + // Unique background name + Name string `json:"name"` + // Document with the background; may be null. Null only for filled backgrounds + Document *Document `json:"document"` + // Type of the background + Type BackgroundType `json:"type"` +} + +func (entity *Background) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Background + + return json.Marshal((*stub)(entity)) +} + +func (*Background) GetClass() string { + return ClassBackground +} + +func (*Background) GetType() string { + return TypeBackground +} + +func (background *Background) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + IsDefault bool `json:"is_default"` + IsDark bool `json:"is_dark"` + Name string `json:"name"` + Document *Document `json:"document"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + background.Id = tmp.Id + background.IsDefault = tmp.IsDefault + background.IsDark = tmp.IsDark + background.Name = tmp.Name + background.Document = tmp.Document + + fieldType, _ := UnmarshalBackgroundType(tmp.Type) + background.Type = fieldType + + return nil +} + +// Contains a list of backgrounds +type Backgrounds struct { + meta + // A list of backgrounds + Backgrounds []*Background `json:"backgrounds"` +} + +func (entity *Backgrounds) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Backgrounds + + return json.Marshal((*stub)(entity)) +} + +func (*Backgrounds) GetClass() string { + return ClassBackgrounds +} + +func (*Backgrounds) GetType() string { + return TypeBackgrounds +} + +// Describes a background set for a specific chat +type ChatBackground struct { + meta + // The background + Background *Background `json:"background"` + // Dimming of the background in dark themes, as a percentage; 0-100 + DarkThemeDimming int32 `json:"dark_theme_dimming"` +} + +func (entity *ChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBackground) GetClass() string { + return ClassChatBackground +} + +func (*ChatBackground) GetType() string { + return TypeChatBackground +} + // Describes a user profile photo type ProfilePhoto struct { meta @@ -4926,6 +5136,8 @@ func (*UserTypeDeleted) UserTypeType() string { // A bot (see https://core.telegram.org/bots) type UserTypeBot struct { meta + // True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription + CanBeEdited bool `json:"can_be_edited"` // True, if the bot can be invited to basic group and supergroup chats CanJoinGroups bool `json:"can_join_groups"` // True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages @@ -5612,6 +5824,8 @@ type EmojiStatus struct { meta // Identifier of the custom emoji in stickerFormatTgs format CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // Point in time (Unix timestamp) when the status will expire; 0 if never + ExpirationDate int32 `json:"expiration_date"` } func (entity *EmojiStatus) MarshalJSON() ([]byte, error) { @@ -5630,11 +5844,11 @@ func (*EmojiStatus) GetType() string { return TypeEmojiStatus } -// Contains a list of emoji statuses +// Contains a list of custom emoji identifiers, which can be set as emoji statuses type EmojiStatuses struct { meta - // The list of emoji statuses - EmojiStatuses []*EmojiStatus `json:"emoji_statuses"` + // The list of custom emoji identifiers + CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"` } func (entity *EmojiStatuses) MarshalJSON() ([]byte, error) { @@ -5656,11 +5870,11 @@ func (*EmojiStatuses) GetType() string { // Describes usernames assigned to a user, a supergroup, or a channel type Usernames struct { meta - // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames + // List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames ActiveUsernames []string `json:"active_usernames"` - // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive + // List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive DisabledUsernames []string `json:"disabled_usernames"` - // The active username, which can be changed with setUsername/setSupergroupUsername + // The active username, which can be changed with setUsername or setSupergroupUsername EditableUsername string `json:"editable_username"` } @@ -5705,6 +5919,8 @@ type User struct { IsContact bool `json:"is_contact"` // The user is a contact of the current user and the current user is a contact of the user IsMutualContact bool `json:"is_mutual_contact"` + // The user is a close friend of the current user; implies that the user is a contact + IsCloseFriend bool `json:"is_close_friend"` // True, if the user is verified IsVerified bool `json:"is_verified"` // True, if the user is a Telegram Premium user @@ -5717,6 +5933,10 @@ type User struct { IsScam bool `json:"is_scam"` // True, if many users reported this user as a fake account IsFake bool `json:"is_fake"` + // 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"` // If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method HaveAccess bool `json:"have_access"` // Type of the user @@ -5756,12 +5976,15 @@ func (user *User) UnmarshalJSON(data []byte) error { EmojiStatus *EmojiStatus `json:"emoji_status"` IsContact bool `json:"is_contact"` IsMutualContact bool `json:"is_mutual_contact"` + IsCloseFriend bool `json:"is_close_friend"` IsVerified bool `json:"is_verified"` IsPremium bool `json:"is_premium"` IsSupport bool `json:"is_support"` RestrictionReason string `json:"restriction_reason"` IsScam bool `json:"is_scam"` IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` HaveAccess bool `json:"have_access"` Type json.RawMessage `json:"type"` LanguageCode string `json:"language_code"` @@ -5783,12 +6006,15 @@ func (user *User) UnmarshalJSON(data []byte) error { user.EmojiStatus = tmp.EmojiStatus user.IsContact = tmp.IsContact user.IsMutualContact = tmp.IsMutualContact + user.IsCloseFriend = tmp.IsCloseFriend user.IsVerified = tmp.IsVerified user.IsPremium = tmp.IsPremium user.IsSupport = tmp.IsSupport user.RestrictionReason = tmp.RestrictionReason user.IsScam = tmp.IsScam user.IsFake = tmp.IsFake + user.HasActiveStories = tmp.HasActiveStories + user.HasUnreadActiveStories = tmp.HasUnreadActiveStories user.HaveAccess = tmp.HaveAccess user.LanguageCode = tmp.LanguageCode user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu @@ -5821,6 +6047,14 @@ type BotInfo struct { DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` // Default administrator rights for adding the bot to channels; may be null DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + // The internal link, which can be used to edit bot commands; may be null + EditCommandsLink InternalLinkType `json:"edit_commands_link"` + // The internal link, which can be used to edit bot description; may be null + EditDescriptionLink InternalLinkType `json:"edit_description_link"` + // The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null + EditDescriptionMediaLink InternalLinkType `json:"edit_description_media_link"` + // The internal link, which can be used to edit bot settings; may be null + EditSettingsLink InternalLinkType `json:"edit_settings_link"` } func (entity *BotInfo) MarshalJSON() ([]byte, error) { @@ -5839,6 +6073,51 @@ func (*BotInfo) GetType() string { return TypeBotInfo } +func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + ShortDescription string `json:"short_description"` + Description string `json:"description"` + Photo *Photo `json:"photo"` + Animation *Animation `json:"animation"` + MenuButton *BotMenuButton `json:"menu_button"` + Commands []*BotCommand `json:"commands"` + DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` + DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + EditCommandsLink json.RawMessage `json:"edit_commands_link"` + EditDescriptionLink json.RawMessage `json:"edit_description_link"` + EditDescriptionMediaLink json.RawMessage `json:"edit_description_media_link"` + EditSettingsLink json.RawMessage `json:"edit_settings_link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + botInfo.ShortDescription = tmp.ShortDescription + botInfo.Description = tmp.Description + botInfo.Photo = tmp.Photo + botInfo.Animation = tmp.Animation + botInfo.MenuButton = tmp.MenuButton + botInfo.Commands = tmp.Commands + botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights + botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights + + fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink) + botInfo.EditCommandsLink = fieldEditCommandsLink + + fieldEditDescriptionLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionLink) + botInfo.EditDescriptionLink = fieldEditDescriptionLink + + fieldEditDescriptionMediaLink, _ := UnmarshalInternalLinkType(tmp.EditDescriptionMediaLink) + botInfo.EditDescriptionMediaLink = fieldEditDescriptionMediaLink + + fieldEditSettingsLink, _ := UnmarshalInternalLinkType(tmp.EditSettingsLink) + botInfo.EditSettingsLink = fieldEditSettingsLink + + return nil +} + // Contains full information about a user type UserFullInfo struct { meta @@ -5860,6 +6139,8 @@ type UserFullInfo struct { HasPrivateForwards bool `json:"has_private_forwards"` // True, if voice and video notes can't be sent or forwarded to the user HasRestrictedVoiceAndVideoNoteMessages bool `json:"has_restricted_voice_and_video_note_messages"` + // True, if the user has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` // True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` // A short user bio; may be null for bots @@ -6728,6 +7009,8 @@ type ChatInviteLinkMember struct { UserId int64 `json:"user_id"` // Point in time (Unix timestamp) when the user joined the chat JoinedChatDate int32 `json:"joined_chat_date"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` // User identifier of the chat administrator, approved user join request ApproverUserId int64 `json:"approver_user_id"` } @@ -7036,7 +7319,7 @@ 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 searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules + // 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 searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids MemberCount int32 `json:"member_count"` // 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"` @@ -7162,8 +7445,6 @@ type SupergroupFullInfo struct { HasHiddenMembers bool `json:"has_hidden_members"` // True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators CanHideMembers bool `json:"can_hide_members"` - // True, if the chat username can be changed - CanSetUsername bool `json:"can_set_username"` // True, if the supergroup sticker set can be changed CanSetStickerSet bool `json:"can_set_sticker_set"` // True, if the supergroup location can be changed @@ -8056,6 +8337,64 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { return TypeMessageSendingStateFailed } +// Describes a replied message +type MessageReplyToMessage struct { + meta + // The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats + ChatId int64 `json:"chat_id"` + // The identifier of the replied message + MessageId int64 `json:"message_id"` +} + +func (entity *MessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToMessage) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToMessage) GetType() string { + return TypeMessageReplyToMessage +} + +func (*MessageReplyToMessage) MessageReplyToType() string { + return TypeMessageReplyToMessage +} + +// Describes a replied story +type MessageReplyToStory struct { + meta + // The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the replied story + StoryId int32 `json:"story_id"` +} + +func (entity *MessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageReplyToStory) GetClass() string { + return ClassMessageReplyTo +} + +func (*MessageReplyToStory) GetType() string { + return TypeMessageReplyToStory +} + +func (*MessageReplyToStory) MessageReplyToType() string { + return TypeMessageReplyToStory +} + // Describes a message type Message struct { meta @@ -8113,10 +8452,8 @@ type Message struct { InteractionInfo *MessageInteractionInfo `json:"interaction_info"` // Information about unread reactions added to the message UnreadReactions []*UnreadReaction `json:"unread_reactions"` - // If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id - ReplyInChatId int64 `json:"reply_in_chat_id"` - // If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message or the story this message is replying to; may be null if none + ReplyTo MessageReplyTo `json:"reply_to"` // 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"` // The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires @@ -8184,8 +8521,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { ForwardInfo *MessageForwardInfo `json:"forward_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` UnreadReactions []*UnreadReaction `json:"unread_reactions"` - ReplyInChatId int64 `json:"reply_in_chat_id"` - ReplyToMessageId int64 `json:"reply_to_message_id"` + ReplyTo json.RawMessage `json:"reply_to"` MessageThreadId int64 `json:"message_thread_id"` SelfDestructTime int32 `json:"self_destruct_time"` SelfDestructIn float64 `json:"self_destruct_in"` @@ -8227,8 +8563,6 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.ForwardInfo = tmp.ForwardInfo message.InteractionInfo = tmp.InteractionInfo message.UnreadReactions = tmp.UnreadReactions - message.ReplyInChatId = tmp.ReplyInChatId - message.ReplyToMessageId = tmp.ReplyToMessageId message.MessageThreadId = tmp.MessageThreadId message.SelfDestructTime = tmp.SelfDestructTime message.SelfDestructIn = tmp.SelfDestructIn @@ -8247,6 +8581,9 @@ func (message *Message) UnmarshalJSON(data []byte) error { fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) message.SchedulingState = fieldSchedulingState + fieldReplyTo, _ := UnmarshalMessageReplyTo(tmp.ReplyTo) + message.ReplyTo = fieldReplyTo + fieldContent, _ := UnmarshalMessageContent(tmp.Content) message.Content = fieldContent @@ -8637,6 +8974,31 @@ func (*MessageSourceNotification) MessageSourceType() string { return TypeMessageSourceNotification } +// The message was screenshotted; the source must be used only if the message content was visible during the screenshot +type MessageSourceScreenshot struct{ + meta +} + +func (entity *MessageSourceScreenshot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSourceScreenshot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSourceScreenshot) GetClass() string { + return ClassMessageSource +} + +func (*MessageSourceScreenshot) GetType() string { + return TypeMessageSourceScreenshot +} + +func (*MessageSourceScreenshot) MessageSourceType() string { + return TypeMessageSourceScreenshot +} + // The message is from some other source type MessageSourceOther struct{ meta @@ -8662,6 +9024,208 @@ func (*MessageSourceOther) MessageSourceType() string { return TypeMessageSourceOther } +// The sponsor is a bot +type MessageSponsorTypeBot struct { + meta + // User identifier of the bot + BotUserId int64 `json:"bot_user_id"` + // An internal link to be opened when the sponsored message is clicked + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypeBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeBot + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeBot) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeBot) GetType() string { + return TypeMessageSponsorTypeBot +} + +func (*MessageSponsorTypeBot) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeBot +} + +func (messageSponsorTypeBot *MessageSponsorTypeBot) UnmarshalJSON(data []byte) error { + var tmp struct { + BotUserId int64 `json:"bot_user_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypeBot.BotUserId = tmp.BotUserId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypeBot.Link = fieldLink + + return nil +} + +// The sponsor is a public channel chat +type MessageSponsorTypePublicChannel struct { + meta + // Sponsor chat identifier + ChatId int64 `json:"chat_id"` + // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead + Link InternalLinkType `json:"link"` +} + +func (entity *MessageSponsorTypePublicChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePublicChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePublicChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePublicChannel) GetType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (*MessageSponsorTypePublicChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePublicChannel +} + +func (messageSponsorTypePublicChannel *MessageSponsorTypePublicChannel) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + Link json.RawMessage `json:"link"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsorTypePublicChannel.ChatId = tmp.ChatId + + fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) + messageSponsorTypePublicChannel.Link = fieldLink + + return nil +} + +// The sponsor is a private channel chat +type MessageSponsorTypePrivateChannel struct { + meta + // Title of the chat + Title string `json:"title"` + // Invite link for the channel + InviteLink string `json:"invite_link"` +} + +func (entity *MessageSponsorTypePrivateChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypePrivateChannel + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypePrivateChannel) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypePrivateChannel) GetType() string { + return TypeMessageSponsorTypePrivateChannel +} + +func (*MessageSponsorTypePrivateChannel) MessageSponsorTypeType() string { + return TypeMessageSponsorTypePrivateChannel +} + +// The sponsor is a website +type MessageSponsorTypeWebsite struct { + meta + // URL of the website + Url string `json:"url"` + // Name of the website + Name string `json:"name"` +} + +func (entity *MessageSponsorTypeWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsorTypeWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsorTypeWebsite) GetClass() string { + return ClassMessageSponsorType +} + +func (*MessageSponsorTypeWebsite) GetType() string { + return TypeMessageSponsorTypeWebsite +} + +func (*MessageSponsorTypeWebsite) MessageSponsorTypeType() string { + return TypeMessageSponsorTypeWebsite +} + +// Information about the sponsor of a message +type MessageSponsor struct { + meta + // Type of the sponsor + Type MessageSponsorType `json:"type"` + // Photo of the sponsor; may be null if must not be shown + Photo *ChatPhotoInfo `json:"photo"` + // Additional optional information about the sponsor to be shown along with the message + Info string `json:"info"` +} + +func (entity *MessageSponsor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageSponsor + + return json.Marshal((*stub)(entity)) +} + +func (*MessageSponsor) GetClass() string { + return ClassMessageSponsor +} + +func (*MessageSponsor) GetType() string { + return TypeMessageSponsor +} + +func (messageSponsor *MessageSponsor) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Photo *ChatPhotoInfo `json:"photo"` + Info string `json:"info"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageSponsor.Photo = tmp.Photo + messageSponsor.Info = tmp.Info + + fieldType, _ := UnmarshalMessageSponsorType(tmp.Type) + messageSponsor.Type = fieldType + + return nil +} + // Describes a sponsored message type SponsoredMessage struct { meta @@ -8669,18 +9233,10 @@ type SponsoredMessage struct { MessageId int64 `json:"message_id"` // True, if the message needs to be labeled as "recommended" instead of "sponsored" IsRecommended bool `json:"is_recommended"` - // Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link - SponsorChatId int64 `json:"sponsor_chat_id"` - // Information about the sponsor chat; may be null unless sponsor_chat_id == 0 - SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` - // True, if the sponsor's chat photo must be shown - ShowChatPhoto bool `json:"show_chat_photo"` - // An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead - Link InternalLinkType `json:"link"` // Content of the message. Currently, can be only of the type messageText Content MessageContent `json:"content"` - // If non-empty, information about the sponsor to be shown along with the message - SponsorInfo string `json:"sponsor_info"` + // Information about the sponsor of the message + Sponsor *MessageSponsor `json:"sponsor"` // If non-empty, additional information about the sponsored message to be shown along with the message AdditionalInfo string `json:"additional_info"` } @@ -8705,12 +9261,8 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { var tmp struct { MessageId int64 `json:"message_id"` IsRecommended bool `json:"is_recommended"` - SponsorChatId int64 `json:"sponsor_chat_id"` - SponsorChatInfo *ChatInviteLinkInfo `json:"sponsor_chat_info"` - ShowChatPhoto bool `json:"show_chat_photo"` - Link json.RawMessage `json:"link"` Content json.RawMessage `json:"content"` - SponsorInfo string `json:"sponsor_info"` + Sponsor *MessageSponsor `json:"sponsor"` AdditionalInfo string `json:"additional_info"` } @@ -8721,15 +9273,9 @@ func (sponsoredMessage *SponsoredMessage) UnmarshalJSON(data []byte) error { sponsoredMessage.MessageId = tmp.MessageId sponsoredMessage.IsRecommended = tmp.IsRecommended - sponsoredMessage.SponsorChatId = tmp.SponsorChatId - sponsoredMessage.SponsorChatInfo = tmp.SponsorChatInfo - sponsoredMessage.ShowChatPhoto = tmp.ShowChatPhoto - sponsoredMessage.SponsorInfo = tmp.SponsorInfo + sponsoredMessage.Sponsor = tmp.Sponsor sponsoredMessage.AdditionalInfo = tmp.AdditionalInfo - fieldLink, _ := UnmarshalInternalLinkType(tmp.Link) - sponsoredMessage.Link = fieldLink - fieldContent, _ := UnmarshalMessageContent(tmp.Content) sponsoredMessage.Content = fieldContent @@ -8921,7 +9467,7 @@ func (*NotificationSettingsScopeChannelChats) NotificationSettingsScopeType() st return TypeNotificationSettingsScopeChannelChats } -// Contains information about notification settings for a chat or a froum topic +// Contains information about notification settings for a chat or a forum topic type ChatNotificationSettings struct { meta // If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead @@ -8930,12 +9476,24 @@ type ChatNotificationSettings struct { MuteFor int32 `json:"mute_for"` // If true, the value for the relevant type of chat or the forum chat is used instead of sound_id UseDefaultSound bool `json:"use_default_sound"` - // Identifier of the notification sound to be played; 0 if sound is disabled + // Identifier of the notification sound to be played for messages; 0 if sound is disabled SoundId JsonInt64 `json:"sound_id"` // If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead UseDefaultShowPreview bool `json:"use_default_show_preview"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` + // If true, mute_stories is ignored and the value for the relevant type of chat is used instead + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are received without sound + MuteStories bool `json:"mute_stories"` + // If true, the value for the relevant type of chat is used instead of story_sound_id + 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, show_story_sender is ignored and the value for the relevant type of chat is used instead + 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, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead 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 @@ -8971,6 +9529,14 @@ type ScopeNotificationSettings struct { SoundId JsonInt64 `json:"sound_id"` // True, if message content must be displayed in notifications ShowPreview bool `json:"show_preview"` + // If true, mute_stories is ignored and stories are unmuted only for the first 5 chats from topChatCategoryUsers + UseDefaultMuteStories bool `json:"use_default_mute_stories"` + // True, if story notifications are received without sound + 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 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 @@ -9153,18 +9719,43 @@ func (*ChatTypeSecret) ChatTypeType() string { return TypeChatTypeSecret } -// Represents a filter of user chats -type ChatFilter struct { +// Represents an icon for a chat folder +type ChatFolderIcon struct { meta - // The title of the filter; 1-12 characters without line feeds + // The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" + Name string `json:"name"` +} + +func (entity *ChatFolderIcon) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderIcon + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderIcon) GetClass() string { + return ClassChatFolderIcon +} + +func (*ChatFolderIcon) GetType() string { + return TypeChatFolderIcon +} + +// Represents a folder for user chats +type ChatFolder struct { + meta + // The title of the folder; 1-12 characters without line feeds Title string `json:"title"` - // The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". If empty, use getChatFilterDefaultIconName to get default icon name for the filter - IconName string `json:"icon_name"` - // The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + // The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder + Icon *ChatFolderIcon `json:"icon"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium PinnedChatIds []int64 `json:"pinned_chat_ids"` - // The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + // The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium IncludedChatIds []int64 `json:"included_chat_ids"` - // The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium + // The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium ExcludedChatIds []int64 `json:"excluded_chat_ids"` // True, if muted chats need to be excluded ExcludeMuted bool `json:"exclude_muted"` @@ -9184,95 +9775,203 @@ type ChatFilter struct { IncludeChannels bool `json:"include_channels"` } -func (entity *ChatFilter) MarshalJSON() ([]byte, error) { +func (entity *ChatFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatFilter + type stub ChatFolder return json.Marshal((*stub)(entity)) } -func (*ChatFilter) GetClass() string { - return ClassChatFilter +func (*ChatFolder) GetClass() string { + return ClassChatFolder } -func (*ChatFilter) GetType() string { - return TypeChatFilter +func (*ChatFolder) GetType() string { + return TypeChatFolder } -// Contains basic information about a chat filter -type ChatFilterInfo struct { +// Contains basic information about a chat folder +type ChatFolderInfo struct { meta - // Unique chat filter identifier + // Unique chat folder identifier Id int32 `json:"id"` - // The title of the filter; 1-12 characters without line feeds + // The title of the folder; 1-12 characters without line feeds Title string `json:"title"` - // The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" - IconName string `json:"icon_name"` + // The chosen or default icon for the chat folder + Icon *ChatFolderIcon `json:"icon"` + // True, if at least one link has been created for the folder + IsShareable bool `json:"is_shareable"` + // True, if the chat folder has invite links created by the current user + HasMyInviteLinks bool `json:"has_my_invite_links"` } -func (entity *ChatFilterInfo) MarshalJSON() ([]byte, error) { +func (entity *ChatFolderInfo) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatFilterInfo + type stub ChatFolderInfo return json.Marshal((*stub)(entity)) } -func (*ChatFilterInfo) GetClass() string { - return ClassChatFilterInfo +func (*ChatFolderInfo) GetClass() string { + return ClassChatFolderInfo } -func (*ChatFilterInfo) GetType() string { - return TypeChatFilterInfo +func (*ChatFolderInfo) GetType() string { + return TypeChatFolderInfo } -// Describes a recommended chat filter -type RecommendedChatFilter struct { +// Contains a chat folder invite link +type ChatFolderInviteLink struct { meta - // The chat filter - Filter *ChatFilter `json:"filter"` - // Chat filter description + // The chat folder invite link + InviteLink string `json:"invite_link"` + // Name of the link + Name string `json:"name"` + // Identifiers of chats, included in the link + ChatIds []int64 `json:"chat_ids"` +} + +func (entity *ChatFolderInviteLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLink) GetClass() string { + return ClassChatFolderInviteLink +} + +func (*ChatFolderInviteLink) GetType() string { + return TypeChatFolderInviteLink +} + +// Represents a list of chat folder invite links +type ChatFolderInviteLinks struct { + meta + // List of the invite links + InviteLinks []*ChatFolderInviteLink `json:"invite_links"` +} + +func (entity *ChatFolderInviteLinks) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinks + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinks) GetClass() string { + return ClassChatFolderInviteLinks +} + +func (*ChatFolderInviteLinks) GetType() string { + return TypeChatFolderInviteLinks +} + +// Contains information about an invite link to a chat folder +type ChatFolderInviteLinkInfo struct { + meta + // Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet + ChatFolderInfo *ChatFolderInfo `json:"chat_folder_info"` + // Identifiers of the chats from the link, which aren't added to the folder yet + MissingChatIds []int64 `json:"missing_chat_ids"` + // Identifiers of the chats from the link, which are added to the folder already + AddedChatIds []int64 `json:"added_chat_ids"` +} + +func (entity *ChatFolderInviteLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatFolderInviteLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatFolderInviteLinkInfo) GetClass() string { + return ClassChatFolderInviteLinkInfo +} + +func (*ChatFolderInviteLinkInfo) GetType() string { + return TypeChatFolderInviteLinkInfo +} + +// Describes a recommended chat folder +type RecommendedChatFolder struct { + meta + // The chat folder + Folder *ChatFolder `json:"folder"` + // Chat folder description Description string `json:"description"` } -func (entity *RecommendedChatFilter) MarshalJSON() ([]byte, error) { +func (entity *RecommendedChatFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub RecommendedChatFilter + type stub RecommendedChatFolder return json.Marshal((*stub)(entity)) } -func (*RecommendedChatFilter) GetClass() string { - return ClassRecommendedChatFilter +func (*RecommendedChatFolder) GetClass() string { + return ClassRecommendedChatFolder } -func (*RecommendedChatFilter) GetType() string { - return TypeRecommendedChatFilter +func (*RecommendedChatFolder) GetType() string { + return TypeRecommendedChatFolder } -// Contains a list of recommended chat filters -type RecommendedChatFilters struct { +// Contains a list of recommended chat folders +type RecommendedChatFolders struct { meta - // List of recommended chat filters - ChatFilters []*RecommendedChatFilter `json:"chat_filters"` + // List of recommended chat folders + ChatFolders []*RecommendedChatFolder `json:"chat_folders"` } -func (entity *RecommendedChatFilters) MarshalJSON() ([]byte, error) { +func (entity *RecommendedChatFolders) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub RecommendedChatFilters + type stub RecommendedChatFolders return json.Marshal((*stub)(entity)) } -func (*RecommendedChatFilters) GetClass() string { - return ClassRecommendedChatFilters +func (*RecommendedChatFolders) GetClass() string { + return ClassRecommendedChatFolders } -func (*RecommendedChatFilters) GetType() string { - return TypeRecommendedChatFilters +func (*RecommendedChatFolders) GetType() string { + return TypeRecommendedChatFolders +} + +// Contains settings for automatic moving of chats to and from the Archive chat lists +type ArchiveChatListSettings struct { + meta + // True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true + ArchiveAndMuteNewChatsFromUnknownUsers bool `json:"archive_and_mute_new_chats_from_unknown_users"` + // True, if unmuted chats will be kept in the Archive chat list when they get a new message + KeepUnmutedChatsArchived bool `json:"keep_unmuted_chats_archived"` + // True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true + KeepChatsFromFoldersArchived bool `json:"keep_chats_from_folders_archived"` +} + +func (entity *ArchiveChatListSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ArchiveChatListSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ArchiveChatListSettings) GetClass() string { + return ClassArchiveChatListSettings +} + +func (*ArchiveChatListSettings) GetType() string { + return TypeArchiveChatListSettings } // A main list of chats @@ -9325,31 +10024,31 @@ func (*ChatListArchive) ChatListType() string { return TypeChatListArchive } -// A list of chats belonging to a chat filter -type ChatListFilter struct { +// A list of chats added to a chat folder +type ChatListFolder struct { meta - // Chat filter identifier - ChatFilterId int32 `json:"chat_filter_id"` + // Chat folder identifier + ChatFolderId int32 `json:"chat_folder_id"` } -func (entity *ChatListFilter) MarshalJSON() ([]byte, error) { +func (entity *ChatListFolder) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatListFilter + type stub ChatListFolder return json.Marshal((*stub)(entity)) } -func (*ChatListFilter) GetClass() string { +func (*ChatListFolder) GetClass() string { return ClassChatList } -func (*ChatListFilter) GetType() string { - return TypeChatListFilter +func (*ChatListFolder) GetType() string { + return TypeChatListFolder } -func (*ChatListFilter) ChatListType() string { - return TypeChatListFilter +func (*ChatListFolder) ChatListType() string { + return TypeChatListFolder } // Contains a list of chat lists @@ -9668,6 +10367,8 @@ type Chat struct { AvailableReactions ChatAvailableReactions `json:"available_reactions"` // Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + // Background set for the chat; may be null if none + Background *ChatBackground `json:"background"` // 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 @@ -9727,6 +10428,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { NotificationSettings *ChatNotificationSettings `json:"notification_settings"` AvailableReactions json.RawMessage `json:"available_reactions"` MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` + Background *ChatBackground `json:"background"` ThemeName string `json:"theme_name"` ActionBar json.RawMessage `json:"action_bar"` VideoChat *VideoChat `json:"video_chat"` @@ -9763,6 +10465,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.UnreadReactionCount = tmp.UnreadReactionCount chat.NotificationSettings = tmp.NotificationSettings chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime + chat.Background = tmp.Background chat.ThemeName = tmp.ThemeName chat.VideoChat = tmp.VideoChat chat.PendingJoinRequests = tmp.PendingJoinRequests @@ -9910,7 +10613,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string { return TypePublicChatTypeIsLocationBased } -// The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown type ChatActionBarReportSpam struct { meta // If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings @@ -9937,7 +10640,7 @@ func (*ChatActionBarReportSpam) ChatActionBarType() string { return TypeChatActionBarReportSpam } -// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation type ChatActionBarReportUnrelatedLocation struct{ meta } @@ -10521,8 +11224,8 @@ type InlineKeyboardButtonTypeSwitchInline struct { meta // Inline query to be sent to the bot Query string `json:"query"` - // True, if the inline query must be sent from the current chat - InCurrentChat bool `json:"in_current_chat"` + // Target chat from which to send the inline query + TargetChat TargetChat `json:"target_chat"` } func (entity *InlineKeyboardButtonTypeSwitchInline) MarshalJSON() ([]byte, error) { @@ -10545,6 +11248,25 @@ func (*InlineKeyboardButtonTypeSwitchInline) InlineKeyboardButtonTypeType() stri return TypeInlineKeyboardButtonTypeSwitchInline } +func (inlineKeyboardButtonTypeSwitchInline *InlineKeyboardButtonTypeSwitchInline) UnmarshalJSON(data []byte) error { + var tmp struct { + Query string `json:"query"` + TargetChat json.RawMessage `json:"target_chat"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inlineKeyboardButtonTypeSwitchInline.Query = tmp.Query + + fieldTargetChat, _ := UnmarshalTargetChat(tmp.TargetChat) + inlineKeyboardButtonTypeSwitchInline.TargetChat = fieldTargetChat + + return nil +} + // A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice type InlineKeyboardButtonTypeBuy struct{ meta @@ -10942,7 +11664,7 @@ type ForumTopicInfo struct { Name string `json:"name"` // Icon of the topic Icon *ForumTopicIcon `json:"icon"` - // Date the topic was created + // Point in time (Unix timestamp) when the topic was created CreationDate int32 `json:"creation_date"` // Identifier of the creator of the topic CreatorId MessageSender `json:"creator_id"` @@ -13437,6 +14159,10 @@ type WebPage struct { VideoNote *VideoNote `json:"video_note"` // Preview of the content as a voice note, if available; may be null VoiceNote *VoiceNote `json:"voice_note"` + // The identifier of the sender of the previewed story; 0 if none + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the previewed story; 0 if none + StoryId int32 `json:"story_id"` // Version of web page instant view (currently, can be 1 or 2); 0 if none InstantViewVersion int32 `json:"instant_view_version"` } @@ -14363,7 +15089,7 @@ func (*MessageExtendedMediaVideo) MessageExtendedMediaType() string { return TypeMessageExtendedMediaVideo } -// The media is unuspported +// The media is unsupported type MessageExtendedMediaUnsupported struct { meta // Media caption @@ -14813,8 +15539,8 @@ type IdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date; may be null if not applicable - ExpiryDate *Date `json:"expiry_date"` + // Document expiration date; may be null if not applicable + ExpirationDate *Date `json:"expiration_date"` // Front side of the document FrontSide *DatedFile `json:"front_side"` // Reverse side of the document; only for driver license and identity card; may be null @@ -14846,8 +15572,8 @@ type InputIdentityDocument struct { meta // Document number; 1-24 characters Number string `json:"number"` - // Document expiry date; pass null if not applicable - ExpiryDate *Date `json:"expiry_date"` + // Document expiration date; pass null if not applicable + ExpirationDate *Date `json:"expiration_date"` // Front side of the document FrontSide InputFile `json:"front_side"` // Reverse side of the document; only for driver license and identity card; pass null otherwise @@ -14877,7 +15603,7 @@ func (*InputIdentityDocument) GetType() string { func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) error { var tmp struct { Number string `json:"number"` - ExpiryDate *Date `json:"expiry_date"` + ExpirationDate *Date `json:"expiration_date"` FrontSide json.RawMessage `json:"front_side"` ReverseSide json.RawMessage `json:"reverse_side"` Selfie json.RawMessage `json:"selfie"` @@ -14890,7 +15616,7 @@ func (inputIdentityDocument *InputIdentityDocument) UnmarshalJSON(data []byte) e } inputIdentityDocument.Number = tmp.Number - inputIdentityDocument.ExpiryDate = tmp.ExpiryDate + inputIdentityDocument.ExpirationDate = tmp.ExpirationDate fieldFrontSide, _ := UnmarshalInputFile(tmp.FrontSide) inputIdentityDocument.FrontSide = fieldFrontSide @@ -17100,6 +17826,37 @@ func (*MessagePoll) MessageContentType() string { return TypeMessagePoll } +// A message with a forwarded story +type MessageStory struct { + meta + // Identifier of the chat that posted the story + 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 + ViaMention bool `json:"via_mention"` +} + +func (entity *MessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*MessageStory) GetClass() string { + return ClassMessageContent +} + +func (*MessageStory) GetType() string { + return TypeMessageStory +} + +func (*MessageStory) MessageContentType() string { + return TypeMessageStory +} + // A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice type MessageInvoice struct { meta @@ -17691,6 +18448,35 @@ func (*MessageScreenshotTaken) MessageContentType() string { return TypeMessageScreenshotTaken } +// A new background was set in the chat +type MessageChatSetBackground struct { + meta + // Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message + OldBackgroundMessageId int64 `json:"old_background_message_id"` + // The new background + Background *ChatBackground `json:"background"` +} + +func (entity *MessageChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*MessageChatSetBackground) GetClass() string { + return ClassMessageContent +} + +func (*MessageChatSetBackground) GetType() string { + return TypeMessageChatSetBackground +} + +func (*MessageChatSetBackground) MessageContentType() string { + return TypeMessageChatSetBackground +} + // A theme in the chat has been changed type MessageChatSetTheme struct { meta @@ -18031,10 +18817,16 @@ func (*MessagePaymentSuccessfulBot) MessageContentType() string { // Telegram Premium was gifted to the user type MessageGiftedPremium struct { meta + // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + GifterUserId int64 `json:"gifter_user_id"` // Currency for the paid amount Currency string `json:"currency"` // The paid amount, in the smallest units of the currency Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` // Number of month the Telegram Premium subscription will be active MonthCount int32 `json:"month_count"` // A sticker to be shown in the message; may be null if unknown @@ -18230,7 +19022,7 @@ type MessageWebAppDataReceived struct { meta // Text of the keyboardButtonTypeWebApp button, which opened the Web App ButtonText string `json:"button_text"` - // Received data + // The data Data string `json:"data"` } @@ -18380,7 +19172,7 @@ func (messageProximityAlertTriggered *MessageProximityAlertTriggered) UnmarshalJ return nil } -// Message content that is not supported in the current TDLib version +// A message content that is not supported in the current TDLib version type MessageUnsupported struct{ meta } @@ -18966,7 +19758,7 @@ func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { // The message will be sent at the specified date type MessageSchedulingStateSendAtDate struct { meta - // Date the message will be sent. The date must be within 367 days in the future + // 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"` } @@ -19950,6 +20742,35 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { return nil } +// 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 + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageStory) GetClass() string { + return ClassInputMessageContent +} + +func (*InputMessageStory) GetType() string { + return TypeInputMessageStory +} + +func (*InputMessageStory) InputMessageContentType() string { + return TypeInputMessageStory +} + // A forwarded message type InputMessageForwarded struct { meta @@ -21486,7 +22307,7 @@ type CallProtocol struct { UdpReflector bool `json:"udp_reflector"` // The minimum supported API layer; use 65 MinLayer int32 `json:"min_layer"` - // The maximum supported API layer; use 65 + // The maximum supported API layer; use 92 MaxLayer int32 `json:"max_layer"` // List of supported tgcalls versions LibraryVersions []string `json:"library_versions"` @@ -23041,7 +23862,7 @@ func (*SpeechRecognitionResultText) SpeechRecognitionResultType() string { // The speech recognition failed type SpeechRecognitionResultError struct { meta - // Received error + // Recognition error Error *Error `json:"error"` } @@ -24988,6 +25809,8 @@ type ChatEventMemberJoinedByInviteLink struct { meta // Invite link used to join the chat InviteLink *ChatInviteLink `json:"invite_link"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` } func (entity *ChatEventMemberJoinedByInviteLink) MarshalJSON() ([]byte, error) { @@ -26652,54 +27475,54 @@ func (*PremiumLimitTypeFavoriteStickerCount) PremiumLimitTypeType() string { return TypePremiumLimitTypeFavoriteStickerCount } -// The maximum number of chat filters -type PremiumLimitTypeChatFilterCount struct{ +// The maximum number of chat folders +type PremiumLimitTypeChatFolderCount struct{ meta } -func (entity *PremiumLimitTypeChatFilterCount) MarshalJSON() ([]byte, error) { +func (entity *PremiumLimitTypeChatFolderCount) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PremiumLimitTypeChatFilterCount + type stub PremiumLimitTypeChatFolderCount return json.Marshal((*stub)(entity)) } -func (*PremiumLimitTypeChatFilterCount) GetClass() string { +func (*PremiumLimitTypeChatFolderCount) GetClass() string { return ClassPremiumLimitType } -func (*PremiumLimitTypeChatFilterCount) GetType() string { - return TypePremiumLimitTypeChatFilterCount +func (*PremiumLimitTypeChatFolderCount) GetType() string { + return TypePremiumLimitTypeChatFolderCount } -func (*PremiumLimitTypeChatFilterCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeChatFilterCount +func (*PremiumLimitTypeChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderCount } -// The maximum number of pinned and always included, or always excluded chats in a chat filter -type PremiumLimitTypeChatFilterChosenChatCount struct{ +// The maximum number of pinned and always included, or always excluded chats in a chat folder +type PremiumLimitTypeChatFolderChosenChatCount struct{ meta } -func (entity *PremiumLimitTypeChatFilterChosenChatCount) MarshalJSON() ([]byte, error) { +func (entity *PremiumLimitTypeChatFolderChosenChatCount) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub PremiumLimitTypeChatFilterChosenChatCount + type stub PremiumLimitTypeChatFolderChosenChatCount return json.Marshal((*stub)(entity)) } -func (*PremiumLimitTypeChatFilterChosenChatCount) GetClass() string { +func (*PremiumLimitTypeChatFolderChosenChatCount) GetClass() string { return ClassPremiumLimitType } -func (*PremiumLimitTypeChatFilterChosenChatCount) GetType() string { - return TypePremiumLimitTypeChatFilterChosenChatCount +func (*PremiumLimitTypeChatFolderChosenChatCount) GetType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount } -func (*PremiumLimitTypeChatFilterChosenChatCount) PremiumLimitTypeType() string { - return TypePremiumLimitTypeChatFilterChosenChatCount +func (*PremiumLimitTypeChatFolderChosenChatCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderChosenChatCount } // The maximum number of pinned chats in the archive chat list @@ -26777,6 +27600,81 @@ func (*PremiumLimitTypeBioLength) PremiumLimitTypeType() string { return TypePremiumLimitTypeBioLength } +// The maximum number of invite links for a chat folder +type PremiumLimitTypeChatFolderInviteLinkCount struct{ + meta +} + +func (entity *PremiumLimitTypeChatFolderInviteLinkCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeChatFolderInviteLinkCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) GetType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +func (*PremiumLimitTypeChatFolderInviteLinkCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeChatFolderInviteLinkCount +} + +// The maximum number of added shareable chat folders +type PremiumLimitTypeShareableChatFolderCount struct{ + meta +} + +func (entity *PremiumLimitTypeShareableChatFolderCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeShareableChatFolderCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeShareableChatFolderCount) GetType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +func (*PremiumLimitTypeShareableChatFolderCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeShareableChatFolderCount +} + +// The maximum number of active stories +type PremiumLimitTypeActiveStoryCount struct{ + meta +} + +func (entity *PremiumLimitTypeActiveStoryCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeActiveStoryCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeActiveStoryCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeActiveStoryCount) GetType() string { + return TypePremiumLimitTypeActiveStoryCount +} + +func (*PremiumLimitTypeActiveStoryCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeActiveStoryCount +} + // Increased limits type PremiumFeatureIncreasedLimits struct{ meta @@ -27102,7 +28000,7 @@ func (*PremiumFeatureForumTopicIcon) PremiumFeatureType() string { return TypePremiumFeatureForumTopicIcon } -// Allowed to set a premium appllication icons +// Allowed to set a premium application icons type PremiumFeatureAppIcons struct{ meta } @@ -28093,89 +28991,6 @@ func (backgroundTypeFill *BackgroundTypeFill) UnmarshalJSON(data []byte) error { return nil } -// Describes a chat background -type Background struct { - meta - // Unique background identifier - Id JsonInt64 `json:"id"` - // True, if this is one of default backgrounds - IsDefault bool `json:"is_default"` - // True, if the background is dark and is recommended to be used with dark theme - IsDark bool `json:"is_dark"` - // Unique background name - Name string `json:"name"` - // Document with the background; may be null. Null only for filled backgrounds - Document *Document `json:"document"` - // Type of the background - Type BackgroundType `json:"type"` -} - -func (entity *Background) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Background - - return json.Marshal((*stub)(entity)) -} - -func (*Background) GetClass() string { - return ClassBackground -} - -func (*Background) GetType() string { - return TypeBackground -} - -func (background *Background) UnmarshalJSON(data []byte) error { - var tmp struct { - Id JsonInt64 `json:"id"` - IsDefault bool `json:"is_default"` - IsDark bool `json:"is_dark"` - Name string `json:"name"` - Document *Document `json:"document"` - Type json.RawMessage `json:"type"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - background.Id = tmp.Id - background.IsDefault = tmp.IsDefault - background.IsDark = tmp.IsDark - background.Name = tmp.Name - background.Document = tmp.Document - - fieldType, _ := UnmarshalBackgroundType(tmp.Type) - background.Type = fieldType - - return nil -} - -// Contains a list of backgrounds -type Backgrounds struct { - meta - // A list of backgrounds - Backgrounds []*Background `json:"backgrounds"` -} - -func (entity *Backgrounds) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub Backgrounds - - return json.Marshal((*stub)(entity)) -} - -func (*Backgrounds) GetClass() string { - return ClassBackgrounds -} - -func (*Backgrounds) GetType() string { - return TypeBackgrounds -} - // A background from a local file type InputBackgroundLocal struct { meta @@ -28246,6 +29061,33 @@ func (*InputBackgroundRemote) InputBackgroundType() string { return TypeInputBackgroundRemote } +// A background previously set in the chat; for chat backgrounds only +type InputBackgroundPrevious struct { + meta + // Identifier of the message with the background + MessageId int64 `json:"message_id"` +} + +func (entity *InputBackgroundPrevious) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputBackgroundPrevious + + return json.Marshal((*stub)(entity)) +} + +func (*InputBackgroundPrevious) GetClass() string { + return ClassInputBackground +} + +func (*InputBackgroundPrevious) GetType() string { + return TypeInputBackgroundPrevious +} + +func (*InputBackgroundPrevious) InputBackgroundType() string { + return TypeInputBackgroundPrevious +} + // Describes theme settings type ThemeSettings struct { meta @@ -29247,6 +30089,33 @@ func (*PushMessageContentSticker) PushMessageContentType() string { return TypePushMessageContentSticker } +// A message with a story +type PushMessageContentStory struct { + meta + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentStory + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentStory) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentStory) GetType() string { + return TypePushMessageContentStory +} + +func (*PushMessageContentStory) PushMessageContentType() string { + return TypePushMessageContentStory +} + // A text message type PushMessageContentText struct { meta @@ -29475,6 +30344,33 @@ func (*PushMessageContentChatChangeTitle) PushMessageContentType() string { return TypePushMessageContentChatChangeTitle } +// A chat background was edited +type PushMessageContentChatSetBackground struct { + meta + // True, if the set background is the same as the background of the current user + IsSame bool `json:"is_same"` +} + +func (entity *PushMessageContentChatSetBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentChatSetBackground + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentChatSetBackground) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentChatSetBackground) GetType() string { + return TypePushMessageContentChatSetBackground +} + +func (*PushMessageContentChatSetBackground) PushMessageContentType() string { + return TypePushMessageContentChatSetBackground +} + // A chat theme was edited type PushMessageContentChatSetTheme struct { meta @@ -29583,7 +30479,7 @@ func (*PushMessageContentChatJoinByRequest) PushMessageContentType() string { return TypePushMessageContentChatJoinByRequest } -// A new recurrent payment was made by the current user +// A new recurring payment was made by the current user type PushMessageContentRecurringPayment struct { meta // The paid amount @@ -29781,7 +30677,7 @@ func (*NotificationTypeNewCall) NotificationTypeType() string { // New message was received through a push notification type NotificationTypeNewPushMessage struct { meta - // The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id + // The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as a message to reply MessageId int64 `json:"message_id"` // Identifier of the sender of the message. Corresponding user or chat may be inaccessible SenderId MessageSender `json:"sender_id"` @@ -30430,6 +31326,110 @@ func (*JsonValueObject) JsonValueType() string { return TypeJsonValueObject } +// The story can be viewed by everyone +type StoryPrivacySettingsEveryone struct{ + meta +} + +func (entity *StoryPrivacySettingsEveryone) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsEveryone + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsEveryone) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsEveryone) GetType() string { + return TypeStoryPrivacySettingsEveryone +} + +func (*StoryPrivacySettingsEveryone) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsEveryone +} + +// The story can be viewed by all contacts except chosen users +type StoryPrivacySettingsContacts struct { + meta + // User identifiers of the contacts that can't see the story; always empty for non-owned stories + ExceptUserIds []int64 `json:"except_user_ids"` +} + +func (entity *StoryPrivacySettingsContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsContacts + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsContacts) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsContacts) GetType() string { + return TypeStoryPrivacySettingsContacts +} + +func (*StoryPrivacySettingsContacts) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsContacts +} + +// The story can be viewed by all close friends +type StoryPrivacySettingsCloseFriends struct{ + meta +} + +func (entity *StoryPrivacySettingsCloseFriends) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsCloseFriends + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsCloseFriends) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsCloseFriends) GetType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +func (*StoryPrivacySettingsCloseFriends) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsCloseFriends +} + +// The story can be viewed by certain specified users +type StoryPrivacySettingsSelectedContacts struct { + meta + // Identifiers of the users; always empty for non-owned stories + UserIds []int64 `json:"user_ids"` +} + +func (entity *StoryPrivacySettingsSelectedContacts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryPrivacySettingsSelectedContacts + + return json.Marshal((*stub)(entity)) +} + +func (*StoryPrivacySettingsSelectedContacts) GetClass() string { + return ClassStoryPrivacySettings +} + +func (*StoryPrivacySettingsSelectedContacts) GetType() string { + return TypeStoryPrivacySettingsSelectedContacts +} + +func (*StoryPrivacySettingsSelectedContacts) StoryPrivacySettingsType() string { + return TypeStoryPrivacySettingsSelectedContacts +} + // A rule to allow all users to do something type UserPrivacySettingRuleAllowAll struct{ meta @@ -30455,7 +31455,7 @@ func (*UserPrivacySettingRuleAllowAll) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleAllowAll } -// A rule to allow all of a user's contacts to do something +// A rule to allow all contacts of the user to do something type UserPrivacySettingRuleAllowContacts struct{ meta } @@ -30559,7 +31559,7 @@ func (*UserPrivacySettingRuleRestrictAll) UserPrivacySettingRuleType() string { return TypeUserPrivacySettingRuleRestrictAll } -// A rule to restrict all contacts of a user from doing something +// A rule to restrict all contacts of the user from doing something type UserPrivacySettingRuleRestrictContacts struct{ meta } @@ -30777,6 +31777,31 @@ func (*UserPrivacySettingShowPhoneNumber) UserPrivacySettingType() string { return TypeUserPrivacySettingShowPhoneNumber } +// A privacy setting for managing whether the user's bio is visible +type UserPrivacySettingShowBio struct{ + meta +} + +func (entity *UserPrivacySettingShowBio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UserPrivacySettingShowBio + + return json.Marshal((*stub)(entity)) +} + +func (*UserPrivacySettingShowBio) GetClass() string { + return ClassUserPrivacySetting +} + +func (*UserPrivacySettingShowBio) GetType() string { + return TypeUserPrivacySettingShowBio +} + +func (*UserPrivacySettingShowBio) UserPrivacySettingType() string { + return TypeUserPrivacySettingShowBio +} + // A privacy setting for managing whether the user can be invited to chats type UserPrivacySettingAllowChatInvites struct{ meta @@ -31569,253 +32594,253 @@ func (*ConnectedWebsites) GetType() string { } // The chat contains spam messages -type ChatReportReasonSpam struct{ +type ReportReasonSpam struct{ meta } -func (entity *ChatReportReasonSpam) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonSpam) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonSpam + type stub ReportReasonSpam return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonSpam) GetClass() string { - return ClassChatReportReason +func (*ReportReasonSpam) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonSpam) GetType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) GetType() string { + return TypeReportReasonSpam } -func (*ChatReportReasonSpam) ChatReportReasonType() string { - return TypeChatReportReasonSpam +func (*ReportReasonSpam) ReportReasonType() string { + return TypeReportReasonSpam } // The chat promotes violence -type ChatReportReasonViolence struct{ +type ReportReasonViolence struct{ meta } -func (entity *ChatReportReasonViolence) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonViolence) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonViolence + type stub ReportReasonViolence return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonViolence) GetClass() string { - return ClassChatReportReason +func (*ReportReasonViolence) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonViolence) GetType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) GetType() string { + return TypeReportReasonViolence } -func (*ChatReportReasonViolence) ChatReportReasonType() string { - return TypeChatReportReasonViolence +func (*ReportReasonViolence) ReportReasonType() string { + return TypeReportReasonViolence } // The chat contains pornographic messages -type ChatReportReasonPornography struct{ +type ReportReasonPornography struct{ meta } -func (entity *ChatReportReasonPornography) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonPornography) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonPornography + type stub ReportReasonPornography return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonPornography) GetClass() string { - return ClassChatReportReason +func (*ReportReasonPornography) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonPornography) GetType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) GetType() string { + return TypeReportReasonPornography } -func (*ChatReportReasonPornography) ChatReportReasonType() string { - return TypeChatReportReasonPornography +func (*ReportReasonPornography) ReportReasonType() string { + return TypeReportReasonPornography } // The chat has child abuse related content -type ChatReportReasonChildAbuse struct{ +type ReportReasonChildAbuse struct{ meta } -func (entity *ChatReportReasonChildAbuse) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonChildAbuse) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonChildAbuse + type stub ReportReasonChildAbuse return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonChildAbuse) GetClass() string { - return ClassChatReportReason +func (*ReportReasonChildAbuse) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonChildAbuse) GetType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) GetType() string { + return TypeReportReasonChildAbuse } -func (*ChatReportReasonChildAbuse) ChatReportReasonType() string { - return TypeChatReportReasonChildAbuse +func (*ReportReasonChildAbuse) ReportReasonType() string { + return TypeReportReasonChildAbuse } // The chat contains copyrighted content -type ChatReportReasonCopyright struct{ +type ReportReasonCopyright struct{ meta } -func (entity *ChatReportReasonCopyright) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonCopyright) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonCopyright + type stub ReportReasonCopyright return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCopyright) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCopyright) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCopyright) GetType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) GetType() string { + return TypeReportReasonCopyright } -func (*ChatReportReasonCopyright) ChatReportReasonType() string { - return TypeChatReportReasonCopyright +func (*ReportReasonCopyright) ReportReasonType() string { + return TypeReportReasonCopyright } // The location-based chat is unrelated to its stated location -type ChatReportReasonUnrelatedLocation struct{ +type ReportReasonUnrelatedLocation struct{ meta } -func (entity *ChatReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonUnrelatedLocation) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonUnrelatedLocation + type stub ReportReasonUnrelatedLocation return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonUnrelatedLocation) GetClass() string { - return ClassChatReportReason +func (*ReportReasonUnrelatedLocation) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonUnrelatedLocation) GetType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) GetType() string { + return TypeReportReasonUnrelatedLocation } -func (*ChatReportReasonUnrelatedLocation) ChatReportReasonType() string { - return TypeChatReportReasonUnrelatedLocation +func (*ReportReasonUnrelatedLocation) ReportReasonType() string { + return TypeReportReasonUnrelatedLocation } // The chat represents a fake account -type ChatReportReasonFake struct{ +type ReportReasonFake struct{ meta } -func (entity *ChatReportReasonFake) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonFake) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonFake + type stub ReportReasonFake return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonFake) GetClass() string { - return ClassChatReportReason +func (*ReportReasonFake) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonFake) GetType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) GetType() string { + return TypeReportReasonFake } -func (*ChatReportReasonFake) ChatReportReasonType() string { - return TypeChatReportReasonFake +func (*ReportReasonFake) ReportReasonType() string { + return TypeReportReasonFake } // The chat has illegal drugs related content -type ChatReportReasonIllegalDrugs struct{ +type ReportReasonIllegalDrugs struct{ meta } -func (entity *ChatReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonIllegalDrugs) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonIllegalDrugs + type stub ReportReasonIllegalDrugs return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonIllegalDrugs) GetClass() string { - return ClassChatReportReason +func (*ReportReasonIllegalDrugs) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonIllegalDrugs) GetType() string { - return TypeChatReportReasonIllegalDrugs +func (*ReportReasonIllegalDrugs) GetType() string { + return TypeReportReasonIllegalDrugs } -func (*ChatReportReasonIllegalDrugs) ChatReportReasonType() string { - return TypeChatReportReasonIllegalDrugs +func (*ReportReasonIllegalDrugs) ReportReasonType() string { + return TypeReportReasonIllegalDrugs } // The chat contains messages with personal details -type ChatReportReasonPersonalDetails struct{ +type ReportReasonPersonalDetails struct{ meta } -func (entity *ChatReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonPersonalDetails) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonPersonalDetails + type stub ReportReasonPersonalDetails return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonPersonalDetails) GetClass() string { - return ClassChatReportReason +func (*ReportReasonPersonalDetails) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonPersonalDetails) GetType() string { - return TypeChatReportReasonPersonalDetails +func (*ReportReasonPersonalDetails) GetType() string { + return TypeReportReasonPersonalDetails } -func (*ChatReportReasonPersonalDetails) ChatReportReasonType() string { - return TypeChatReportReasonPersonalDetails +func (*ReportReasonPersonalDetails) ReportReasonType() string { + return TypeReportReasonPersonalDetails } // A custom reason provided by the user -type ChatReportReasonCustom struct{ +type ReportReasonCustom struct{ meta } -func (entity *ChatReportReasonCustom) MarshalJSON() ([]byte, error) { +func (entity *ReportReasonCustom) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatReportReasonCustom + type stub ReportReasonCustom return json.Marshal((*stub)(entity)) } -func (*ChatReportReasonCustom) GetClass() string { - return ClassChatReportReason +func (*ReportReasonCustom) GetClass() string { + return ClassReportReason } -func (*ChatReportReasonCustom) GetType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) GetType() string { + return TypeReportReasonCustom } -func (*ChatReportReasonCustom) ChatReportReasonType() string { - return TypeChatReportReasonCustom +func (*ReportReasonCustom) ReportReasonType() string { + return TypeReportReasonCustom } // The currently opened chat needs to be kept @@ -32166,6 +33191,58 @@ func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { return TypeInternalLinkTypeChangePhoneNumber } +// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link +type InternalLinkTypeChatFolderInvite struct { + meta + // Internal representation of the invite link + InviteLink string `json:"invite_link"` +} + +func (entity *InternalLinkTypeChatFolderInvite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatFolderInvite + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatFolderInvite) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatFolderInvite) GetType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +func (*InternalLinkTypeChatFolderInvite) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatFolderInvite +} + +// The link is a link to the folder section of the app 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 type InternalLinkTypeChatInvite struct { meta @@ -32243,31 +33320,6 @@ func (*InternalLinkTypeEditProfileSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeEditProfileSettings } -// The link is a link to the filter section of the app settings -type InternalLinkTypeFilterSettings struct{ - meta -} - -func (entity *InternalLinkTypeFilterSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeFilterSettings - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeFilterSettings) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeFilterSettings) GetType() string { - return TypeInternalLinkTypeFilterSettings -} - -func (*InternalLinkTypeFilterSettings) InternalLinkTypeType() string { - return TypeInternalLinkTypeFilterSettings -} - // The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame type InternalLinkTypeGame struct { meta @@ -32760,6 +33812,35 @@ func (*InternalLinkTypeStickerSet) InternalLinkTypeType() string { return TypeInternalLinkTypeStickerSet } +// 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 +type InternalLinkTypeStory struct { + meta + // Username of the sender of the story + StorySenderUsername string `json:"story_sender_username"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *InternalLinkTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeStory) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeStory) GetType() string { + return TypeInternalLinkTypeStory +} + +func (*InternalLinkTypeStory) InternalLinkTypeType() string { + return TypeInternalLinkTypeStory +} + // The link is a link to a theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { meta @@ -33038,6 +34119,511 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } +// Describes a video file sent in a story +type StoryVideo struct { + meta + // Duration of the video, in seconds + Duration float64 `json:"duration"` + // Video width + Width int32 `json:"width"` + // Video height + Height int32 `json:"height"` + // True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets + HasStickers bool `json:"has_stickers"` + // True, if the video has no sound + IsAnimation bool `json:"is_animation"` + // Video minithumbnail; may be null + Minithumbnail *Minithumbnail `json:"minithumbnail"` + // Video thumbnail in JPEG or MPEG4 format; may be null + Thumbnail *Thumbnail `json:"thumbnail"` + // Size of file prefix, which is supposed to be preloaded, in bytes + PreloadPrefixSize int32 `json:"preload_prefix_size"` + // File containing the video + Video *File `json:"video"` +} + +func (entity *StoryVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryVideo) GetClass() string { + return ClassStoryVideo +} + +func (*StoryVideo) GetType() string { + return TypeStoryVideo +} + +// A photo story +type StoryContentPhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` +} + +func (entity *StoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentPhoto) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentPhoto) GetType() string { + return TypeStoryContentPhoto +} + +func (*StoryContentPhoto) StoryContentType() string { + return TypeStoryContentPhoto +} + +// A video story +type StoryContentVideo struct { + meta + // The video in MPEG4 format + Video *StoryVideo `json:"video"` + // Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null + AlternativeVideo *StoryVideo `json:"alternative_video"` +} + +func (entity *StoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentVideo) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentVideo) GetType() string { + return TypeStoryContentVideo +} + +func (*StoryContentVideo) StoryContentType() string { + return TypeStoryContentVideo +} + +// A story content that is not supported in the current TDLib version +type StoryContentUnsupported struct{ + meta +} + +func (entity *StoryContentUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryContentUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*StoryContentUnsupported) GetClass() string { + return ClassStoryContent +} + +func (*StoryContentUnsupported) GetType() string { + return TypeStoryContentUnsupported +} + +func (*StoryContentUnsupported) StoryContentType() string { + return TypeStoryContentUnsupported +} + +// A photo story +type InputStoryContentPhoto struct { + meta + // Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 + Photo InputFile `json:"photo"` + // File identifiers of the stickers added to the photo, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` +} + +func (entity *InputStoryContentPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentPhoto) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentPhoto) GetType() string { + return TypeInputStoryContentPhoto +} + +func (*InputStoryContentPhoto) InputStoryContentType() string { + return TypeInputStoryContentPhoto +} + +func (inputStoryContentPhoto *InputStoryContentPhoto) UnmarshalJSON(data []byte) error { + var tmp struct { + Photo json.RawMessage `json:"photo"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentPhoto.AddedStickerFileIds = tmp.AddedStickerFileIds + + fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) + inputStoryContentPhoto.Photo = fieldPhoto + + return nil +} + +// A video story +type InputStoryContentVideo struct { + meta + // Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second + Video InputFile `json:"video"` + // File identifiers of the stickers added to the video, if applicable + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + // Precise duration of the video, in seconds; 0-60 + Duration float64 `json:"duration"` + // True, if the video has no sound + IsAnimation bool `json:"is_animation"` +} + +func (entity *InputStoryContentVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryContentVideo + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryContentVideo) GetClass() string { + return ClassInputStoryContent +} + +func (*InputStoryContentVideo) GetType() string { + return TypeInputStoryContentVideo +} + +func (*InputStoryContentVideo) InputStoryContentType() string { + return TypeInputStoryContentVideo +} + +func (inputStoryContentVideo *InputStoryContentVideo) UnmarshalJSON(data []byte) error { + var tmp struct { + Video json.RawMessage `json:"video"` + AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` + Duration float64 `json:"duration"` + IsAnimation bool `json:"is_animation"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryContentVideo.AddedStickerFileIds = tmp.AddedStickerFileIds + inputStoryContentVideo.Duration = tmp.Duration + inputStoryContentVideo.IsAnimation = tmp.IsAnimation + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputStoryContentVideo.Video = fieldVideo + + return nil +} + +// The list of stories, shown in the main chat list and folder chat lists +type StoryListMain struct{ + meta +} + +func (entity *StoryListMain) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListMain + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListMain) GetClass() string { + return ClassStoryList +} + +func (*StoryListMain) GetType() string { + return TypeStoryListMain +} + +func (*StoryListMain) StoryListType() string { + return TypeStoryListMain +} + +// The list of stories, shown in the Arvhive chat list +type StoryListArchive struct{ + meta +} + +func (entity *StoryListArchive) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryListArchive + + return json.Marshal((*stub)(entity)) +} + +func (*StoryListArchive) GetClass() string { + return ClassStoryList +} + +func (*StoryListArchive) GetType() string { + return TypeStoryListArchive +} + +func (*StoryListArchive) StoryListType() string { + return TypeStoryListArchive +} + +// Contains information about interactions with a story +type StoryInteractionInfo struct { + meta + // Number of times the story was viewed + ViewCount int32 `json:"view_count"` + // Identifiers of at most 3 recent viewers of the story + RecentViewerUserIds []int64 `json:"recent_viewer_user_ids"` +} + +func (entity *StoryInteractionInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInteractionInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInteractionInfo) GetClass() string { + return ClassStoryInteractionInfo +} + +func (*StoryInteractionInfo) GetType() string { + return TypeStoryInteractionInfo +} + +// Represents a story +type Story struct { + meta + // Unique story identifier among stories of the given sender + Id int32 `json:"id"` + // Identifier of the chat that posted the story + SenderChatId int64 `json:"sender_chat_id"` + // Point in time (Unix timestamp) when the story was published + Date int32 `json:"date"` + // 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 sender's profile and will be available there after expiration + IsPinned bool `json:"is_pinned"` + // 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 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 story sender + CanBeReplied bool `json:"can_be_replied"` + // True, if users viewed the story can be received through getStoryViewers + CanGetViewers bool `json:"can_get_viewers"` + // True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago + HasExpiredViewers bool `json:"has_expired_viewers"` + // Information about interactions with the story; may be null if the story isn't owned or there were no interactions + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + // Privacy rules affecting story visibility; may be approximate for non-owned stories + PrivacySettings StoryPrivacySettings `json:"privacy_settings"` + // Content of the story + Content StoryContent `json:"content"` + // Caption of the story + Caption *FormattedText `json:"caption"` +} + +func (entity *Story) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Story + + return json.Marshal((*stub)(entity)) +} + +func (*Story) GetClass() string { + return ClassStory +} + +func (*Story) GetType() string { + return TypeStory +} + +func (story *Story) UnmarshalJSON(data []byte) error { + var tmp struct { + Id int32 `json:"id"` + SenderChatId int64 `json:"sender_chat_id"` + Date int32 `json:"date"` + IsBeingEdited bool `json:"is_being_edited"` + IsEdited bool `json:"is_edited"` + IsPinned bool `json:"is_pinned"` + IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + CanBeForwarded bool `json:"can_be_forwarded"` + CanBeReplied bool `json:"can_be_replied"` + CanGetViewers bool `json:"can_get_viewers"` + HasExpiredViewers bool `json:"has_expired_viewers"` + InteractionInfo *StoryInteractionInfo `json:"interaction_info"` + PrivacySettings json.RawMessage `json:"privacy_settings"` + Content json.RawMessage `json:"content"` + Caption *FormattedText `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + story.Id = tmp.Id + story.SenderChatId = tmp.SenderChatId + story.Date = tmp.Date + story.IsBeingEdited = tmp.IsBeingEdited + story.IsEdited = tmp.IsEdited + story.IsPinned = tmp.IsPinned + story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf + story.CanBeForwarded = tmp.CanBeForwarded + story.CanBeReplied = tmp.CanBeReplied + story.CanGetViewers = tmp.CanGetViewers + story.HasExpiredViewers = tmp.HasExpiredViewers + story.InteractionInfo = tmp.InteractionInfo + story.Caption = tmp.Caption + + fieldPrivacySettings, _ := UnmarshalStoryPrivacySettings(tmp.PrivacySettings) + story.PrivacySettings = fieldPrivacySettings + + fieldContent, _ := UnmarshalStoryContent(tmp.Content) + story.Content = fieldContent + + return nil +} + +// Represents a list of stories +type Stories struct { + meta + // Approximate total number of stories found + TotalCount int32 `json:"total_count"` + // The list of stories + Stories []*Story `json:"stories"` +} + +func (entity *Stories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub Stories + + return json.Marshal((*stub)(entity)) +} + +func (*Stories) GetClass() string { + return ClassStories +} + +func (*Stories) GetType() string { + return TypeStories +} + +// Contains basic information about a story +type StoryInfo struct { + meta + // 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"` +} + +func (entity *StoryInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryInfo + + return json.Marshal((*stub)(entity)) +} + +func (*StoryInfo) GetClass() string { + return ClassStoryInfo +} + +func (*StoryInfo) GetType() string { + return TypeStoryInfo +} + +// Describes active stories posted by a chat +type ChatActiveStories struct { + meta + // Identifier of the chat that posted the stories + 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_sender_chat_id) in descending order + Order int64 `json:"order"` + // 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 a chronological order (i.e., in order of increasing story identifiers) + Stories []*StoryInfo `json:"stories"` +} + +func (entity *ChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*ChatActiveStories) GetClass() string { + return ClassChatActiveStories +} + +func (*ChatActiveStories) GetType() string { + return TypeChatActiveStories +} + +func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + List json.RawMessage `json:"list"` + Order int64 `json:"order"` + MaxReadStoryId int32 `json:"max_read_story_id"` + Stories []*StoryInfo `json:"stories"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatActiveStories.ChatId = tmp.ChatId + chatActiveStories.Order = tmp.Order + chatActiveStories.MaxReadStoryId = tmp.MaxReadStoryId + chatActiveStories.Stories = tmp.Stories + + fieldList, _ := UnmarshalStoryList(tmp.List) + chatActiveStories.List = fieldList + + return nil +} + // Contains a part of a file type FilePart struct { meta @@ -33211,6 +34797,31 @@ func (*FileTypePhoto) FileTypeType() string { return TypeFileTypePhoto } +// The file is a photo published as a story +type FileTypePhotoStory struct{ + meta +} + +func (entity *FileTypePhotoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypePhotoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypePhotoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypePhotoStory) GetType() string { + return TypeFileTypePhotoStory +} + +func (*FileTypePhotoStory) FileTypeType() string { + return TypeFileTypePhotoStory +} + // The file is a profile photo type FileTypeProfilePhoto struct{ meta @@ -33436,6 +35047,31 @@ func (*FileTypeVideoNote) FileTypeType() string { return TypeFileTypeVideoNote } +// The file is a video published as a story +type FileTypeVideoStory struct{ + meta +} + +func (entity *FileTypeVideoStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeVideoStory + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeVideoStory) GetClass() string { + return ClassFileType +} + +func (*FileTypeVideoStory) GetType() string { + return TypeFileTypeVideoStory +} + +func (*FileTypeVideoStory) FileTypeType() string { + return TypeFileTypeVideoStory +} + // The file is a voice note type FileTypeVoiceNote struct{ meta @@ -33944,6 +35580,8 @@ type AutoDownloadSettings struct { PreloadLargeVideos bool `json:"preload_large_videos"` // True, if the next audio track needs to be preloaded while the user is listening to an audio file PreloadNextAudio bool `json:"preload_next_audio"` + // True, if stories needs to be preloaded + PreloadStories bool `json:"preload_stories"` // True, if "use less data for calls" option needs to be enabled UseLessDataForCalls bool `json:"use_less_data_for_calls"` } @@ -34649,7 +36287,7 @@ func (*TMeUrls) GetType() string { return TypeTMeUrls } -// Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +// Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings type SuggestedActionEnableArchiveAndMuteNewChats struct{ meta } @@ -34828,6 +36466,31 @@ func (*SuggestedActionUpgradePremium) SuggestedActionType() string { return TypeSuggestedActionUpgradePremium } +// Suggests the user to restore a recently expired Premium subscription +type SuggestedActionRestorePremium struct{ + meta +} + +func (entity *SuggestedActionRestorePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SuggestedActionRestorePremium + + return json.Marshal((*stub)(entity)) +} + +func (*SuggestedActionRestorePremium) GetClass() string { + return ClassSuggestedAction +} + +func (*SuggestedActionRestorePremium) GetType() string { + return TypeSuggestedActionRestorePremium +} + +func (*SuggestedActionRestorePremium) SuggestedActionType() string { + return TypeSuggestedActionRestorePremium +} + // Suggests the user to subscribe to the Premium subscription with annual payments type SuggestedActionSubscribeToAnnualPremium struct{ meta @@ -37004,6 +38667,35 @@ func (*UpdateChatReplyMarkup) UpdateType() string { return TypeUpdateChatReplyMarkup } +// The chat background was changed +type UpdateChatBackground struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat background; may be null if background was reset to default + Background *ChatBackground `json:"background"` +} + +func (entity *UpdateChatBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBackground + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBackground) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBackground) GetType() string { + return TypeUpdateChatBackground +} + +func (*UpdateChatBackground) UpdateType() string { + return TypeUpdateChatBackground +} + // The chat theme was changed type UpdateChatTheme struct { meta @@ -37294,33 +38986,33 @@ func (*UpdateChatHasScheduledMessages) UpdateType() string { return TypeUpdateChatHasScheduledMessages } -// The list of chat filters or a chat filter has changed -type UpdateChatFilters struct { +// The list of chat folders or a chat folder has changed +type UpdateChatFolders struct { meta - // The new list of chat filters - ChatFilters []*ChatFilterInfo `json:"chat_filters"` - // Position of the main chat list among chat filters, 0-based + // The new list of chat folders + ChatFolders []*ChatFolderInfo `json:"chat_folders"` + // Position of the main chat list among chat folders, 0-based MainChatListPosition int32 `json:"main_chat_list_position"` } -func (entity *UpdateChatFilters) MarshalJSON() ([]byte, error) { +func (entity *UpdateChatFolders) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub UpdateChatFilters + type stub UpdateChatFolders return json.Marshal((*stub)(entity)) } -func (*UpdateChatFilters) GetClass() string { +func (*UpdateChatFolders) GetClass() string { return ClassUpdate } -func (*UpdateChatFilters) GetType() string { - return TypeUpdateChatFilters +func (*UpdateChatFolders) GetType() string { + return TypeUpdateChatFolders } -func (*UpdateChatFilters) UpdateType() string { - return TypeUpdateChatFilters +func (*UpdateChatFolders) UpdateType() string { + return TypeUpdateChatFolders } // The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @@ -38453,6 +40145,137 @@ func (updateUnreadChatCount *UpdateUnreadChatCount) UnmarshalJSON(data []byte) e return nil } +// A story was changed +type UpdateStory struct { + meta + // The new information about the story + Story *Story `json:"story"` +} + +func (entity *UpdateStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStory + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStory) GetClass() string { + return ClassUpdate +} + +func (*UpdateStory) GetType() string { + return TypeUpdateStory +} + +func (*UpdateStory) UpdateType() string { + return TypeUpdateStory +} + +// A story became inaccessible +type UpdateStoryDeleted struct { + meta + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *UpdateStoryDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryDeleted) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryDeleted) GetType() string { + return TypeUpdateStoryDeleted +} + +func (*UpdateStoryDeleted) UpdateType() string { + return TypeUpdateStoryDeleted +} + +// The list of active stories posted by a specific chat has changed +type UpdateChatActiveStories struct { + meta + // The new list of active stories + ActiveStories *ChatActiveStories `json:"active_stories"` +} + +func (entity *UpdateChatActiveStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatActiveStories + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatActiveStories) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatActiveStories) GetType() string { + return TypeUpdateChatActiveStories +} + +func (*UpdateChatActiveStories) UpdateType() string { + return TypeUpdateChatActiveStories +} + +// Number of chats in a story list has changed +type UpdateStoryListChatCount struct { + meta + // The story list + StoryList StoryList `json:"story_list"` + // Approximate total number of chats with active stories in the list + ChatCount int32 `json:"chat_count"` +} + +func (entity *UpdateStoryListChatCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStoryListChatCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStoryListChatCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateStoryListChatCount) GetType() string { + return TypeUpdateStoryListChatCount +} + +func (*UpdateStoryListChatCount) UpdateType() string { + return TypeUpdateStoryListChatCount +} + +func (updateStoryListChatCount *UpdateStoryListChatCount) UnmarshalJSON(data []byte) error { + var tmp struct { + StoryList json.RawMessage `json:"story_list"` + ChatCount int32 `json:"chat_count"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStoryListChatCount.ChatCount = tmp.ChatCount + + fieldStoryList, _ := UnmarshalStoryList(tmp.StoryList) + updateStoryListChatCount.StoryList = fieldStoryList + + return nil +} + // An option changed its value type UpdateOption struct { meta @@ -39642,8 +41465,8 @@ type UpdatePollAnswer struct { meta // Unique poll identifier PollId JsonInt64 `json:"poll_id"` - // The user, who changed the answer to the poll - UserId int64 `json:"user_id"` + // Identifier of the message sender that changed the answer to the poll + VoterId MessageSender `json:"voter_id"` // 0-based identifiers of answer options, chosen by the user OptionIds []int32 `json:"option_ids"` } @@ -39668,6 +41491,27 @@ func (*UpdatePollAnswer) UpdateType() string { return TypeUpdatePollAnswer } +func (updatePollAnswer *UpdatePollAnswer) UnmarshalJSON(data []byte) error { + var tmp struct { + PollId JsonInt64 `json:"poll_id"` + VoterId json.RawMessage `json:"voter_id"` + OptionIds []int32 `json:"option_ids"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updatePollAnswer.PollId = tmp.PollId + updatePollAnswer.OptionIds = tmp.OptionIds + + fieldVoterId, _ := UnmarshalMessageSender(tmp.VoterId) + updatePollAnswer.VoterId = fieldVoterId + + return nil +} + // User rights changed in a chat; for bots only type UpdateChatMember struct { meta @@ -39679,6 +41523,8 @@ type UpdateChatMember struct { Date int32 `json:"date"` // If user has joined the chat using an invite link, the invite link; may be null InviteLink *ChatInviteLink `json:"invite_link"` + // True, if the user has joined the chat using an invite link for a chat folder + ViaChatFolderInviteLink bool `json:"via_chat_folder_invite_link"` // Previous chat member OldChatMember *ChatMember `json:"old_chat_member"` // New chat member diff --git a/client/unmarshaler.go b/client/unmarshaler.go index d5e0a21..e1c1f78 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -911,6 +911,40 @@ func UnmarshalListOfMessageSendingState(dataList []json.RawMessage) ([]MessageSe return list, nil } +func UnmarshalMessageReplyTo(data json.RawMessage) (MessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) + + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageReplyTo(dataList []json.RawMessage) ([]MessageReplyTo, error) { + list := []MessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { var meta meta @@ -944,6 +978,9 @@ func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { case TypeMessageSourceNotification: return UnmarshalMessageSourceNotification(data) + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) + case TypeMessageSourceOther: return UnmarshalMessageSourceOther(data) @@ -966,6 +1003,46 @@ func UnmarshalListOfMessageSource(dataList []json.RawMessage) ([]MessageSource, return list, nil } +func UnmarshalMessageSponsorType(data json.RawMessage) (MessageSponsorType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) + + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) + + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) + + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfMessageSponsorType(dataList []json.RawMessage) ([]MessageSponsorType, error) { + list := []MessageSponsorType{} + + for _, data := range dataList { + entity, err := UnmarshalMessageSponsorType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalNotificationSettingsScope(data json.RawMessage) (NotificationSettingsScope, error) { var meta meta @@ -1058,8 +1135,8 @@ func UnmarshalChatList(data json.RawMessage) (ChatList, error) { case TypeChatListArchive: return UnmarshalChatListArchive(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) @@ -2202,6 +2279,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) + case TypeMessageInvoice: return UnmarshalMessageInvoice(data) @@ -2259,6 +2339,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) + case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) @@ -2526,6 +2609,9 @@ func UnmarshalInputMessageContent(data json.RawMessage) (InputMessageContent, er case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -3523,11 +3609,11 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeFavoriteStickerCount: return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) - case TypePremiumLimitTypeChatFilterCount: - return UnmarshalPremiumLimitTypeChatFilterCount(data) + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) - case TypePremiumLimitTypeChatFilterChosenChatCount: - return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) case TypePremiumLimitTypePinnedArchivedChatCount: return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) @@ -3538,6 +3624,15 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeBioLength: return UnmarshalPremiumLimitTypeBioLength(data) + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) + + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) + + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3857,6 +3952,9 @@ func UnmarshalInputBackground(data json.RawMessage) (InputBackground, error) { case TypeInputBackgroundRemote: return UnmarshalInputBackgroundRemote(data) + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4124,6 +4222,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentSticker: return UnmarshalPushMessageContentSticker(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) + case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) @@ -4148,6 +4249,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) + case TypePushMessageContentChatSetTheme: return UnmarshalPushMessageContentChatSetTheme(data) @@ -4357,6 +4461,46 @@ func UnmarshalListOfJsonValue(dataList []json.RawMessage) ([]JsonValue, error) { return list, nil } +func UnmarshalStoryPrivacySettings(data json.RawMessage) (StoryPrivacySettings, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) + + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) + + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) + + case TypeStoryPrivacySettingsSelectedContacts: + return UnmarshalStoryPrivacySettingsSelectedContacts(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryPrivacySettings(dataList []json.RawMessage) ([]StoryPrivacySettings, error) { + list := []StoryPrivacySettings{} + + for _, data := range dataList { + entity, err := UnmarshalStoryPrivacySettings(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalUserPrivacySettingRule(data json.RawMessage) (UserPrivacySettingRule, error) { var meta meta @@ -4430,6 +4574,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro case TypeUserPrivacySettingShowPhoneNumber: return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -4543,7 +4690,7 @@ func UnmarshalListOfSessionType(dataList []json.RawMessage) ([]SessionType, erro return list, nil } -func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { +func UnmarshalReportReason(data json.RawMessage) (ReportReason, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -4552,46 +4699,46 @@ func UnmarshalChatReportReason(data json.RawMessage) (ChatReportReason, error) { } switch meta.Type { - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfChatReportReason(dataList []json.RawMessage) ([]ChatReportReason, error) { - list := []ChatReportReason{} +func UnmarshalListOfReportReason(dataList []json.RawMessage) ([]ReportReason, error) { + list := []ReportReason{} for _, data := range dataList { - entity, err := UnmarshalChatReportReason(data) + entity, err := UnmarshalReportReason(data) if err != nil { return nil, err } @@ -4671,6 +4818,12 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) @@ -4680,9 +4833,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeEditProfileSettings: return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) @@ -4734,6 +4884,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) @@ -4777,6 +4930,111 @@ func UnmarshalListOfInternalLinkType(dataList []json.RawMessage) ([]InternalLink return list, nil } +func UnmarshalStoryContent(data json.RawMessage) (StoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) + + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) + + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryContent(dataList []json.RawMessage) ([]StoryContent, error) { + list := []StoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalInputStoryContent(data json.RawMessage) (InputStoryContent, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) + + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputStoryContent(dataList []json.RawMessage) ([]InputStoryContent, error) { + list := []InputStoryContent{} + + for _, data := range dataList { + entity, err := UnmarshalInputStoryContent(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalStoryList(data json.RawMessage) (StoryList, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeStoryListMain: + return UnmarshalStoryListMain(data) + + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { + list := []StoryList{} + + for _, data := range dataList { + entity, err := UnmarshalStoryList(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalFileType(data json.RawMessage) (FileType, error) { var meta meta @@ -4804,6 +5062,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) + case TypeFileTypeProfilePhoto: return UnmarshalFileTypeProfilePhoto(data) @@ -4831,6 +5092,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeVideoNote: return UnmarshalFileTypeVideoNote(data) + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) + case TypeFileTypeVoiceNote: return UnmarshalFileTypeVoiceNote(data) @@ -5135,6 +5399,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) { case TypeSuggestedActionUpgradePremium: return UnmarshalSuggestedActionUpgradePremium(data) + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + case TypeSuggestedActionSubscribeToAnnualPremium: return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) @@ -5478,6 +5745,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(data) @@ -5508,8 +5778,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) @@ -5607,6 +5877,18 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateStory: + return UnmarshalUpdateStory(data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) @@ -6459,6 +6741,30 @@ func UnmarshalPoll(data json.RawMessage) (*Poll, error) { return &resp, err } +func UnmarshalBackground(data json.RawMessage) (*Background, error) { + var resp Background + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBackgrounds(data json.RawMessage) (*Backgrounds, error) { + var resp Backgrounds + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBackground(data json.RawMessage) (*ChatBackground, error) { + var resp ChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalProfilePhoto(data json.RawMessage) (*ProfilePhoto, error) { var resp ProfilePhoto @@ -7219,6 +7525,22 @@ func UnmarshalMessageSendingStateFailed(data json.RawMessage) (*MessageSendingSt return &resp, err } +func UnmarshalMessageReplyToMessage(data json.RawMessage) (*MessageReplyToMessage, error) { + var resp MessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageReplyToStory(data json.RawMessage) (*MessageReplyToStory, error) { + var resp MessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessage(data json.RawMessage) (*Message, error) { var resp Message @@ -7347,6 +7669,14 @@ func UnmarshalMessageSourceNotification(data json.RawMessage) (*MessageSourceNot return &resp, err } +func UnmarshalMessageSourceScreenshot(data json.RawMessage) (*MessageSourceScreenshot, error) { + var resp MessageSourceScreenshot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageSourceOther(data json.RawMessage) (*MessageSourceOther, error) { var resp MessageSourceOther @@ -7355,6 +7685,46 @@ func UnmarshalMessageSourceOther(data json.RawMessage) (*MessageSourceOther, err return &resp, err } +func UnmarshalMessageSponsorTypeBot(data json.RawMessage) (*MessageSponsorTypeBot, error) { + var resp MessageSponsorTypeBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePublicChannel(data json.RawMessage) (*MessageSponsorTypePublicChannel, error) { + var resp MessageSponsorTypePublicChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypePrivateChannel(data json.RawMessage) (*MessageSponsorTypePrivateChannel, error) { + var resp MessageSponsorTypePrivateChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsorTypeWebsite(data json.RawMessage) (*MessageSponsorTypeWebsite, error) { + var resp MessageSponsorTypeWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessageSponsor(data json.RawMessage) (*MessageSponsor, error) { + var resp MessageSponsor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSponsoredMessage(data json.RawMessage) (*SponsoredMessage, error) { var resp SponsoredMessage @@ -7475,32 +7845,72 @@ func UnmarshalChatTypeSecret(data json.RawMessage) (*ChatTypeSecret, error) { return &resp, err } -func UnmarshalChatFilter(data json.RawMessage) (*ChatFilter, error) { - var resp ChatFilter +func UnmarshalChatFolderIcon(data json.RawMessage) (*ChatFolderIcon, error) { + var resp ChatFolderIcon err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatFilterInfo(data json.RawMessage) (*ChatFilterInfo, error) { - var resp ChatFilterInfo +func UnmarshalChatFolder(data json.RawMessage) (*ChatFolder, error) { + var resp ChatFolder err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalRecommendedChatFilter(data json.RawMessage) (*RecommendedChatFilter, error) { - var resp RecommendedChatFilter +func UnmarshalChatFolderInfo(data json.RawMessage) (*ChatFolderInfo, error) { + var resp ChatFolderInfo err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalRecommendedChatFilters(data json.RawMessage) (*RecommendedChatFilters, error) { - var resp RecommendedChatFilters +func UnmarshalChatFolderInviteLink(data json.RawMessage) (*ChatFolderInviteLink, error) { + var resp ChatFolderInviteLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinks(data json.RawMessage) (*ChatFolderInviteLinks, error) { + var resp ChatFolderInviteLinks + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatFolderInviteLinkInfo(data json.RawMessage) (*ChatFolderInviteLinkInfo, error) { + var resp ChatFolderInviteLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolder(data json.RawMessage) (*RecommendedChatFolder, error) { + var resp RecommendedChatFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalRecommendedChatFolders(data json.RawMessage) (*RecommendedChatFolders, error) { + var resp RecommendedChatFolders + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalArchiveChatListSettings(data json.RawMessage) (*ArchiveChatListSettings, error) { + var resp ArchiveChatListSettings err := json.Unmarshal(data, &resp) @@ -7523,8 +7933,8 @@ func UnmarshalChatListArchive(data json.RawMessage) (*ChatListArchive, error) { return &resp, err } -func UnmarshalChatListFilter(data json.RawMessage) (*ChatListFilter, error) { - var resp ChatListFilter +func UnmarshalChatListFolder(data json.RawMessage) (*ChatListFolder, error) { + var resp ChatListFolder err := json.Unmarshal(data, &resp) @@ -9371,6 +9781,14 @@ func UnmarshalMessagePoll(data json.RawMessage) (*MessagePoll, error) { return &resp, err } +func UnmarshalMessageStory(data json.RawMessage) (*MessageStory, error) { + var resp MessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageInvoice(data json.RawMessage) (*MessageInvoice, error) { var resp MessageInvoice @@ -9523,6 +9941,14 @@ func UnmarshalMessageScreenshotTaken(data json.RawMessage) (*MessageScreenshotTa return &resp, err } +func UnmarshalMessageChatSetBackground(data json.RawMessage) (*MessageChatSetBackground, error) { + var resp MessageChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageChatSetTheme(data json.RawMessage) (*MessageChatSetTheme, error) { var resp MessageChatSetTheme @@ -10035,6 +10461,14 @@ func UnmarshalInputMessagePoll(data json.RawMessage) (*InputMessagePoll, error) return &resp, err } +func UnmarshalInputMessageStory(data json.RawMessage) (*InputMessageStory, error) { + var resp InputMessageStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarded, error) { var resp InputMessageForwarded @@ -11651,16 +12085,16 @@ func UnmarshalPremiumLimitTypeFavoriteStickerCount(data json.RawMessage) (*Premi return &resp, err } -func UnmarshalPremiumLimitTypeChatFilterCount(data json.RawMessage) (*PremiumLimitTypeChatFilterCount, error) { - var resp PremiumLimitTypeChatFilterCount +func UnmarshalPremiumLimitTypeChatFolderCount(data json.RawMessage) (*PremiumLimitTypeChatFolderCount, error) { + var resp PremiumLimitTypeChatFolderCount err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFilterChosenChatCount, error) { - var resp PremiumLimitTypeChatFilterChosenChatCount +func UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data json.RawMessage) (*PremiumLimitTypeChatFolderChosenChatCount, error) { + var resp PremiumLimitTypeChatFolderChosenChatCount err := json.Unmarshal(data, &resp) @@ -11691,6 +12125,30 @@ func UnmarshalPremiumLimitTypeBioLength(data json.RawMessage) (*PremiumLimitType return &resp, err } +func UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data json.RawMessage) (*PremiumLimitTypeChatFolderInviteLinkCount, error) { + var resp PremiumLimitTypeChatFolderInviteLinkCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeShareableChatFolderCount(data json.RawMessage) (*PremiumLimitTypeShareableChatFolderCount, error) { + var resp PremiumLimitTypeShareableChatFolderCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumLimitTypeActiveStoryCount(data json.RawMessage) (*PremiumLimitTypeActiveStoryCount, error) { + var resp PremiumLimitTypeActiveStoryCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { var resp PremiumFeatureIncreasedLimits @@ -12043,22 +12501,6 @@ func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, err return &resp, err } -func UnmarshalBackground(data json.RawMessage) (*Background, error) { - var resp Background - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalBackgrounds(data json.RawMessage) (*Backgrounds, error) { - var resp Backgrounds - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInputBackgroundLocal(data json.RawMessage) (*InputBackgroundLocal, error) { var resp InputBackgroundLocal @@ -12075,6 +12517,14 @@ func UnmarshalInputBackgroundRemote(data json.RawMessage) (*InputBackgroundRemot return &resp, err } +func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPrevious, error) { + var resp InputBackgroundPrevious + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { var resp ThemeSettings @@ -12363,6 +12813,14 @@ func UnmarshalPushMessageContentSticker(data json.RawMessage) (*PushMessageConte return &resp, err } +func UnmarshalPushMessageContentStory(data json.RawMessage) (*PushMessageContentStory, error) { + var resp PushMessageContentStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentText(data json.RawMessage) (*PushMessageContentText, error) { var resp PushMessageContentText @@ -12427,6 +12885,14 @@ func UnmarshalPushMessageContentChatChangeTitle(data json.RawMessage) (*PushMess return &resp, err } +func UnmarshalPushMessageContentChatSetBackground(data json.RawMessage) (*PushMessageContentChatSetBackground, error) { + var resp PushMessageContentChatSetBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentChatSetTheme(data json.RawMessage) (*PushMessageContentChatSetTheme, error) { var resp PushMessageContentChatSetTheme @@ -12675,6 +13141,38 @@ func UnmarshalJsonValueObject(data json.RawMessage) (*JsonValueObject, error) { return &resp, err } +func UnmarshalStoryPrivacySettingsEveryone(data json.RawMessage) (*StoryPrivacySettingsEveryone, error) { + var resp StoryPrivacySettingsEveryone + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsContacts(data json.RawMessage) (*StoryPrivacySettingsContacts, error) { + var resp StoryPrivacySettingsContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsCloseFriends(data json.RawMessage) (*StoryPrivacySettingsCloseFriends, error) { + var resp StoryPrivacySettingsCloseFriends + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryPrivacySettingsSelectedContacts(data json.RawMessage) (*StoryPrivacySettingsSelectedContacts, error) { + var resp StoryPrivacySettingsSelectedContacts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingRuleAllowAll(data json.RawMessage) (*UserPrivacySettingRuleAllowAll, error) { var resp UserPrivacySettingRuleAllowAll @@ -12779,6 +13277,14 @@ func UnmarshalUserPrivacySettingShowPhoneNumber(data json.RawMessage) (*UserPriv return &resp, err } +func UnmarshalUserPrivacySettingShowBio(data json.RawMessage) (*UserPrivacySettingShowBio, error) { + var resp UserPrivacySettingShowBio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUserPrivacySettingAllowChatInvites(data json.RawMessage) (*UserPrivacySettingAllowChatInvites, error) { var resp UserPrivacySettingAllowChatInvites @@ -13003,80 +13509,80 @@ func UnmarshalConnectedWebsites(data json.RawMessage) (*ConnectedWebsites, error return &resp, err } -func UnmarshalChatReportReasonSpam(data json.RawMessage) (*ChatReportReasonSpam, error) { - var resp ChatReportReasonSpam +func UnmarshalReportReasonSpam(data json.RawMessage) (*ReportReasonSpam, error) { + var resp ReportReasonSpam err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonViolence(data json.RawMessage) (*ChatReportReasonViolence, error) { - var resp ChatReportReasonViolence +func UnmarshalReportReasonViolence(data json.RawMessage) (*ReportReasonViolence, error) { + var resp ReportReasonViolence err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonPornography(data json.RawMessage) (*ChatReportReasonPornography, error) { - var resp ChatReportReasonPornography +func UnmarshalReportReasonPornography(data json.RawMessage) (*ReportReasonPornography, error) { + var resp ReportReasonPornography err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonChildAbuse(data json.RawMessage) (*ChatReportReasonChildAbuse, error) { - var resp ChatReportReasonChildAbuse +func UnmarshalReportReasonChildAbuse(data json.RawMessage) (*ReportReasonChildAbuse, error) { + var resp ReportReasonChildAbuse err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonCopyright(data json.RawMessage) (*ChatReportReasonCopyright, error) { - var resp ChatReportReasonCopyright +func UnmarshalReportReasonCopyright(data json.RawMessage) (*ReportReasonCopyright, error) { + var resp ReportReasonCopyright err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonUnrelatedLocation(data json.RawMessage) (*ChatReportReasonUnrelatedLocation, error) { - var resp ChatReportReasonUnrelatedLocation +func UnmarshalReportReasonUnrelatedLocation(data json.RawMessage) (*ReportReasonUnrelatedLocation, error) { + var resp ReportReasonUnrelatedLocation err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonFake(data json.RawMessage) (*ChatReportReasonFake, error) { - var resp ChatReportReasonFake +func UnmarshalReportReasonFake(data json.RawMessage) (*ReportReasonFake, error) { + var resp ReportReasonFake err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonIllegalDrugs(data json.RawMessage) (*ChatReportReasonIllegalDrugs, error) { - var resp ChatReportReasonIllegalDrugs +func UnmarshalReportReasonIllegalDrugs(data json.RawMessage) (*ReportReasonIllegalDrugs, error) { + var resp ReportReasonIllegalDrugs err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonPersonalDetails(data json.RawMessage) (*ChatReportReasonPersonalDetails, error) { - var resp ChatReportReasonPersonalDetails +func UnmarshalReportReasonPersonalDetails(data json.RawMessage) (*ReportReasonPersonalDetails, error) { + var resp ReportReasonPersonalDetails err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatReportReasonCustom(data json.RawMessage) (*ChatReportReasonCustom, error) { - var resp ChatReportReasonCustom +func UnmarshalReportReasonCustom(data json.RawMessage) (*ReportReasonCustom, error) { + var resp ReportReasonCustom err := json.Unmarshal(data, &resp) @@ -13171,6 +13677,22 @@ func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*Internal return &resp, err } +func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalLinkTypeChatFolderInvite, error) { + var resp InternalLinkTypeChatFolderInvite + + err := json.Unmarshal(data, &resp) + + 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 @@ -13195,14 +13717,6 @@ func UnmarshalInternalLinkTypeEditProfileSettings(data json.RawMessage) (*Intern return &resp, err } -func UnmarshalInternalLinkTypeFilterSettings(data json.RawMessage) (*InternalLinkTypeFilterSettings, error) { - var resp InternalLinkTypeFilterSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeGame(data json.RawMessage) (*InternalLinkTypeGame, error) { var resp InternalLinkTypeGame @@ -13339,6 +13853,14 @@ func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTyp return &resp, err } +func UnmarshalInternalLinkTypeStory(data json.RawMessage) (*InternalLinkTypeStory, error) { + var resp InternalLinkTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeTheme(data json.RawMessage) (*InternalLinkTypeTheme, error) { var resp InternalLinkTypeTheme @@ -13419,6 +13941,110 @@ func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) { return &resp, err } +func UnmarshalStoryVideo(data json.RawMessage) (*StoryVideo, error) { + var resp StoryVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentPhoto(data json.RawMessage) (*StoryContentPhoto, error) { + var resp StoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentVideo(data json.RawMessage) (*StoryContentVideo, error) { + var resp StoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryContentUnsupported(data json.RawMessage) (*StoryContentUnsupported, error) { + var resp StoryContentUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentPhoto(data json.RawMessage) (*InputStoryContentPhoto, error) { + var resp InputStoryContentPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputStoryContentVideo(data json.RawMessage) (*InputStoryContentVideo, error) { + var resp InputStoryContentVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListMain(data json.RawMessage) (*StoryListMain, error) { + var resp StoryListMain + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryListArchive(data json.RawMessage) (*StoryListArchive, error) { + var resp StoryListArchive + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInteractionInfo(data json.RawMessage) (*StoryInteractionInfo, error) { + var resp StoryInteractionInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStory(data json.RawMessage) (*Story, error) { + var resp Story + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStories(data json.RawMessage) (*Stories, error) { + var resp Stories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStoryInfo(data json.RawMessage) (*StoryInfo, error) { + var resp StoryInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error) { + var resp ChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFilePart(data json.RawMessage) (*FilePart, error) { var resp FilePart @@ -13475,6 +14101,14 @@ func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) { return &resp, err } +func UnmarshalFileTypePhotoStory(data json.RawMessage) (*FileTypePhotoStory, error) { + var resp FileTypePhotoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeProfilePhoto(data json.RawMessage) (*FileTypeProfilePhoto, error) { var resp FileTypeProfilePhoto @@ -13547,6 +14181,14 @@ func UnmarshalFileTypeVideoNote(data json.RawMessage) (*FileTypeVideoNote, error return &resp, err } +func UnmarshalFileTypeVideoStory(data json.RawMessage) (*FileTypeVideoStory, error) { + var resp FileTypeVideoStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeVoiceNote(data json.RawMessage) (*FileTypeVoiceNote, error) { var resp FileTypeVoiceNote @@ -13939,6 +14581,14 @@ func UnmarshalSuggestedActionUpgradePremium(data json.RawMessage) (*SuggestedAct return &resp, err } +func UnmarshalSuggestedActionRestorePremium(data json.RawMessage) (*SuggestedActionRestorePremium, error) { + var resp SuggestedActionRestorePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSuggestedActionSubscribeToAnnualPremium(data json.RawMessage) (*SuggestedActionSubscribeToAnnualPremium, error) { var resp SuggestedActionSubscribeToAnnualPremium @@ -14459,6 +15109,14 @@ func UnmarshalUpdateChatReplyMarkup(data json.RawMessage) (*UpdateChatReplyMarku return &resp, err } +func UnmarshalUpdateChatBackground(data json.RawMessage) (*UpdateChatBackground, error) { + var resp UpdateChatBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatTheme(data json.RawMessage) (*UpdateChatTheme, error) { var resp UpdateChatTheme @@ -14539,8 +15197,8 @@ func UnmarshalUpdateChatHasScheduledMessages(data json.RawMessage) (*UpdateChatH return &resp, err } -func UnmarshalUpdateChatFilters(data json.RawMessage) (*UpdateChatFilters, error) { - var resp UpdateChatFilters +func UnmarshalUpdateChatFolders(data json.RawMessage) (*UpdateChatFolders, error) { + var resp UpdateChatFolders err := json.Unmarshal(data, &resp) @@ -14803,6 +15461,38 @@ func UnmarshalUpdateUnreadChatCount(data json.RawMessage) (*UpdateUnreadChatCoun return &resp, err } +func UnmarshalUpdateStory(data json.RawMessage) (*UpdateStory, error) { + var resp UpdateStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryDeleted(data json.RawMessage) (*UpdateStoryDeleted, error) { + var resp UpdateStoryDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatActiveStories(data json.RawMessage) (*UpdateChatActiveStories, error) { + var resp UpdateChatActiveStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateStoryListChatCount(data json.RawMessage) (*UpdateStoryListChatCount, error) { + var resp UpdateStoryListChatCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateOption(data json.RawMessage) (*UpdateOption, error) { var resp UpdateOption @@ -15470,6 +16160,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePoll: return UnmarshalPoll(data) + case TypeBackground: + return UnmarshalBackground(data) + + case TypeBackgrounds: + return UnmarshalBackgrounds(data) + + case TypeChatBackground: + return UnmarshalChatBackground(data) + case TypeProfilePhoto: return UnmarshalProfilePhoto(data) @@ -15755,6 +16454,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSendingStateFailed: return UnmarshalMessageSendingStateFailed(data) + case TypeMessageReplyToMessage: + return UnmarshalMessageReplyToMessage(data) + + case TypeMessageReplyToStory: + return UnmarshalMessageReplyToStory(data) + case TypeMessage: return UnmarshalMessage(data) @@ -15803,9 +16508,27 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageSourceNotification: return UnmarshalMessageSourceNotification(data) + case TypeMessageSourceScreenshot: + return UnmarshalMessageSourceScreenshot(data) + case TypeMessageSourceOther: return UnmarshalMessageSourceOther(data) + case TypeMessageSponsorTypeBot: + return UnmarshalMessageSponsorTypeBot(data) + + case TypeMessageSponsorTypePublicChannel: + return UnmarshalMessageSponsorTypePublicChannel(data) + + case TypeMessageSponsorTypePrivateChannel: + return UnmarshalMessageSponsorTypePrivateChannel(data) + + case TypeMessageSponsorTypeWebsite: + return UnmarshalMessageSponsorTypeWebsite(data) + + case TypeMessageSponsor: + return UnmarshalMessageSponsor(data) + case TypeSponsoredMessage: return UnmarshalSponsoredMessage(data) @@ -15851,17 +16574,32 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatTypeSecret: return UnmarshalChatTypeSecret(data) - case TypeChatFilter: - return UnmarshalChatFilter(data) + case TypeChatFolderIcon: + return UnmarshalChatFolderIcon(data) - case TypeChatFilterInfo: - return UnmarshalChatFilterInfo(data) + case TypeChatFolder: + return UnmarshalChatFolder(data) - case TypeRecommendedChatFilter: - return UnmarshalRecommendedChatFilter(data) + case TypeChatFolderInfo: + return UnmarshalChatFolderInfo(data) - case TypeRecommendedChatFilters: - return UnmarshalRecommendedChatFilters(data) + case TypeChatFolderInviteLink: + return UnmarshalChatFolderInviteLink(data) + + case TypeChatFolderInviteLinks: + return UnmarshalChatFolderInviteLinks(data) + + case TypeChatFolderInviteLinkInfo: + return UnmarshalChatFolderInviteLinkInfo(data) + + case TypeRecommendedChatFolder: + return UnmarshalRecommendedChatFolder(data) + + case TypeRecommendedChatFolders: + return UnmarshalRecommendedChatFolders(data) + + case TypeArchiveChatListSettings: + return UnmarshalArchiveChatListSettings(data) case TypeChatListMain: return UnmarshalChatListMain(data) @@ -15869,8 +16607,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatListArchive: return UnmarshalChatListArchive(data) - case TypeChatListFilter: - return UnmarshalChatListFilter(data) + case TypeChatListFolder: + return UnmarshalChatListFolder(data) case TypeChatLists: return UnmarshalChatLists(data) @@ -16562,6 +17300,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePoll: return UnmarshalMessagePoll(data) + case TypeMessageStory: + return UnmarshalMessageStory(data) + case TypeMessageInvoice: return UnmarshalMessageInvoice(data) @@ -16619,6 +17360,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageScreenshotTaken: return UnmarshalMessageScreenshotTaken(data) + case TypeMessageChatSetBackground: + return UnmarshalMessageChatSetBackground(data) + case TypeMessageChatSetTheme: return UnmarshalMessageChatSetTheme(data) @@ -16811,6 +17555,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessagePoll: return UnmarshalInputMessagePoll(data) + case TypeInputMessageStory: + return UnmarshalInputMessageStory(data) + case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) @@ -17417,11 +18164,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeFavoriteStickerCount: return UnmarshalPremiumLimitTypeFavoriteStickerCount(data) - case TypePremiumLimitTypeChatFilterCount: - return UnmarshalPremiumLimitTypeChatFilterCount(data) + case TypePremiumLimitTypeChatFolderCount: + return UnmarshalPremiumLimitTypeChatFolderCount(data) - case TypePremiumLimitTypeChatFilterChosenChatCount: - return UnmarshalPremiumLimitTypeChatFilterChosenChatCount(data) + case TypePremiumLimitTypeChatFolderChosenChatCount: + return UnmarshalPremiumLimitTypeChatFolderChosenChatCount(data) case TypePremiumLimitTypePinnedArchivedChatCount: return UnmarshalPremiumLimitTypePinnedArchivedChatCount(data) @@ -17432,6 +18179,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeBioLength: return UnmarshalPremiumLimitTypeBioLength(data) + case TypePremiumLimitTypeChatFolderInviteLinkCount: + return UnmarshalPremiumLimitTypeChatFolderInviteLinkCount(data) + + case TypePremiumLimitTypeShareableChatFolderCount: + return UnmarshalPremiumLimitTypeShareableChatFolderCount(data) + + case TypePremiumLimitTypeActiveStoryCount: + return UnmarshalPremiumLimitTypeActiveStoryCount(data) + case TypePremiumFeatureIncreasedLimits: return UnmarshalPremiumFeatureIncreasedLimits(data) @@ -17564,18 +18320,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeBackgroundTypeFill: return UnmarshalBackgroundTypeFill(data) - case TypeBackground: - return UnmarshalBackground(data) - - case TypeBackgrounds: - return UnmarshalBackgrounds(data) - case TypeInputBackgroundLocal: return UnmarshalInputBackgroundLocal(data) case TypeInputBackgroundRemote: return UnmarshalInputBackgroundRemote(data) + case TypeInputBackgroundPrevious: + return UnmarshalInputBackgroundPrevious(data) + case TypeThemeSettings: return UnmarshalThemeSettings(data) @@ -17684,6 +18437,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentSticker: return UnmarshalPushMessageContentSticker(data) + case TypePushMessageContentStory: + return UnmarshalPushMessageContentStory(data) + case TypePushMessageContentText: return UnmarshalPushMessageContentText(data) @@ -17708,6 +18464,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChatChangeTitle: return UnmarshalPushMessageContentChatChangeTitle(data) + case TypePushMessageContentChatSetBackground: + return UnmarshalPushMessageContentChatSetBackground(data) + case TypePushMessageContentChatSetTheme: return UnmarshalPushMessageContentChatSetTheme(data) @@ -17801,6 +18560,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeJsonValueObject: return UnmarshalJsonValueObject(data) + case TypeStoryPrivacySettingsEveryone: + return UnmarshalStoryPrivacySettingsEveryone(data) + + case TypeStoryPrivacySettingsContacts: + return UnmarshalStoryPrivacySettingsContacts(data) + + case TypeStoryPrivacySettingsCloseFriends: + return UnmarshalStoryPrivacySettingsCloseFriends(data) + + case TypeStoryPrivacySettingsSelectedContacts: + return UnmarshalStoryPrivacySettingsSelectedContacts(data) + case TypeUserPrivacySettingRuleAllowAll: return UnmarshalUserPrivacySettingRuleAllowAll(data) @@ -17840,6 +18611,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUserPrivacySettingShowPhoneNumber: return UnmarshalUserPrivacySettingShowPhoneNumber(data) + case TypeUserPrivacySettingShowBio: + return UnmarshalUserPrivacySettingShowBio(data) + case TypeUserPrivacySettingAllowChatInvites: return UnmarshalUserPrivacySettingAllowChatInvites(data) @@ -17924,35 +18698,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeConnectedWebsites: return UnmarshalConnectedWebsites(data) - case TypeChatReportReasonSpam: - return UnmarshalChatReportReasonSpam(data) + case TypeReportReasonSpam: + return UnmarshalReportReasonSpam(data) - case TypeChatReportReasonViolence: - return UnmarshalChatReportReasonViolence(data) + case TypeReportReasonViolence: + return UnmarshalReportReasonViolence(data) - case TypeChatReportReasonPornography: - return UnmarshalChatReportReasonPornography(data) + case TypeReportReasonPornography: + return UnmarshalReportReasonPornography(data) - case TypeChatReportReasonChildAbuse: - return UnmarshalChatReportReasonChildAbuse(data) + case TypeReportReasonChildAbuse: + return UnmarshalReportReasonChildAbuse(data) - case TypeChatReportReasonCopyright: - return UnmarshalChatReportReasonCopyright(data) + case TypeReportReasonCopyright: + return UnmarshalReportReasonCopyright(data) - case TypeChatReportReasonUnrelatedLocation: - return UnmarshalChatReportReasonUnrelatedLocation(data) + case TypeReportReasonUnrelatedLocation: + return UnmarshalReportReasonUnrelatedLocation(data) - case TypeChatReportReasonFake: - return UnmarshalChatReportReasonFake(data) + case TypeReportReasonFake: + return UnmarshalReportReasonFake(data) - case TypeChatReportReasonIllegalDrugs: - return UnmarshalChatReportReasonIllegalDrugs(data) + case TypeReportReasonIllegalDrugs: + return UnmarshalReportReasonIllegalDrugs(data) - case TypeChatReportReasonPersonalDetails: - return UnmarshalChatReportReasonPersonalDetails(data) + case TypeReportReasonPersonalDetails: + return UnmarshalReportReasonPersonalDetails(data) - case TypeChatReportReasonCustom: - return UnmarshalChatReportReasonCustom(data) + case TypeReportReasonCustom: + return UnmarshalReportReasonCustom(data) case TypeTargetChatCurrent: return UnmarshalTargetChatCurrent(data) @@ -17987,6 +18761,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatFolderInvite: + return UnmarshalInternalLinkTypeChatFolderInvite(data) + + case TypeInternalLinkTypeChatFolderSettings: + return UnmarshalInternalLinkTypeChatFolderSettings(data) + case TypeInternalLinkTypeChatInvite: return UnmarshalInternalLinkTypeChatInvite(data) @@ -17996,9 +18776,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeEditProfileSettings: return UnmarshalInternalLinkTypeEditProfileSettings(data) - case TypeInternalLinkTypeFilterSettings: - return UnmarshalInternalLinkTypeFilterSettings(data) - case TypeInternalLinkTypeGame: return UnmarshalInternalLinkTypeGame(data) @@ -18050,6 +18827,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) + case TypeInternalLinkTypeStory: + return UnmarshalInternalLinkTypeStory(data) + case TypeInternalLinkTypeTheme: return UnmarshalInternalLinkTypeTheme(data) @@ -18080,6 +18860,45 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageLinkInfo: return UnmarshalMessageLinkInfo(data) + case TypeStoryVideo: + return UnmarshalStoryVideo(data) + + case TypeStoryContentPhoto: + return UnmarshalStoryContentPhoto(data) + + case TypeStoryContentVideo: + return UnmarshalStoryContentVideo(data) + + case TypeStoryContentUnsupported: + return UnmarshalStoryContentUnsupported(data) + + case TypeInputStoryContentPhoto: + return UnmarshalInputStoryContentPhoto(data) + + case TypeInputStoryContentVideo: + return UnmarshalInputStoryContentVideo(data) + + case TypeStoryListMain: + return UnmarshalStoryListMain(data) + + case TypeStoryListArchive: + return UnmarshalStoryListArchive(data) + + case TypeStoryInteractionInfo: + return UnmarshalStoryInteractionInfo(data) + + case TypeStory: + return UnmarshalStory(data) + + case TypeStories: + return UnmarshalStories(data) + + case TypeStoryInfo: + return UnmarshalStoryInfo(data) + + case TypeChatActiveStories: + return UnmarshalChatActiveStories(data) + case TypeFilePart: return UnmarshalFilePart(data) @@ -18101,6 +18920,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypePhoto: return UnmarshalFileTypePhoto(data) + case TypeFileTypePhotoStory: + return UnmarshalFileTypePhotoStory(data) + case TypeFileTypeProfilePhoto: return UnmarshalFileTypeProfilePhoto(data) @@ -18128,6 +18950,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeVideoNote: return UnmarshalFileTypeVideoNote(data) + case TypeFileTypeVideoStory: + return UnmarshalFileTypeVideoStory(data) + case TypeFileTypeVoiceNote: return UnmarshalFileTypeVoiceNote(data) @@ -18275,6 +19100,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSuggestedActionUpgradePremium: return UnmarshalSuggestedActionUpgradePremium(data) + case TypeSuggestedActionRestorePremium: + return UnmarshalSuggestedActionRestorePremium(data) + case TypeSuggestedActionSubscribeToAnnualPremium: return UnmarshalSuggestedActionSubscribeToAnnualPremium(data) @@ -18470,6 +19298,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatReplyMarkup: return UnmarshalUpdateChatReplyMarkup(data) + case TypeUpdateChatBackground: + return UnmarshalUpdateChatBackground(data) + case TypeUpdateChatTheme: return UnmarshalUpdateChatTheme(data) @@ -18500,8 +19331,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatHasScheduledMessages: return UnmarshalUpdateChatHasScheduledMessages(data) - case TypeUpdateChatFilters: - return UnmarshalUpdateChatFilters(data) + case TypeUpdateChatFolders: + return UnmarshalUpdateChatFolders(data) case TypeUpdateChatOnlineMemberCount: return UnmarshalUpdateChatOnlineMemberCount(data) @@ -18599,6 +19430,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateUnreadChatCount: return UnmarshalUpdateUnreadChatCount(data) + case TypeUpdateStory: + return UnmarshalUpdateStory(data) + + case TypeUpdateStoryDeleted: + return UnmarshalUpdateStoryDeleted(data) + + case TypeUpdateChatActiveStories: + return UnmarshalUpdateChatActiveStories(data) + + case TypeUpdateStoryListChatCount: + return UnmarshalUpdateStoryListChatCount(data) + case TypeUpdateOption: return UnmarshalUpdateOption(data) diff --git a/data/td_api.tl b/data/td_api.tl index 6dabdb2..0da63c6 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -115,7 +115,7 @@ termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfSe //@class AuthorizationState @description Represents the current authorization state of the TDLib client -//@description Initializetion parameters are needed. Call setTdlibParameters to provide them +//@description Initialization parameters are needed. Call setTdlibParameters to provide them authorizationStateWaitTdlibParameters = AuthorizationState; //@description TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options @@ -402,7 +402,7 @@ photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector = Ph //@description Describes a sticker //@id Unique sticker identifier within the set; 0 if none -//@set_id The identifier of the sticker set to which the sticker belongs; 0 if none +//@set_id Identifier of the sticker set to which the sticker belongs; 0 if none //@width Sticker width; as defined by the sender //@height Sticker height; as defined by the sender //@emoji Emoji corresponding to the sticker @@ -498,13 +498,29 @@ webApp short_name:string title:string description:string photo:photo animation:a //@question Poll question; 1-300 characters //@options List of poll answer options //@total_voter_count Total number of voters, participating in the poll -//@recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous +//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous //@is_anonymous True, if the poll is anonymous //@type Type of the poll //@open_period Amount of time the poll will be active after creation, in seconds //@close_date Point in time (Unix timestamp) when the poll will automatically be closed //@is_closed True, if the poll is closed -poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_user_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; +poll id:int64 question:string options:vector total_voter_count:int32 recent_voter_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; + + +//@description Describes a chat background +//@id Unique background identifier +//@is_default True, if this is one of default backgrounds +//@is_dark True, if the background is dark and is recommended to be used with dark theme +//@name Unique background name +//@document Document with the background; may be null. Null only for filled backgrounds +//@type Type of the background +background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; + +//@description Contains a list of backgrounds @backgrounds A list of backgrounds +backgrounds backgrounds:vector = Backgrounds; + +//@description Describes a background set for a specific chat @background The background @dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +chatBackground background:background dark_theme_dimming:int32 = ChatBackground; //@description Describes a user profile photo @@ -534,13 +550,14 @@ userTypeRegular = UserType; userTypeDeleted = UserType; //@description A bot (see https://core.telegram.org/bots) +//@can_be_edited True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription //@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot //@can_be_added_to_attachment_menu True, if the bot can be added to attachment menu -userTypeBot can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_be_added_to_attachment_menu:Bool = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -668,17 +685,19 @@ premiumPaymentOption currency:string amount:int53 discount_percentage:int32 mont premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; -//@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format -emojiStatus custom_emoji_id:int64 = EmojiStatus; +//@description Describes a custom emoji to be shown instead of the Telegram Premium badge +//@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format +//@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never +emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; -//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses -emojiStatuses emoji_statuses:vector = EmojiStatuses; +//@description Contains a list of custom emoji identifiers, which can be set as emoji statuses @custom_emoji_ids The list of custom emoji identifiers +emojiStatuses custom_emoji_ids:vector = EmojiStatuses; //@description Describes usernames assigned to a user, a supergroup, or a channel -//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames -//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive -//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername +//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames +//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive +//@editable_username The active username, which can be changed with setUsername or setSupergroupUsername usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; @@ -694,17 +713,20 @@ usernames active_usernames:vector disabled_usernames:vector edit //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user +//@is_close_friend The user is a close friend of the current user; implies that the user is a contact //@is_verified True, if the user is verified //@is_premium True, if the user is a Telegram Premium user //@is_support True, if the user is Telegram support account //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@is_scam True, if many users reported this user as a scam //@is_fake True, if many users reported this user as a fake account +//@has_active_stories True, if the user has non-expired stories available to the current user +//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user //@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -716,7 +738,11 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use //@commands List of the bot commands //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null -botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; +//@edit_commands_link The internal link, which can be used to edit bot commands; may be null +//@edit_description_link The internal link, which can be used to edit bot description; may be null +//@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null +//@edit_settings_link The internal link, which can be used to edit bot settings; may be null +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -731,12 +757,13 @@ botInfo short_description:string description:string photo:photo animation:animat //@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user +//@has_pinned_stories True, if the user has pinned stories //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@bio A short user bio; may be null for bots //@premium_gift_options The list of available options for gifting Telegram Premium to the user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user //@bot_info For bots, information about the bot; may be null -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_pinned_stories:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector group_in_common_count:int32 bot_info:botInfo = UserFullInfo; //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers users total_count:int32 user_ids:vector = Users; @@ -870,8 +897,12 @@ chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_co //@description Contains a list of chat invite link counts @invite_link_counts List of invite link counts chatInviteLinkCounts invite_link_counts:vector = ChatInviteLinkCounts; -//@description Describes a chat member joined a chat via an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat @approver_user_id User identifier of the chat administrator, approved user join request -chatInviteLinkMember user_id:int53 joined_chat_date:int32 approver_user_id:int53 = ChatInviteLinkMember; +//@description Describes a chat member joined a chat via an invite link +//@user_id User identifier +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +//@approver_user_id User identifier of the chat administrator, approved user join request +chatInviteLinkMember user_id:int53 joined_chat_date:int32 via_chat_folder_invite_link:Bool approver_user_id:int53 = ChatInviteLinkMember; //@description Contains a list of chat members joined a chat via an invite link @total_count Approximate total number of chat members found @members List of chat members, joined a chat via an invite link chatInviteLinkMembers total_count:int32 members:vector = ChatInviteLinkMembers; @@ -929,7 +960,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member //@status Status of the current user in the supergroup or channel; custom title will always be empty //@member_count 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 searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules +//-through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup //@sign_messages True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels @@ -958,7 +989,6 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@can_get_members True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers //@has_hidden_members True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers //@can_hide_members True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators -//@can_set_username True, if the chat username can be changed //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available @@ -972,7 +1002,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1109,6 +1139,17 @@ messageSendingStatePending sending_id:int32 = MessageSendingState; messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +//@class MessageReplyTo @description Contains information about the message or the story a message is replying to + +//@description Describes a replied message +//@chat_id The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats +//@message_id The identifier of the replied message +messageReplyToMessage chat_id:int53 message_id:int53 = MessageReplyTo; + +//@description Describes a replied story @story_sender_chat_id The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the replied story +messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; + + //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message @@ -1137,8 +1178,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@forward_info Information about the initial message sender; may be null //@interaction_info Information about interactions with the message; may be null //@unread_reactions Information about unread reactions added to the message -//@reply_in_chat_id If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id -//@reply_to_message_id If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message +//@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs //@self_destruct_time The message's self-destruct time, in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the time expires //@self_destruct_in Time left before the message self-destruct timer expires, in seconds. If the self-destruct timer isn't started yet, equals to the value of the self_destruct_time field @@ -1149,7 +1189,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_time:int32 self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -1199,21 +1239,41 @@ messageSourceChatEventLog = MessageSource; //@description The message is from a notification messageSourceNotification = MessageSource; +//@description The message was screenshotted; the source must be used only if the message content was visible during the screenshot +messageSourceScreenshot = MessageSource; + //@description The message is from some other source messageSourceOther = MessageSource; +//@class MessageSponsorType @description Describes type of a message sponsor + +//@description The sponsor is a bot @bot_user_id User identifier of the bot @link An internal link to be opened when the sponsored message is clicked +messageSponsorTypeBot bot_user_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a public channel chat @chat_id Sponsor chat identifier @link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead +messageSponsorTypePublicChannel chat_id:int53 link:InternalLinkType = MessageSponsorType; + +//@description The sponsor is a private channel chat @title Title of the chat @invite_link Invite link for the channel +messageSponsorTypePrivateChannel title:string invite_link:string = MessageSponsorType; + +//@description The sponsor is a website @url URL of the website @name Name of the website +messageSponsorTypeWebsite url:string name:string = MessageSponsorType; + + +//@description Information about the sponsor of a message +//@type Type of the sponsor +//@photo Photo of the sponsor; may be null if must not be shown +//@info Additional optional information about the sponsor to be shown along with the message +messageSponsor type:MessageSponsorType photo:chatPhotoInfo info:string = MessageSponsor; + //@description Describes a sponsored message //@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" -//@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link -//@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 -//@show_chat_photo True, if the sponsor's chat photo must be shown -//@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead //@content Content of the message. Currently, can be only of the type messageText -//@sponsor_info If non-empty, information about the sponsor to be shown along with the message +//@sponsor Information about the sponsor of the message //@additional_info If non-empty, additional information about the sponsored message to be shown along with the message -sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent sponsor_info:string additional_info:string = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool content:MessageContent sponsor:messageSponsor additional_info:string = SponsoredMessage; //@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; @@ -1252,26 +1312,36 @@ notificationSettingsScopeGroupChats = NotificationSettingsScope; notificationSettingsScopeChannelChats = NotificationSettingsScope; -//@description Contains information about notification settings for a chat or a froum topic +//@description Contains information about notification settings for a chat or a forum topic //@use_default_mute_for If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead //@mute_for Time left before notifications will be unmuted, in seconds //@use_default_sound If true, the value for the relevant type of chat or the forum chat is used instead of sound_id -//@sound_id Identifier of the notification sound to be played; 0 if sound is disabled +//@sound_id Identifier of the notification sound to be played for messages; 0 if sound is disabled //@use_default_show_preview If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and the value for the relevant type of chat is used instead +//@mute_stories True, if story notifications are received without sound +//@use_default_story_sound If true, the value for the relevant type of chat is used instead of story_sound_id +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@use_default_show_story_sender If true, show_story_sender is ignored and the value for the relevant type of chat is used instead +//@show_story_sender True, if the sender of stories must be displayed in notifications //@use_default_disable_pinned_message_notifications If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead //@disable_pinned_message_notifications If true, notifications for incoming pinned messages will be created as for an ordinary unread message //@use_default_disable_mention_notifications If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead //@disable_mention_notifications If true, notifications for messages with mentions will be created as for an ordinary unread message -chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; +chatNotificationSettings use_default_mute_for:Bool mute_for:int32 use_default_sound:Bool sound_id:int64 use_default_show_preview:Bool show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool use_default_story_sound:Bool story_sound_id:int64 use_default_show_story_sender:Bool show_story_sender:Bool use_default_disable_pinned_message_notifications:Bool disable_pinned_message_notifications:Bool use_default_disable_mention_notifications:Bool disable_mention_notifications:Bool = ChatNotificationSettings; //@description Contains information about notification settings for several chats //@mute_for Time left before notifications will be unmuted, in seconds //@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if message content must be displayed in notifications +//@use_default_mute_stories If true, mute_stories is ignored and stories are unmuted only for the first 5 chats from topChatCategoryUsers +//@mute_stories True, if story notifications are received without sound +//@story_sound_id Identifier of the notification sound to be played for stories; 0 if sound is disabled +//@show_story_sender True, if the sender of stories must be displayed in notifications //@disable_pinned_message_notifications True, if notifications for incoming pinned messages will be created as for an ordinary unread message //@disable_mention_notifications True, if notifications for messages with mentions will be created as for an ordinary unread message -scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; +scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_default_mute_stories:Bool mute_stories:Bool story_sound_id:int64 show_story_sender:Bool disable_pinned_message_notifications:Bool disable_mention_notifications:Bool = ScopeNotificationSettings; //@description Contains information about a message draft @@ -1296,14 +1366,17 @@ chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType; chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; -//@description Represents a filter of user chats -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", -//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette". -//-If empty, use getChatFilterDefaultIconName to get default icon name for the filter -//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@included_chat_ids The chat identifiers of always included chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium -//@excluded_chat_ids The chat identifiers of always excluded chats in the filtered chat list. There can be up to getOption("chat_filter_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@description Represents an icon for a chat folder @name The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", +//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" +chatFolderIcon name:string = ChatFolderIcon; + +//@description Represents a folder for user chats +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder +//@is_shareable True, if at least one link has been created for the folder +//@pinned_chat_ids The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@included_chat_ids The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium +//@excluded_chat_ids The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@exclude_muted True, if muted chats need to be excluded //@exclude_read True, if read chats need to be excluded //@exclude_archived True, if archived chats need to be excluded @@ -1312,20 +1385,42 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType; //@include_bots True, if bots need to be included //@include_groups True, if basic groups and supergroups need to be included //@include_channels True, if channels need to be included -chatFilter title:string icon_name:string pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFilter; +chatFolder title:string icon:chatFolderIcon is_shareable:Bool pinned_chat_ids:vector included_chat_ids:vector excluded_chat_ids:vector exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; -//@description Contains basic information about a chat filter -//@id Unique chat filter identifier -//@title The title of the filter; 1-12 characters without line feeds -//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", -//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" -chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; +//@description Contains basic information about a chat folder +//@id Unique chat folder identifier +//@title The title of the folder; 1-12 characters without line feeds +//@icon The chosen or default icon for the chat folder +//@is_shareable True, if at least one link has been created for the folder +//@has_my_invite_links True, if the chat folder has invite links created by the current user +chatFolderInfo id:int32 title:string icon:chatFolderIcon is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; -//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description -recommendedChatFilter filter:chatFilter description:string = RecommendedChatFilter; +//@description Contains a chat folder invite link +//@invite_link The chat folder invite link +//@name Name of the link +//@chat_ids Identifiers of chats, included in the link +chatFolderInviteLink invite_link:string name:string chat_ids:vector = ChatFolderInviteLink; -//@description Contains a list of recommended chat filters @chat_filters List of recommended chat filters -recommendedChatFilters chat_filters:vector = RecommendedChatFilters; +//@description Represents a list of chat folder invite links @invite_links List of the invite links +chatFolderInviteLinks invite_links:vector = ChatFolderInviteLinks; + +//@description Contains information about an invite link to a chat folder +//@chat_folder_info Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet +//@missing_chat_ids Identifiers of the chats from the link, which aren't added to the folder yet +//@added_chat_ids Identifiers of the chats from the link, which are added to the folder already +chatFolderInviteLinkInfo chat_folder_info:chatFolderInfo missing_chat_ids:vector added_chat_ids:vector = ChatFolderInviteLinkInfo; + +//@description Describes a recommended chat folder @folder The chat folder @param_description Chat folder description +recommendedChatFolder folder:chatFolder description:string = RecommendedChatFolder; + +//@description Contains a list of recommended chat folders @chat_folders List of recommended chat folders +recommendedChatFolders chat_folders:vector = RecommendedChatFolders; + +//@description Contains settings for automatic moving of chats to and from the Archive chat lists +//@archive_and_mute_new_chats_from_unknown_users True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true +//@keep_unmuted_chats_archived True, if unmuted chats will be kept in the Archive chat list when they get a new message +//@keep_chats_from_folders_archived True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true +archiveChatListSettings archive_and_mute_new_chats_from_unknown_users:Bool keep_unmuted_chats_archived:Bool keep_chats_from_folders_archived:Bool = ArchiveChatListSettings; //@class ChatList @description Describes a list of chats @@ -1336,8 +1431,8 @@ chatListMain = ChatList; //@description A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives chatListArchive = ChatList; -//@description A list of chats belonging to a chat filter @chat_filter_id Chat filter identifier -chatListFilter chat_filter_id:int32 = ChatList; +//@description A list of chats added to a chat folder @chat_folder_id Chat folder identifier +chatListFolder chat_folder_id:int32 = ChatList; //@description Contains a list of chat lists @chat_lists List of chat lists chatLists chat_lists:vector = ChatLists; @@ -1402,6 +1497,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@notification_settings Notification settings for the chat //@available_reactions Types of reaction, available in the chat //@message_auto_delete_time Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date +//@background Background set for the chat; may be null if none //@theme_name If non-empty, name of a theme, set for the chat //@action_bar Information about actions which must be possible to do through the chat action bar; may be null //@video_chat Information about video chat of the chat @@ -1409,7 +1505,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1433,11 +1529,11 @@ publicChatTypeIsLocationBased = PublicChatType; //@class ChatActionBar @description Describes actions which must be possible to do through a chat action bar -//@description The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown +//@description The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown //@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings chatActionBarReportSpam can_unarchive:Bool = ChatActionBar; -//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation +//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation chatActionBarReportUnrelatedLocation = ChatActionBar; //@description The chat is a recently created group chat to which new members can be invited @@ -1525,8 +1621,8 @@ inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonTy //@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame inlineKeyboardButtonTypeCallbackGame = InlineKeyboardButtonType; -//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @in_current_chat True, if the inline query must be sent from the current chat -inlineKeyboardButtonTypeSwitchInline query:string in_current_chat:Bool = InlineKeyboardButtonType; +//@description A button that forces an inline query to the bot to be inserted in the input field @query Inline query to be sent to the bot @target_chat Target chat from which to send the inline query +inlineKeyboardButtonTypeSwitchInline query:string target_chat:TargetChat = InlineKeyboardButtonType; //@description A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType; @@ -1604,7 +1700,7 @@ forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; //@message_thread_id Message thread identifier of the topic //@name Name of the topic //@icon Icon of the topic -//@creation_date Date the topic was created +//@creation_date Point in time (Unix timestamp) when the topic was created //@creator_id Identifier of the creator of the topic //@is_general True, if the topic is the General topic list //@is_outgoing True, if the topic was created by the current user @@ -1913,8 +2009,10 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@video Preview of the content as a video, if available; may be null //@video_note Preview of the content as a video note, if available; may be null //@voice_note Preview of the content as a voice note, if available; may be null +//@story_sender_chat_id The identifier of the sender of the previewed story; 0 if none +//@story_id The identifier of the previewed story; 0 if none //@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote instant_view_version:int32 = WebPage; +webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 instant_view_version:int32 = WebPage; //@description Contains information about a country @@ -2097,7 +2195,7 @@ messageExtendedMediaPhoto photo:photo caption:formattedText = MessageExtendedMed //@description The media is a video @video The video @caption Photo caption messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMedia; -//@description The media is unuspported @caption Media caption +//@description The media is unsupported @caption Media caption messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; @@ -2166,21 +2264,21 @@ personalDetails first_name:string middle_name:string last_name:string native_fir //@description An identity document //@number Document number; 1-24 characters -//@expiry_date Document expiry date; may be null if not applicable +//@expiration_date Document expiration date; may be null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; may be null //@selfie Selfie with the document; may be null //@translation List of files containing a certified English translation of the document -identityDocument number:string expiry_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; +identityDocument number:string expiration_date:date front_side:datedFile reverse_side:datedFile selfie:datedFile translation:vector = IdentityDocument; //@description An identity document to be saved to Telegram Passport //@number Document number; 1-24 characters -//@expiry_date Document expiry date; pass null if not applicable +//@expiration_date Document expiration date; pass null if not applicable //@front_side Front side of the document //@reverse_side Reverse side of the document; only for driver license and identity card; pass null otherwise //@selfie Selfie with the document; pass null if unavailable //@translation List of files containing a certified English translation of the document -inputIdentityDocument number:string expiry_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; +inputIdentityDocument number:string expiration_date:date front_side:InputFile reverse_side:InputFile selfie:InputFile translation:vector = InputIdentityDocument; //@description A personal document, containing some information about a user @files List of files containing the pages of the document @translation List of files containing a certified English translation of the document personalDocument files:vector translation:vector = PersonalDocument; @@ -2460,6 +2558,12 @@ messageGame game:game = MessageContent; //@description A message with a poll @poll The poll description messagePoll poll:poll = MessageContent; +//@description A message with a forwarded story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@via_mention True, if the story was automatically forwarded because of a mention of the user +messageStory story_sender_chat_id:int53 story_id:int32 via_mention:Bool = MessageContent; + //@description A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice //@title Product title //@param_description Product description @@ -2527,6 +2631,9 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; +//@description A new background was set in the chat @old_background_message_id Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message @background The new background +messageChatSetBackground old_background_message_id:int53 background:chatBackground = MessageContent; + //@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one messageChatSetTheme theme_name:string = MessageContent; @@ -2580,11 +2687,14 @@ messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description Telegram Premium was gifted to the user +//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency //@month_count Number of month the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium currency:string amount:int53 month_count:int32 sticker:sticker = MessageContent; +messageGiftedPremium gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -2604,7 +2714,7 @@ messageBotWriteAccessAllowed web_app:webApp = MessageContent; //@description Data from a Web App has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App messageWebAppDataSent button_text:string = MessageContent; -//@description Data from a Web App has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App @data Received data +//@description Data from a Web App has been received; for bots only @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App @data The data messageWebAppDataReceived button_text:string data:string = MessageContent; //@description Telegram Passport data has been sent to a bot @types List of Telegram Passport element types sent @@ -2616,7 +2726,7 @@ messagePassportDataReceived elements:vector credential //@description A user in the chat came within proximity alert range @traveler_id The identifier of a user or chat that triggered the proximity alert @watcher_id The identifier of a user or chat that subscribed for the proximity alert @distance The distance between the users messageProximityAlertTriggered traveler_id:MessageSender watcher_id:MessageSender distance:int32 = MessageContent; -//@description Message content that is not supported in the current TDLib version +//@description A message content that is not supported in the current TDLib version messageUnsupported = MessageContent; @@ -2692,7 +2802,7 @@ inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent -//@description The message will be sent at the specified date @send_date Date the message will be sent. The date must be within 367 days in the future +//@description The message will be sent at the specified date @send_date Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future messageSchedulingStateSendAtDate send_date:int32 = MessageSchedulingState; //@description The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known @@ -2840,6 +2950,11 @@ inputMessageInvoice invoice:invoice title:string description:string photo_url:st //@is_closed True, if the poll needs to be sent already closed; for bots only inputMessagePoll question:string options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +//@description 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 +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +inputMessageStory story_sender_chat_id:int53 story_id:int32 = InputMessageContent; + //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from //@message_id Identifier of the message to forward @@ -3060,7 +3175,7 @@ callDiscardReasonHungUp = CallDiscardReason; //@udp_p2p True, if UDP peer-to-peer connections are supported //@udp_reflector True, if connection through UDP reflectors is supported //@min_layer The minimum supported API layer; use 65 -//@max_layer The maximum supported API layer; use 65 +//@max_layer The maximum supported API layer; use 92 //@library_versions List of supported tgcalls versions callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 library_versions:vector = CallProtocol; @@ -3328,7 +3443,7 @@ speechRecognitionResultPending partial_text:string = SpeechRecognitionResult; //@description The speech recognition successfully finished @text Recognized text speechRecognitionResultText text:string = SpeechRecognitionResult; -//@description The speech recognition failed @error Received error +//@description The speech recognition failed @error Recognition error speechRecognitionResultError error:error = SpeechRecognitionResult; @@ -3650,8 +3765,8 @@ chatEventPollStopped message:message = ChatEventAction; //@description A new member joined the chat chatEventMemberJoined = ChatEventAction; -//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat -chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction; +//@description A new member joined the chat via an invite link @invite_link Invite link used to join the chat @via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder +chatEventMemberJoinedByInviteLink invite_link:chatInviteLink via_chat_folder_invite_link:Bool = ChatEventAction; //@description A new member was accepted to the chat by an administrator @approver_user_id User identifier of the chat administrator, approved user join request @invite_link Invite link used to join the chat; may be null chatEventMemberJoinedByRequest approver_user_id:int53 invite_link:chatInviteLink = ChatEventAction; @@ -3852,11 +3967,11 @@ premiumLimitTypeSavedAnimationCount = PremiumLimitType; //@description The maximum number of favorite stickers premiumLimitTypeFavoriteStickerCount = PremiumLimitType; -//@description The maximum number of chat filters -premiumLimitTypeChatFilterCount = PremiumLimitType; +//@description The maximum number of chat folders +premiumLimitTypeChatFolderCount = PremiumLimitType; -//@description The maximum number of pinned and always included, or always excluded chats in a chat filter -premiumLimitTypeChatFilterChosenChatCount = PremiumLimitType; +//@description The maximum number of pinned and always included, or always excluded chats in a chat folder +premiumLimitTypeChatFolderChosenChatCount = PremiumLimitType; //@description The maximum number of pinned chats in the archive chat list premiumLimitTypePinnedArchivedChatCount = PremiumLimitType; @@ -3867,6 +3982,15 @@ premiumLimitTypeCaptionLength = PremiumLimitType; //@description The maximum length of the user's bio premiumLimitTypeBioLength = PremiumLimitType; +//@description The maximum number of invite links for a chat folder +premiumLimitTypeChatFolderInviteLinkCount = PremiumLimitType; + +//@description The maximum number of added shareable chat folders +premiumLimitTypeShareableChatFolderCount = PremiumLimitType; + +//@description The maximum number of active stories +premiumLimitTypeActiveStoryCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -3909,7 +4033,7 @@ premiumFeatureAnimatedProfilePhoto = PremiumFeature; //@description The ability to set a custom emoji as a forum topic icon premiumFeatureForumTopicIcon = PremiumFeature; -//@description Allowed to set a premium appllication icons +//@description Allowed to set a premium application icons premiumFeatureAppIcons = PremiumFeature; //@description Allowed to translate chat messages real-time @@ -4039,19 +4163,6 @@ backgroundTypePattern fill:BackgroundFill intensity:int32 is_inverted:Bool is_mo backgroundTypeFill fill:BackgroundFill = BackgroundType; -//@description Describes a chat background -//@id Unique background identifier -//@is_default True, if this is one of default backgrounds -//@is_dark True, if the background is dark and is recommended to be used with dark theme -//@name Unique background name -//@document Document with the background; may be null. Null only for filled backgrounds -//@type Type of the background -background id:int64 is_default:Bool is_dark:Bool name:string document:document type:BackgroundType = Background; - -//@description Contains a list of backgrounds @backgrounds A list of backgrounds -backgrounds backgrounds:vector = Backgrounds; - - //@class InputBackground @description Contains information about background to set //@description A background from a local file @@ -4061,6 +4172,9 @@ inputBackgroundLocal background:InputFile = InputBackground; //@description A background from the server @background_id The background identifier inputBackgroundRemote background_id:int64 = InputBackground; +//@description A background previously set in the chat; for chat backgrounds only @message_id Identifier of the message with the background +inputBackgroundPrevious message_id:int53 = InputBackground; + //@description Describes theme settings //@accent_color Theme accent color in ARGB format @@ -4208,6 +4322,9 @@ pushMessageContentScreenshotTaken = PushMessageContent; //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentSticker sticker:sticker emoji:string is_pinned:Bool = PushMessageContent; +//@description A message with a story @is_pinned True, if the message is a pinned message with the specified content +pushMessageContentStory is_pinned:Bool = PushMessageContent; + //@description A text message @text Message text @is_pinned True, if the message is a pinned message with the specified content pushMessageContentText text:string is_pinned:Bool = PushMessageContent; @@ -4239,6 +4356,9 @@ pushMessageContentChatChangePhoto = PushMessageContent; //@description A chat title was edited @title New chat title pushMessageContentChatChangeTitle title:string = PushMessageContent; +//@description A chat background was edited @is_same True, if the set background is the same as the background of the current user +pushMessageContentChatSetBackground is_same:Bool = PushMessageContent; + //@description A chat theme was edited @theme_name If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one pushMessageContentChatSetTheme theme_name:string = PushMessageContent; @@ -4254,7 +4374,7 @@ pushMessageContentChatJoinByLink = PushMessageContent; //@description A new member was accepted to the chat by an administrator pushMessageContentChatJoinByRequest = PushMessageContent; -//@description A new recurrent payment was made by the current user @amount The paid amount +//@description A new recurring payment was made by the current user @amount The paid amount pushMessageContentRecurringPayment amount:string = PushMessageContent; //@description A profile photo was suggested to the user @@ -4284,7 +4404,7 @@ notificationTypeNewSecretChat = NotificationType; notificationTypeNewCall call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as reply_to_message_id +//@message_id The message identifier. The message will not be available in the chat history, but the ID can be used in viewMessages, or as a message to reply //@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible //@sender_name Name of the sender //@is_outgoing True, if the message is outgoing @@ -4375,12 +4495,27 @@ jsonValueArray values:vector = JsonValue; jsonValueObject members:vector = JsonValue; -//@class UserPrivacySettingRule @description Represents a single rule for managing privacy settings +//@class StoryPrivacySettings @description Describes privacy settings of a story + +//@description The story can be viewed by everyone +storyPrivacySettingsEveryone = StoryPrivacySettings; + +//@description The story can be viewed by all contacts except chosen users @except_user_ids User identifiers of the contacts that can't see the story; always empty for non-owned stories +storyPrivacySettingsContacts except_user_ids:vector = StoryPrivacySettings; + +//@description The story can be viewed by all close friends +storyPrivacySettingsCloseFriends = StoryPrivacySettings; + +//@description The story can be viewed by certain specified users @user_ids Identifiers of the users; always empty for non-owned stories +storyPrivacySettingsSelectedContacts user_ids:vector = StoryPrivacySettings; + + +//@class UserPrivacySettingRule @description Represents a single rule for managing user privacy settings //@description A rule to allow all users to do something userPrivacySettingRuleAllowAll = UserPrivacySettingRule; -//@description A rule to allow all of a user's contacts to do something +//@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts = UserPrivacySettingRule; //@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 @@ -4392,7 +4527,7 @@ userPrivacySettingRuleAllowChatMembers chat_ids:vector = UserPrivacySetti //@description A rule to restrict all users from doing something userPrivacySettingRuleRestrictAll = UserPrivacySettingRule; -//@description A rule to restrict all contacts of a user from doing something +//@description A rule to restrict all contacts of the user from doing something userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule; //@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000 @@ -4404,6 +4539,7 @@ userPrivacySettingRuleRestrictChatMembers chat_ids:vector = UserPrivacySe //@description A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed @rules A list of rules userPrivacySettingRules rules:vector = UserPrivacySettingRules; + //@class UserPrivacySetting @description Describes available user privacy settings //@description A privacy setting for managing whether the user's online status is visible @@ -4418,6 +4554,9 @@ userPrivacySettingShowLinkInForwardedMessages = UserPrivacySetting; //@description A privacy setting for managing whether the user's phone number is visible userPrivacySettingShowPhoneNumber = UserPrivacySetting; +//@description A privacy setting for managing whether the user's bio is visible +userPrivacySettingShowBio = UserPrivacySetting; + //@description A privacy setting for managing whether the user can be invited to chats userPrivacySettingAllowChatInvites = UserPrivacySetting; @@ -4537,37 +4676,37 @@ connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string pl connectedWebsites websites:vector = ConnectedWebsites; -//@class ChatReportReason @description Describes the reason why a chat is reported +//@class ReportReason @description Describes the reason why a chat is reported //@description The chat contains spam messages -chatReportReasonSpam = ChatReportReason; +reportReasonSpam = ReportReason; //@description The chat promotes violence -chatReportReasonViolence = ChatReportReason; +reportReasonViolence = ReportReason; //@description The chat contains pornographic messages -chatReportReasonPornography = ChatReportReason; +reportReasonPornography = ReportReason; //@description The chat has child abuse related content -chatReportReasonChildAbuse = ChatReportReason; +reportReasonChildAbuse = ReportReason; //@description The chat contains copyrighted content -chatReportReasonCopyright = ChatReportReason; +reportReasonCopyright = ReportReason; //@description The location-based chat is unrelated to its stated location -chatReportReasonUnrelatedLocation = ChatReportReason; +reportReasonUnrelatedLocation = ReportReason; //@description The chat represents a fake account -chatReportReasonFake = ChatReportReason; +reportReasonFake = ReportReason; //@description The chat has illegal drugs related content -chatReportReasonIllegalDrugs = ChatReportReason; +reportReasonIllegalDrugs = ReportReason; //@description The chat contains messages with personal details -chatReportReasonPersonalDetails = ChatReportReason; +reportReasonPersonalDetails = ReportReason; //@description A custom reason provided by the user -chatReportReasonCustom = ChatReportReason; +reportReasonCustom = ReportReason; //@class TargetChat @description Describes the target chat to be opened @@ -4634,6 +4773,12 @@ internalLinkTypeBotStartInGroup bot_username:string start_parameter:string admin //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link +internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; + +//@description The link is a link to the folder section of the app settings +internalLinkTypeChatFolderSettings = InternalLinkType; + //@description The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link internalLinkTypeChatInvite invite_link:string = InternalLinkType; @@ -4643,9 +4788,6 @@ internalLinkTypeDefaultMessageAutoDeleteTimerSettings = InternalLinkType; //@description The link is a link to the edit profile section of the app settings internalLinkTypeEditProfileSettings = InternalLinkType; -//@description The link is a link to the filter section of the app settings -internalLinkTypeFilterSettings = InternalLinkType; - //@description The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame //@bot_username Username of the bot that owns the game //@game_short_name Short name of the game @@ -4715,6 +4857,11 @@ internalLinkTypeSettings = InternalLinkType; //@expect_custom_emoji True, if the sticker set is expected to contain custom emoji internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = InternalLinkType; +//@description 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 +//@story_sender_username Username of the sender of the story +//@story_id Story identifier +internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; + //@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; @@ -4760,6 +4907,96 @@ messageLink link:string is_public:Bool = MessageLink; messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +//@description Describes a video file sent in a story +//@duration Duration of the video, in seconds +//@width Video width +//@height Video height +//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets +//@is_animation True, if the video has no sound +//@minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null +//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes +//@video File containing the video +storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 video:file = StoryVideo; + + +//@class StoryContent @description Contains the content of a story + +//@description A photo story @photo The photo +storyContentPhoto photo:photo = StoryContent; + +//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null +storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent; + +//@description A story content that is not supported in the current TDLib version +storyContentUnsupported = StoryContent; + + +//@class InputStoryContent @description The content of a story to send + +//@description A photo story +//@photo Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920 +//@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable +inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector = InputStoryContent; + +//@description A video story +//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second +//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable +//@duration Precise duration of the video, in seconds; 0-60 +//@is_animation True, if the video has no sound +inputStoryContentVideo video:InputFile added_sticker_file_ids:vector duration:double is_animation:Bool = InputStoryContent; + + +//@class StoryList @description Describes a list of stories + +//@description The list of stories, shown in the main chat list and folder chat lists +storyListMain = StoryList; + +//@description The list of stories, shown in the Arvhive chat list +storyListArchive = StoryList; + + +//@description Contains information about interactions with a story +//@view_count Number of times the story was viewed +//@recent_viewer_user_ids Identifiers of at most 3 recent viewers of the story +storyInteractionInfo view_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; + +//@description Represents a story +//@id Unique story identifier among stories of the given sender +//@sender_chat_id Identifier of the chat that posted the story +//@date Point in time (Unix timestamp) when the story was published +//@is_being_edited True, if the story is being edited by the current user +//@is_edited True, if the story was edited +//@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration +//@is_visible_only_for_self True, if the story is visible only for the current user +//@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden +//@can_be_replied True, if the story can be replied in the chat with the story sender +//@can_get_viewers True, if users viewed the story can be received through getStoryViewers +//@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago +//@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions +//@privacy_settings Privacy rules affecting story visibility; may be approximate for non-owned stories +//@content Content of the story +//@caption Caption of the story +story id:int32 sender_chat_id:int53 date:int32 is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo privacy_settings:StoryPrivacySettings content:StoryContent caption:formattedText = Story; + +//@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories +stories total_count:int32 stories:vector = Stories; + +//@description Contains basic information about a story +//@story_id Unique story identifier among stories of the given sender +//@date Point in time (Unix timestamp) when the story was published +//@is_for_close_friends True, if the story is available only to close friends +storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; + +//@description Describes active stories posted by a chat +//@chat_id Identifier of the chat that posted the stories +//@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list +//@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 +//@max_read_story_id Identifier of the last read active story +//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) +chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector = ChatActiveStories; + + //@description Contains a part of a file @data File bytes filePart data:bytes = FilePart; @@ -4784,6 +5021,9 @@ fileTypeNotificationSound = FileType; //@description The file is a photo fileTypePhoto = FileType; +//@description The file is a photo published as a story +fileTypePhotoStory = FileType; + //@description The file is a profile photo fileTypeProfilePhoto = FileType; @@ -4811,6 +5051,9 @@ fileTypeVideo = FileType; //@description The file is a video note fileTypeVideoNote = FileType; +//@description The file is a video published as a story +fileTypeVideoStory = FileType; + //@description The file is a voice note fileTypeVoiceNote = FileType; @@ -4896,8 +5139,9 @@ networkStatistics since_date:int32 entries:vector = Netw //@video_upload_bitrate The maximum suggested bitrate for uploaded videos, in kbit/s //@preload_large_videos True, if the beginning of video files needs to be preloaded for instant playback //@preload_next_audio True, if the next audio track needs to be preloaded while the user is listening to an audio file +//@preload_stories True, if stories needs to be preloaded //@use_less_data_for_calls True, if "use less data for calls" option needs to be enabled -autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; +autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool preload_stories:Bool use_less_data_for_calls:Bool = AutoDownloadSettings; //@description Contains auto-download settings presets for the current user //@low Preset with lowest settings; supposed to be used by default when roaming @@ -5005,7 +5249,7 @@ tMeUrls urls:vector = TMeUrls; //@class SuggestedAction @description Describes an action suggested to the current user -//@description Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option +//@description Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction; //@description Suggests the user to check whether they still remember their 2-step verification password @@ -5027,6 +5271,9 @@ suggestedActionSetPassword authorization_delay:int32 = SuggestedAction; //@description Suggests the user to upgrade the Premium subscription from monthly payments to annual payments suggestedActionUpgradePremium = SuggestedAction; +//@description Suggests the user to restore a recently expired Premium subscription +suggestedActionRestorePremium = SuggestedAction; + //@description Suggests the user to subscribe to the Premium subscription with annual payments suggestedActionSubscribeToAnnualPremium = SuggestedAction; @@ -5334,6 +5581,9 @@ updateChatPendingJoinRequests chat_id:int53 pending_join_requests:chatJoinReques //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat updateChatReplyMarkup chat_id:int53 reply_markup_message_id:int53 = Update; +//@description The chat background was changed @chat_id Chat identifier @background The new chat background; may be null if background was reset to default +updateChatBackground chat_id:int53 background:chatBackground = Update; + //@description The chat theme was changed @chat_id Chat identifier @theme_name The new name of the chat theme; may be empty if theme was reset to default updateChatTheme chat_id:int53 theme_name:string = Update; @@ -5364,8 +5614,8 @@ updateChatIsBlocked chat_id:int53 is_blocked:Bool = Update; //@description A chat's has_scheduled_messages field has changed @chat_id Chat identifier @has_scheduled_messages New value of has_scheduled_messages updateChatHasScheduledMessages chat_id:int53 has_scheduled_messages:Bool = Update; -//@description The list of chat filters or a chat filter has changed @chat_filters The new list of chat filters @main_chat_list_position Position of the main chat list among chat filters, 0-based -updateChatFilters chat_filters:vector main_chat_list_position:int32 = Update; +//@description The list of chat folders or a chat folder has changed @chat_folders The new list of chat folders @main_chat_list_position Position of the main chat list among chat folders, 0-based +updateChatFolders chat_folders:vector main_chat_list_position:int32 = Update; //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. //-There is no guarantee that it will be sent just after the number of online users has changed @@ -5508,6 +5758,19 @@ updateUnreadMessageCount chat_list:ChatList unread_count:int32 unread_unmuted_co //@marked_as_unread_unmuted_count Total number of unmuted chats marked as unread updateUnreadChatCount chat_list:ChatList total_count:int32 unread_count:int32 unread_unmuted_count:int32 marked_as_unread_count:int32 marked_as_unread_unmuted_count:int32 = Update; +//@description A story was changed @story The new information about the story +updateStory story:story = Update; + +//@description A story became inaccessible @story_sender_chat_id Identifier of the chat that posted the story @story_id Story identifier +updateStoryDeleted story_sender_chat_id:int53 story_id:int32 = Update; + +//@description The list of active stories posted by a specific chat has changed +//@active_stories The new list of active stories +updateChatActiveStories active_stories:chatActiveStories = Update; + +//@description Number of chats in a story list has changed @story_list The story list @chat_count Approximate total number of chats with active stories in the list +updateStoryListChatCount story_list:StoryList chat_count:int32 = Update; + //@description An option changed its value @name The option name @value The new option value updateOption name:string value:OptionValue = Update; @@ -5643,17 +5906,21 @@ updateNewCustomQuery id:int64 data:string timeout:int32 = Update; //@description A poll was updated; for bots only @poll New data about the poll updatePoll poll:poll = Update; -//@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user -updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector = Update; +//@description A user changed the answer to a poll; for bots only +//@poll_id Unique poll identifier +//@voter_id Identifier of the message sender that changed the answer to the poll +//@option_ids 0-based identifiers of answer options, chosen by the user +updatePollAnswer poll_id:int64 voter_id:MessageSender option_ids:vector = Update; //@description User rights changed in a chat; for bots only //@chat_id Chat identifier //@actor_user_id Identifier of the user, changing the rights //@date Point in time (Unix timestamp) when the user rights was changed //@invite_link If user has joined the chat using an invite link, the invite link; may be null +//@via_chat_folder_invite_link True, if the user has joined the chat using an invite link for a chat folder //@old_chat_member Previous chat member //@new_chat_member New chat member -updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update; +updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink via_chat_folder_invite_link:Bool old_chat_member:chatMember new_chat_member:chatMember = Update; //@description A user sent a join request to a chat; for bots only //@chat_id Chat identifier @@ -5897,7 +6164,7 @@ getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo; //@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier getSecretChat secret_chat_id:int32 = SecretChat; -//@description Returns information about a chat by its identifier, this is an offline request if the current user is not a bot @chat_id Chat identifier +//@description Returns information about a chat by its identifier; this is an offline request if the current user is not a bot @chat_id Chat identifier getChat chat_id:int53 = Chat; //@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get @@ -5907,7 +6174,7 @@ getMessage chat_id:int53 message_id:int53 = Message; getMessageLocally chat_id:int53 message_id:int53 = Message; //@description Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages -//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, and topic messages without replied message respectively +//-of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message getRepliedMessage chat_id:int53 message_id:int53 = Message; @@ -5956,7 +6223,7 @@ searchPublicChat username:string = Chat; //@query Query to search for searchPublicChats query:string = Chats; -//@description Searches for the specified query in the title and username of already known chats, this is an offline request. Returns chats in the order seen in the main chat list +//@description Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list //@query Query to search for. If the query is empty, returns up to 50 recently found chats //@limit The maximum number of chats to be returned searchChats query:string limit:int32 = Chats; @@ -5975,6 +6242,11 @@ getTopChats category:TopChatCategory limit:int32 = Chats; //@description Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled @category Category of frequently used chats @chat_id Chat identifier removeTopChat category:TopChatCategory chat_id:int53 = Ok; +//@description Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request +//@query Query to search for +//@limit The maximum number of chats to be returned +searchRecentlyFoundChats query:string limit:int32 = Chats; + //@description Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first @chat_id Identifier of the chat to add addRecentlyFoundChat chat_id:int53 = Ok; @@ -5984,7 +6256,7 @@ removeRecentlyFoundChat chat_id:int53 = Ok; //@description Clears the list of recently found chats clearRecentlyFoundChats = Ok; -//@description Returns recently opened chats, this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned +//@description Returns recently opened chats; this is an offline request. Returns chats in the order of last opening @limit The maximum number of chats to be returned getRecentlyOpenedChats limit:int32 = Chats; //@description Checks whether a username can be set for a chat @chat_id Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or zero if the chat is being created @username Username to be checked @@ -6138,6 +6410,11 @@ getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int3 //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat getChatSponsoredMessages chat_id:int53 = SponsoredMessages; +//@description Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message +//@chat_id Chat identifier of the sponsored message +//@message_id Identifier of the sponsored message +clickChatSponsoredMessage chat_id:int53 message_id:int53 = Ok; + //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification removeNotification notification_group_id:int32 notification_id:int32 = Ok; @@ -6201,20 +6478,20 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Identifier of the replied message or story; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to Identifier of the replied message or story; pass null if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album //@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @@ -6225,12 +6502,12 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of a replied message; 0 if none +//@reply_to Identifier of the replied message or story; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_message_id:int53 options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages @@ -6249,16 +6526,13 @@ forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order resendMessages chat_id:int53 message_ids:vector = Messages; -//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier -sendChatScreenshotTakenNotification chat_id:int53 = Ok; - //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Identifier of the replied message or story; pass null if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added -addLocalMessage chat_id:int53 sender_id:MessageSender reply_to_message_id:int53 disable_notification:Bool input_message_content:InputMessageContent = Message; +addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:MessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; //@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; @@ -6454,7 +6728,7 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy setDefaultReactionType reaction_type:ReactionType = Ok; -//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entites +//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entities getTextEntities text:string = TextEntities; //@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode @@ -6499,13 +6773,13 @@ getThemeParametersJsonString theme:themeParameters = Text; //@option_ids 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers setPollAnswer chat_id:int53 message_id:int53 option_ids:vector = Ok; -//@description Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib +//@description Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@option_id 0-based identifier of the answer option -//@offset Number of users to skip in the result; must be non-negative -//@limit The maximum number of users to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned users is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached -getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = Users; +//@offset Number of voters to skip in the result; must be non-negative +//@limit The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached +getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = MessageSenders; //@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set //@chat_id Identifier of the chat to which the poll belongs @@ -6553,7 +6827,7 @@ shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:i //@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires -//@bot_user_id The identifier of the target bot +//@bot_user_id Identifier of the target bot //@chat_id Identifier of the chat where the query was sent //@user_location Location of the user; pass null if unknown or the bot doesn't need user's location //@query Text of the query @@ -6595,7 +6869,7 @@ getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name //@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot //@bot_user_id Identifier of the target bot //@button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App -//@data Received data +//@data The data sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@description Informs TDLib that a Web App is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. @@ -6606,8 +6880,8 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo; +//@reply_to Identifier of the replied message or story for the message sent by the Web App; pass null if none +openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:MessageReplyTo = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -6768,26 +7042,74 @@ getChatListsToAddChat chat_id:int53 = ChatLists; //@chat_list The chat list. Use getChatListsToAddChat to get suitable chat lists addChatToList chat_id:int53 chat_list:ChatList = Ok; -//@description Returns information about a chat filter by its identifier @chat_filter_id Chat filter identifier -getChatFilter chat_filter_id:int32 = ChatFilter; +//@description Returns information about a chat folder by its identifier @chat_folder_id Chat folder identifier +getChatFolder chat_folder_id:int32 = ChatFolder; -//@description Creates new chat filter. Returns information about the created chat filter. There can be up to getOption("chat_filter_count_max") chat filters, but the limit can be increased with Telegram Premium @filter Chat filter -createChatFilter filter:chatFilter = ChatFilterInfo; +//@description Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium @folder The new chat folder +createChatFolder folder:chatFolder = ChatFolderInfo; -//@description Edits existing chat filter. Returns information about the edited chat filter @chat_filter_id Chat filter identifier @filter The edited chat filter -editChatFilter chat_filter_id:int32 filter:chatFilter = ChatFilterInfo; +//@description Edits existing chat folder. Returns information about the edited chat folder @chat_folder_id Chat folder identifier @folder The edited chat folder +editChatFolder chat_folder_id:int32 folder:chatFolder = ChatFolderInfo; -//@description Deletes existing chat filter @chat_filter_id Chat filter identifier -deleteChatFilter chat_filter_id:int32 = Ok; +//@description Deletes existing chat folder @chat_folder_id Chat folder identifier @leave_chat_ids Identifiers of the chats to leave. The chats must be pinned or always included in the folder +deleteChatFolder chat_folder_id:int32 leave_chat_ids:vector = Ok; -//@description Changes the order of chat filters @chat_filter_ids Identifiers of chat filters in the new correct order @main_chat_list_position Position of the main chat list among chat filters, 0-based. Can be non-zero only for Premium users -reorderChatFilters chat_filter_ids:vector main_chat_list_position:int32 = Ok; +//@description Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted @chat_folder_id Chat folder identifier +getChatFolderChatsToLeave chat_folder_id:int32 = Chats; -//@description Returns recommended chat filters for the current user -getRecommendedChatFilters = RecommendedChatFilters; +//@description Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly @folder The new chat folder +getChatFolderChatCount folder:chatFolder = Count; -//@description Returns default icon name for a filter. Can be called synchronously @filter Chat filter -getChatFilterDefaultIconName filter:chatFilter = Text; +//@description Changes the order of chat folders @chat_folder_ids Identifiers of chat folders in the new correct order @main_chat_list_position Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users +reorderChatFolders chat_folder_ids:vector main_chat_list_position:int32 = Ok; + +//@description Returns recommended chat folders for the current user +getRecommendedChatFolders = RecommendedChatFolders; + +//@description Returns default icon name for a folder. Can be called synchronously @folder Chat folder +getChatFolderDefaultIconName folder:chatFolder = ChatFolderIcon; + +//@description Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link @chat_folder_id Chat folder identifier +getChatsForChatFolderInviteLink chat_folder_id:int32 = Chats; + +//@description Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats +//@chat_folder_id Chat folder identifier +//@name Name of the link; 0-32 characters +//@chat_ids Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation +createChatFolderInviteLink chat_folder_id:int32 name:string chat_ids:vector = ChatFolderInviteLink; + +//@description Returns invite links created by the current user for a shareable chat folder @chat_folder_id Chat folder identifier +getChatFolderInviteLinks chat_folder_id:int32 = ChatFolderInviteLinks; + +//@description Edits an invite link for a chat folder +//@chat_folder_id Chat folder identifier +//@invite_link Invite link to be edited +//@name New name of the link; 0-32 characters +//@chat_ids New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing +editChatFolderInviteLink chat_folder_id:int32 invite_link:string name:string chat_ids:vector = ChatFolderInviteLink; + +//@description Deletes an invite link for a chat folder +//@chat_folder_id Chat folder identifier +//@invite_link Invite link to be deleted +deleteChatFolderInviteLink chat_folder_id:int32 invite_link:string = Ok; + +//@description Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder @invite_link Invite link to be checked +checkChatFolderInviteLink invite_link:string = ChatFolderInviteLinkInfo; + +//@description Adds a chat folder by an invite link @invite_link Invite link for the chat folder @chat_ids Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet +addChatFolderByInviteLink invite_link:string chat_ids:vector = Ok; + +//@description Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder @chat_folder_id Chat folder identifier +getChatFolderNewChats chat_folder_id:int32 = Chats; + +//@description Process new chats added to a shareable chat folder by its owner @chat_folder_id Chat folder identifier @added_chat_ids Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet +processChatFolderNewChats chat_folder_id:int32 added_chat_ids:vector = Ok; + +//@description Returns settings for automatic moving of chats to and from the Archive chat lists +getArchiveChatListSettings = ArchiveChatListSettings; + +//@description Changes settings for automatic moving of chats to and from the Archive chat lists @settings New settings +setArchiveChatListSettings settings:archiveChatListSettings = Ok; //@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right @@ -6811,6 +7133,13 @@ setChatMessageAutoDeleteTime chat_id:int53 message_auto_delete_time:int32 = Ok; //@permissions New non-administrator members permissions in the chat setChatPermissions chat_id:int53 permissions:chatPermissions = Ok; +//@description Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users +//@chat_id Chat identifier +//@background The input background to use; pass null to create a new filled background or to remove the current background +//@type Background type; pass null to remove the current background +//@dark_theme_dimming Dimming of the background in dark themes, as a percentage; 0-100 +setChatBackground chat_id:int53 background:InputBackground type:BackgroundType dark_theme_dimming:int32 = Ok; + //@description Changes the chat theme. Supported only in private and secret chats @chat_id Chat identifier @theme_name Name of the new chat theme; pass an empty string to return the default theme setChatTheme chat_id:int53 theme_name:string = Ok; @@ -6827,7 +7156,7 @@ setChatNotificationSettings chat_id:int53 notification_settings:chatNotification //@has_protected_content New value of has_protected_content toggleChatHasProtectedContent chat_id:int53 has_protected_content:Bool = Ok; -//@description Changes the tranlatable state of a chat; for Telegram Premium users only @chat_id Chat identifier @is_translatable New value of is_translatable +//@description Changes the translatable state of a chat; for Telegram Premium users only @chat_id Chat identifier @is_translatable New value of is_translatable toggleChatIsTranslatable chat_id:int53 is_translatable:Bool = Ok; //@description Changes the marked as unread state of a chat @chat_id Chat identifier @is_marked_as_unread New value of is_marked_as_unread @@ -6946,7 +7275,7 @@ addSavedNotificationSound sound:InputFile = NotificationSound; removeSavedNotificationSound notification_sound_id:int64 = Ok; -//@description Returns list of chats with non-default notification settings +//@description Returns list of chats with non-default notification settings for new messages //@scope If specified, only chats from the scope will be returned; pass null to return chats from all scopes //@compare_sound Pass true to include in the response chats with only non-default sound getChatNotificationSettingsExceptions scope:NotificationSettingsScope compare_sound:Bool = Chats; @@ -6970,6 +7299,94 @@ toggleChatIsPinned chat_list:ChatList chat_id:int53 is_pinned:Bool = Ok; //@description Changes the order of pinned chats @chat_list Chat list in which to change the order of pinned chats @chat_ids The new list of pinned chats setPinnedChats chat_list:ChatList chat_ids:vector = Ok; +//@description Traverse all chats in a chat list and marks all messages in the chats as read @chat_list Chat list in which to mark all chats as read +readChatList chat_list:ChatList = Ok; + + +//@description Returns a story +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Story identifier +//@only_local Pass true to get only locally available information without sending network requests +getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; + +//@description Sends a new story. Returns a temporary story with identifier 0 +//@content Content of the story +//@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters +//@privacy_settings The privacy settings for the story +//@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, 2 * 86400, 3 * 86400, or 7 * 86400 for Telegram Premium users, and 86400 otherwise +//@is_pinned Pass true to keep the story accessible after expiration +//@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting +sendStory content:InputStoryContent caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; + +//@description Changes content and caption of a previously sent story +//@story_id Identifier of the story to edit +//@content New content of the story; pass null to keep the current content +//@caption New story caption; pass null to keep the current caption +editStory story_id:int32 content:InputStoryContent caption:formattedText = Ok; + +//@description Changes privacy settings of a previously sent story @story_id Identifier of the story @privacy_settings The new privacy settigs for the story +setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; + +//@description Toggles whether a story is accessible after expiration @story_id Identifier of the story @is_pinned Pass true to make the story accessible after expiration; pass false to make it private +toggleStoryIsPinned story_id:int32 is_pinned:Bool = Ok; + +//@description Deletes a previously sent story @story_id Identifier of the story to delete +deleteStory story_id:int32 = Ok; + +//@description Returns list of chats with non-default notification settings for stories +getStoryNotificationSettingsExceptions = Chats; + +//@description 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 +//@story_list The story list in which to load active stories +loadActiveStories story_list:StoryList = Ok; + +//@description Changes story list in which stories from the chat are shown @chat_id Identifier of the chat that posted stories @story_list New list for active stories posted by the chat +setChatActiveStoriesList chat_id:int53 story_list:StoryList = Ok; + +//@description Returns the list of active stories posted by the given chat @chat_id Chat identifier +getChatActiveStories chat_id:int53 = ChatActiveStories; + +//@description Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). +//-For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story +//@limit 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 +getChatPinnedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; + +//@description Returns the list of all stories of the current user. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). +//-For optimal performance, the number of returned stories is chosen by TDLib +//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story +//@limit 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 +getArchivedStories from_story_id:int32 limit:int32 = Stories; + +//@description Informs TDLib that a story is opened and is being viewed by the user +//@story_sender_chat_id The identifier of the sender of the opened story +//@story_id The identifier of the story +openStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Informs TDLib that a story is closed by the user +//@story_sender_chat_id The identifier of the sender of the story to close +//@story_id The identifier of the story +closeStory story_sender_chat_id:int53 story_id:int32 = Ok; + +//@description Returns viewers of a recent outgoing story. The method can be called if story.can_get_viewers == true. The views are returned in a reverse chronological order (i.e., in order of decreasing view_date) +//-For optimal performance, the number of returned stories is chosen by TDLib +//@story_id Story identifier +//@offset_viewer A viewer from which to return next viewers; pass null to get results from the beginning +//@limit The maximum number of story viewers to return +//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +getStoryViewers story_id:int32 offset_viewer:messageViewer limit:int32 = MessageViewers; + +//@description Reports a story to the Telegram moderators +//@story_sender_chat_id The identifier of the sender of the story to report +//@story_id The identifier of the story to report +//@reason The reason for reporting the story +//@text Additional report details; 0-1024 characters +reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:string = Ok; + //@description Returns information about a bot that can be added to attachment menu @bot_user_id Bot's user identifier getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; @@ -7306,7 +7723,7 @@ setGroupCallParticipantIsSpeaking group_call_id:int32 audio_source:int32 is_spea //@description Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves //@group_call_id Group call identifier //@participant_id Participant identifier -//@is_muted Pass true to mute the user; pass false to unmute the them +//@is_muted Pass true to mute the user; pass false to unmute them toggleGroupCallParticipantIsMuted group_call_id:int32 participant_id:MessageSender is_muted:Bool = Ok; //@description Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level @@ -7367,7 +7784,7 @@ addContact contact:contact share_phone_number:Bool = Ok; //@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported importContacts contacts:vector = ImportedContacts; -//@description Returns all user contacts +//@description Returns all contacts of the user getContacts = Users; //@description Searches for the specified query in the first names, last names and usernames of the known user contacts @@ -7389,6 +7806,12 @@ changeImportedContacts contacts:vector = ImportedContacts; //@description Clears all imported contacts, contact list remains unchanged clearImportedContacts = Ok; +//@description Changes the list of close friends of the current user @user_ids User identifiers of close friends; the users must be contacts of the current user +setCloseFriends user_ids:vector = Ok; + +//@description Returns all close friends of the current user +getCloseFriends = Users; + //@description Changes a personal profile photo of a contact user @user_id User identifier @photo Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; @@ -7568,15 +7991,13 @@ toggleUsernameIsActive username:string is_active:Bool = Ok; //@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified reorderActiveUsernames usernames:vector = Ok; -//@description Changes the emoji status of the current user; for Telegram Premium users only -//@emoji_status New emoji status; pass null to switch to the default badge -//@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually -setEmojiStatus emoji_status:emojiStatus duration:int32 = Ok; +//@description Changes the emoji status of the current user; for Telegram Premium users only @emoji_status New emoji status; pass null to switch to the default badge +setEmojiStatus emoji_status:emojiStatus = Ok; //@description Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer @location The new location of the user setLocation location:location = Ok; -//@description Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code +//@description Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code //@phone_number The new phone number of the user in international format //@settings Settings for the authentication of the user's phone number; pass null to use default settings changePhoneNumber phone_number:string settings:phoneNumberAuthenticationSettings = AuthenticationCodeInfo; @@ -7626,23 +8047,50 @@ setDefaultGroupAdministratorRights default_group_administrator_rights:chatAdmini setDefaultChannelAdministratorRights default_channel_administrator_rights:chatAdministratorRights = Ok; -//@description Sets the text shown in the chat with the bot if the chat is empty; bots only -//@language_code A two-letter ISO 639-1 language code. If empty, the description will be shown to all users, for which language there are no dedicated description +//@description Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name +//@name New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty +setBotName bot_user_id:int53 language_code:string name:string = Ok; + +//@description Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code or an empty string +getBotName bot_user_id:int53 language_code:string = Text; + +//@description Changes a profile photo for a bot @bot_user_id Identifier of the target bot @photo Profile photo to set; pass null to delete the chat photo +setBotProfilePhoto bot_user_id:int53 photo:InputChatPhoto = Ok; + +//@description 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 +//@bot_user_id Identifier of the target bot +//@username The username to change +//@is_active Pass true to activate the username; pass false to disable it +toggleBotUsernameIsActive bot_user_id:int53 username:string is_active:Bool = Ok; + +//@description Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true @bot_user_id Identifier of the target bot @usernames The new order of active usernames. All currently active usernames must be specified +reorderBotActiveUsernames bot_user_id:int53 usernames:vector = Ok; + +//@description Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description //@param_description New bot's description on the specified language -setBotInfoDescription language_code:string description:string = Ok; +setBotInfoDescription bot_user_id:int53 language_code:string description:string = Ok; -//@description Returns the text shown in the chat with the bot if the chat is empty in the given language; bots only +//@description Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot //@language_code A two-letter ISO 639-1 language code or an empty string -getBotInfoDescription language_code:string = Text; +getBotInfoDescription bot_user_id:int53 language_code:string = Text; -//@description Sets the text shown on the bot's profile page and sent together with the link when users share the bot; bots only -//@language_code A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users, for which language there are no dedicated description +//@description Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot +//@language_code A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description //@short_description New bot's short description on the specified language -setBotInfoShortDescription language_code:string short_description:string = Ok; +setBotInfoShortDescription bot_user_id:int53 language_code:string short_description:string = Ok; -//@description Returns the text shown on the bot's profile page and sent together with the link when users share the bot in the given language; bots only +//@description Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true +//@bot_user_id Identifier of the target bot //@language_code A two-letter ISO 639-1 language code or an empty string -getBotInfoShortDescription language_code:string = Text; +getBotInfoShortDescription bot_user_id:int53 language_code:string = Text; //@description Returns all active sessions of the current user @@ -7657,7 +8105,7 @@ terminateAllOtherSessions = Ok; //@description Toggles whether a session can accept incoming calls @session_id Session identifier @can_accept_calls Pass true to allow accepting incoming calls by the session; pass false otherwise toggleSessionCanAcceptCalls session_id:int64 can_accept_calls:Bool = Ok; -//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepring secret chats by the session; pass false otherwise +//@description Toggles whether a session can accept incoming secret chats @session_id Session identifier @can_accept_secret_chats Pass true to allow accepting secret chats by the session; pass false otherwise toggleSessionCanAcceptSecretChats session_id:int64 can_accept_secret_chats:Bool = Ok; //@description Changes the period of inactivity after which sessions will automatically be terminated @inactive_session_ttl_days New number of days of inactivity before sessions will be automatically terminated; 1-366 days @@ -7804,7 +8252,7 @@ getBackgroundUrl name:string type:BackgroundType = HttpUrl; searchBackground name:string = Background; //@description Changes the background selected by the user; adds background to the list of installed backgrounds -//@background The input background to use; pass null to create a new filled backgrounds or to remove the current background +//@background The input background to use; pass null to create a new filled background or to remove the current background //@type Background type; pass null to use the default type of the remote background or to remove the current background //@for_dark_theme Pass true if the background is changed for a dark theme setBackground background:InputBackground type:BackgroundType for_dark_theme:Bool = Background; @@ -7827,7 +8275,9 @@ getLanguagePackInfo language_pack_id:string = LanguagePackInfo; //@keys Language pack keys of the strings to be returned; leave empty to request all available strings getLanguagePackStrings language_pack_id:string keys:vector = LanguagePackStrings; -//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization @language_pack_id Language pack identifier +//@description Fetches the latest versions of all strings from a language pack in the current localization target from the server. +//-This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization +//@language_pack_id Language pack identifier synchronizeLanguagePack language_pack_id:string = Ok; //@description Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization @language_pack_id Identifier of a language pack to be added @@ -7910,14 +8360,14 @@ removeChatActionBar chat_id:int53 = Ok; //@message_ids Identifiers of reported messages; may be empty to report the whole chat //@reason The reason for reporting the chat //@text Additional report details; 0-1024 characters -reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok; +reportChat chat_id:int53 message_ids:vector reason:ReportReason text:string = Ok; //@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported //@chat_id Chat identifier //@file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported //@reason The reason for reporting the chat photo //@text Additional report details; 0-1024 characters -reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok; +reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok; //@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions //@chat_id Chat identifier @@ -8223,7 +8673,7 @@ getDeepLinkInfo link:string = DeepLinkInfo; //@description Returns application config, provided by the server. Can be called before authorization getApplicationConfig = JsonValue; -//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram); for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version +//@description Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed @previous_application_version The previous application version addApplicationChangelog previous_application_version:string = Ok; //@description Saves application log event on the server. Can be called before authorization @type Event type @chat_id Optional chat identifier, associated with the event @data The log event data diff --git a/example/bot/Bot.go b/example/bot/Bot.go index 357a014..d4513ba 100644 --- a/example/bot/Bot.go +++ b/example/bot/Bot.go @@ -86,8 +86,11 @@ func main() { ParseMode: &tdlib.TextParseModeHTML{}, }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContent: &tdlib.InputMessageText{ Text: text, }, diff --git a/example/command/ReplyCommand.go b/example/command/ReplyCommand.go index ff2d783..f88c2f5 100644 --- a/example/command/ReplyCommand.go +++ b/example/command/ReplyCommand.go @@ -97,8 +97,11 @@ func main() { ParseMode: &tdlib.TextParseModeHTML{}, }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContent: &tdlib.InputMessageText{ Text: text, }, @@ -109,8 +112,11 @@ func main() { log.Printf("Message sent, ID: %d", m.Id) case "/repeat": m, err := client.SendMessage(&tdlib.SendMessageRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContent: &tdlib.InputMessageText{ Text: &tdlib.FormattedText{Text: tdlib.CommandArgument(msgText)}, }, diff --git a/example/media/Photo_or_Album.go b/example/media/Photo_or_Album.go index ed456de..e44c35d 100644 --- a/example/media/Photo_or_Album.go +++ b/example/media/Photo_or_Album.go @@ -97,8 +97,11 @@ func main() { ParseMode: &tdlib.TextParseModeHTML{}, }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContent: &tdlib.InputMessagePhoto{ Photo: &tdlib.InputFileLocal{ Path: "./myht9-1486821485193084928.jpg", @@ -116,8 +119,11 @@ func main() { ParseMode: &tdlib.TextParseModeHTML{}, }) m, err := client.SendMessageAlbum(&tdlib.SendMessageAlbumRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContents: []tdlib.InputMessageContent{ &tdlib.InputMessagePhoto{ Photo: &tdlib.InputFileLocal{ diff --git a/example/pending/PendingUpdate.go b/example/pending/PendingUpdate.go index 3d71dc6..738f506 100644 --- a/example/pending/PendingUpdate.go +++ b/example/pending/PendingUpdate.go @@ -91,8 +91,11 @@ func main() { ParseMode: &tdlib.TextParseModeHTML{}, }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ - ChatId: chatId, - ReplyToMessageId: msgId, + ChatId: chatId, + ReplyTo: &tdlib.MessageReplyToMessage{ + ChatId: chatId, + MessageId: msgId, + }, InputMessageContent: &tdlib.InputMessageText{ Text: text, },