From bcfdac2c36e7336bdb0dc359cdfa1a58ce2455a3 Mon Sep 17 00:00:00 2001 From: c0re100 Date: Sun, 5 Apr 2026 05:42:41 +0800 Subject: [PATCH] Update to TDLib 1.8.63 --- client/function.go | 535 +++++++++++++++++-- client/type.go | 1168 +++++++++++++++++++++++++++++++++++++++-- client/unmarshaler.go | 472 +++++++++++++++++ data/td_api.tl | 446 ++++++++++++---- 4 files changed, 2451 insertions(+), 170 deletions(-) diff --git a/client/function.go b/client/function.go index 4d2087a..35f1f78 100755 --- a/client/function.go +++ b/client/function.go @@ -1505,7 +1505,7 @@ type GetRepliedMessageRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, the message with the request to disable content protection for messageChatHasProtectedContentToggled, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist +// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, the message with the request to disable content protection for messageChatHasProtectedContentToggled, the message with the poll for messagePollOptionAdded and messagePollOptionDeleted, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -1643,6 +1643,38 @@ func (client *Client) GetMessageProperties(req *GetMessagePropertiesRequest) (*M return UnmarshalMessageProperties(result.Data) } +type GetPollOptionPropertiesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Unique identifier of the answer option, which properties will be returned + PollOptionId string `json:"poll_option_id"` +} + +// Returns properties of a poll option. This is an offline method +func (client *Client) GetPollOptionProperties(req *GetPollOptionPropertiesRequest) (*PollOptionProperties, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPollOptionProperties", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "poll_option_id": req.PollOptionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPollOptionProperties(result.Data) +} + type GetMessageThreadRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -3301,7 +3333,7 @@ type SearchMessagesRequest struct { Offset string `json:"offset"` // The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` - // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function + // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterUnreadPollVote, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // Additional filter for type of the chat of the searched messages; pass null to search for messages in all chats ChatTypeFilter SearchMessagesChatTypeFilter `json:"chat_type_filter"` @@ -3842,7 +3874,7 @@ func (client *Client) GetChatMessageByDate(req *GetChatMessageByDateRequest) (*M type GetChatSparseMessagePositionsRequest struct { // Identifier of the chat in which to return information about message positions ChatId int64 `json:"chat_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterUnreadPollVote are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about message positions FromMessageId int64 `json:"from_message_id"` @@ -3882,7 +3914,7 @@ type GetChatMessageCalendarRequest struct { ChatId int64 `json:"chat_id"` // Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics and message threads aren't supported TopicId MessageTopic `json:"topic_id"` - // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function + // Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterUnreadPollVote are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // The message identifier from which to return information about messages; use 0 to get results from the last message FromMessageId int64 `json:"from_message_id"` @@ -3952,7 +3984,7 @@ type GetChatMessagePositionRequest struct { ChatId int64 `json:"chat_id"` // Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages; message threads aren't supported TopicId MessageTopic `json:"topic_id"` - // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function + // Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterUnreadPollVote, and searchMessagesFilterFailedToSend are unsupported in this function Filter SearchMessagesFilter `json:"filter"` // Message identifier MessageId int64 `json:"message_id"` @@ -4437,6 +4469,10 @@ type GetMessageLinkRequest struct { MessageId int64 `json:"message_id"` // If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview MediaTimestamp int32 `json:"media_timestamp"` + // If not 0, identifier of the checklist task in the message to be linked + ChecklistTaskId int32 `json:"checklist_task_id"` + // If not empty, identifier of the poll option in the message to be linked + PollOptionId string `json:"poll_option_id"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` // Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic @@ -4453,6 +4489,8 @@ func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink, "chat_id": req.ChatId, "message_id": req.MessageId, "media_timestamp": req.MediaTimestamp, + "checklist_task_id": req.ChecklistTaskId, + "poll_option_id": req.PollOptionId, "for_album": req.ForAlbum, "in_message_thread": req.InMessageThread, }, @@ -4531,9 +4569,11 @@ type TranslateTextRequest struct { Text *FormattedText `json:"text"` // Language code of the language to which the message is translated. Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" ToLanguageCode string `json:"to_language_code"` + // Tone of the translation; must be one of "", "formal", "neutral", "casual"; defaults to "neutral" + Tone string `json:"tone"` } -// Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +// Translates a text to the given language; must not be used in secret chats. If the current user is a Telegram Premium user, then text formatting is preserved func (client *Client) TranslateText(req *TranslateTextRequest) (*FormattedText, error) { result, err := client.Send(Request{ meta: meta{ @@ -4542,6 +4582,7 @@ func (client *Client) TranslateText(req *TranslateTextRequest) (*FormattedText, Data: map[string]interface{}{ "text": req.Text, "to_language_code": req.ToLanguageCode, + "tone": req.Tone, }, }) if err != nil { @@ -4562,9 +4603,11 @@ type TranslateMessageTextRequest struct { MessageId int64 `json:"message_id"` // Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values ToLanguageCode string `json:"to_language_code"` + // Tone of the translation; see translateText.tone for the list of supported values + Tone string `json:"tone"` } -// Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +// Extracts text or caption of the given message and translates it to the given language; must not be used in secret chats. If the current user is a Telegram Premium user, then text formatting is preserved func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*FormattedText, error) { result, err := client.Send(Request{ meta: meta{ @@ -4574,6 +4617,7 @@ func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*F "chat_id": req.ChatId, "message_id": req.MessageId, "to_language_code": req.ToLanguageCode, + "tone": req.Tone, }, }) if err != nil { @@ -4592,8 +4636,10 @@ type SummarizeMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message MessageId int64 `json:"message_id"` - // Pass a language code to which the summary will be translated; may be empty if translation isn't needed. See translateText.to_language_code for the list of supported values + // Pass a language code to which the summary will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values TranslateToLanguageCode string `json:"translate_to_language_code"` + // Tone of the summarization; see translateText.tone for the list of supported values + Tone string `json:"tone"` } // Summarizes content of the message with non-empty summary_language_code @@ -4606,6 +4652,7 @@ func (client *Client) SummarizeMessage(req *SummarizeMessageRequest) (*Formatted "chat_id": req.ChatId, "message_id": req.MessageId, "translate_to_language_code": req.TranslateToLanguageCode, + "tone": req.Tone, }, }) if err != nil { @@ -4619,6 +4666,67 @@ func (client *Client) SummarizeMessage(req *SummarizeMessageRequest) (*Formatted return UnmarshalFormattedText(result.Data) } +type ComposeTextWithAiRequest struct { + // The original text + Text *FormattedText `json:"text"` + // Pass a language code to which the text will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values + TranslateToLanguageCode string `json:"translate_to_language_code"` + // Name of the style of the resulted text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text + StyleName string `json:"style_name"` + // Pass true to add emoji to the text + AddEmojis bool `json:"add_emojis"` +} + +// Changes text using an AI model; must not be used in secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) ComposeTextWithAi(req *ComposeTextWithAiRequest) (*FormattedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "composeTextWithAi", + }, + Data: map[string]interface{}{ + "text": req.Text, + "translate_to_language_code": req.TranslateToLanguageCode, + "style_name": req.StyleName, + "add_emojis": req.AddEmojis, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFormattedText(result.Data) +} + +type FixTextWithAiRequest struct { + // The original text + Text *FormattedText `json:"text"` +} + +// Fixes text using an AI model; must not be used in secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +func (client *Client) FixTextWithAi(req *FixTextWithAiRequest) (*FixedText, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "fixTextWithAi", + }, + Data: map[string]interface{}{ + "text": req.Text, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFixedText(result.Data) +} + type RecognizeSpeechRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` @@ -7167,6 +7275,35 @@ func (client *Client) ReadAllForumTopicReactions(req *ReadAllForumTopicReactions return UnmarshalOk(result.Data) } +type ReadAllForumTopicPollVotesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Forum topic identifier in which poll votes are marked as read + ForumTopicId int32 `json:"forum_topic_id"` +} + +// Marks all poll votes in a topic in a forum supergroup chat as read +func (client *Client) ReadAllForumTopicPollVotes(req *ReadAllForumTopicPollVotesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllForumTopicPollVotes", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "forum_topic_id": req.ForumTopicId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type UnpinAllForumTopicMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` @@ -7861,7 +7998,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl, MentionName, and DateTime entities from a marked-up text. Can be called synchronously func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := Execute(Request{ meta: meta{ @@ -7884,7 +8021,7 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { } // deprecated -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl, MentionName, and DateTime entities from a marked-up text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { return ParseTextEntities(req)} @@ -8240,6 +8377,70 @@ func GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Te func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) { return GetThemeParametersJsonString(req)} +type AddPollOptionRequest struct { + // Identifier of the chat to which the poll belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message containing the poll. Use messagePoll.can_add_option to check whether an option can be added + MessageId int64 `json:"message_id"` + // The new option + Option *InputPollOption `json:"option"` +} + +// Adds an option to a poll +func (client *Client) AddPollOption(req *AddPollOptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addPollOption", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "option": req.Option, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeletePollOptionRequest struct { + // Identifier of the chat to which the poll belongs + ChatId int64 `json:"chat_id"` + // Identifier of the message containing the poll + MessageId int64 `json:"message_id"` + // Unique identifier of the option. Use pollOptionProperties.can_be_deleted to check whether the option can be deleted by the user + OptionId string `json:"option_id"` +} + +// Adds an option to a poll +func (client *Client) DeletePollOption(req *DeletePollOptionRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deletePollOption", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "option_id": req.OptionId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetPollAnswerRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` @@ -8249,7 +8450,7 @@ type SetPollAnswerRequest struct { OptionIds []int32 `json:"option_ids"` } -// Changes the user answer to a poll. A poll in quiz mode can be answered only once +// Changes the user answer to a poll func (client *Client) SetPollAnswer(req *SetPollAnswerRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -8285,7 +8486,7 @@ type GetPollVotersRequest struct { Limit int32 `json:"limit"` } -// 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 +// Returns message senders voted for the specified option in a poll; use poll.can_get_voters to check whether the method can be used. For optimal performance, the number of returned users is chosen by TDLib func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*PollVoters, error) { result, err := client.Send(Request{ meta: meta{ @@ -8557,10 +8758,8 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) { } type ShareUsersWithBotRequest struct { - // Identifier of the chat with the bot - ChatId int64 `json:"chat_id"` - // Identifier of the message with the button - MessageId int64 `json:"message_id"` + // Source of the button + Source KeyboardButtonSource `json:"source"` // Identifier of the button ButtonId int32 `json:"button_id"` // Identifiers of the shared users @@ -8576,8 +8775,7 @@ func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, err Type: "shareUsersWithBot", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, + "source": req.Source, "button_id": req.ButtonId, "shared_user_ids": req.SharedUserIds, "only_check": req.OnlyCheck, @@ -8595,10 +8793,8 @@ func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, err } type ShareChatWithBotRequest struct { - // Identifier of the chat with the bot - ChatId int64 `json:"chat_id"` - // Identifier of the message with the button - MessageId int64 `json:"message_id"` + // Source of the button + Source KeyboardButtonSource `json:"source"` // Identifier of the button ButtonId int32 `json:"button_id"` // Identifier of the shared chat @@ -8614,8 +8810,7 @@ func (client *Client) ShareChatWithBot(req *ShareChatWithBotRequest) (*Ok, error Type: "shareChatWithBot", }, Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, + "source": req.Source, "button_id": req.ButtonId, "shared_chat_id": req.SharedChatId, "only_check": req.OnlyCheck, @@ -8772,6 +8967,64 @@ func (client *Client) GetPreparedInlineMessage(req *GetPreparedInlineMessageRequ return UnmarshalPreparedInlineMessage(result.Data) } +type SavePreparedKeyboardButtonRequest struct { + // Identifier of the user + UserId int64 `json:"user_id"` + // The button; must be of the type keyboardButtonTypeRequestUsers, keyboardButtonTypeRequestChat, or keyboardButtonTypeRequestManagedBot + Button *KeyboardButton `json:"button"` +} + +// Saves a keyboard button to be shown to the given user; for bots only +func (client *Client) SavePreparedKeyboardButton(req *SavePreparedKeyboardButtonRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "savePreparedKeyboardButton", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + "button": req.Button, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + +type GetPreparedKeyboardButtonRequest struct { + // Identifier of the bot that created the button + BotUserId int64 `json:"bot_user_id"` + // Identifier of the prepared button + PreparedButtonId string `json:"prepared_button_id"` +} + +// Returns a keyboard button prepared by the bot for the user. The button will be of the type keyboardButtonTypeRequestUsers, keyboardButtonTypeRequestChat, or keyboardButtonTypeRequestManagedBot +func (client *Client) GetPreparedKeyboardButton(req *GetPreparedKeyboardButtonRequest) (*KeyboardButton, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPreparedKeyboardButton", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "prepared_button_id": req.PreparedButtonId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalKeyboardButton(result.Data) +} + type GetGrossingWebAppBotsRequest struct { // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results Offset string `json:"offset"` @@ -9639,6 +9892,76 @@ func (client *Client) ClickAnimatedEmojiMessage(req *ClickAnimatedEmojiMessageRe return UnmarshalSticker(result.Data) } +type ListenToAudioRequest struct { + // Identifier of the file with an audio + AudioFileId int32 `json:"audio_file_id"` + // Duration of the listening to the audio, in seconds + Duration int32 `json:"duration"` +} + +// Informs TDLib that an audio was listened by the user +func (client *Client) ListenToAudio(req *ListenToAudioRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "listenToAudio", + }, + Data: map[string]interface{}{ + "audio_file_id": req.AudioFileId, + "duration": req.Duration, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type SendMessageViewMetricsRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // The identifier of the message being viewed + MessageId int64 `json:"message_id"` + // The amount of time the message was seen by at least 1 pixel; in milliseconds + TimeInViewMs int32 `json:"time_in_view_ms"` + // The amount of time the message was seen by at least 1 pixel within 15 seconds after any action from the user; in milliseconds + ActiveTimeInViewMs int32 `json:"active_time_in_view_ms"` + // The ratio of the post height to the viewport height in 1/1000 fractions + HeightToViewportRatioPerMille int32 `json:"height_to_viewport_ratio_per_mille"` + // The ratio of the viewed post height to the full post height in 1/1000 fractions; 0-1000 + SeenRangeRatioPerMille int32 `json:"seen_range_ratio_per_mille"` +} + +// Informs TDLib about details of a message view by the user from a chat, a message thread or a forum topic history. The method must be called if the message wasn't seen for more than 300 milliseconds, the viewport was destroyed, or the total view duration exceeded 5 minutes +func (client *Client) SendMessageViewMetrics(req *SendMessageViewMetricsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "sendMessageViewMetrics", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "time_in_view_ms": req.TimeInViewMs, + "active_time_in_view_ms": req.ActiveTimeInViewMs, + "height_to_viewport_ratio_per_mille": req.HeightToViewportRatioPerMille, + "seen_range_ratio_per_mille": req.SeenRangeRatioPerMille, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type GetInternalLinkRequest struct { // Expected type of the link Type InternalLinkType `json:"type"` @@ -9812,6 +10135,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data) + case TypeInternalLinkTypeRequestManagedBot: + return UnmarshalInternalLinkTypeRequestManagedBot(result.Data) + case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(result.Data) @@ -10097,6 +10423,32 @@ func (client *Client) ReadAllChatReactions(req *ReadAllChatReactionsRequest) (*O return UnmarshalOk(result.Data) } +type ReadAllChatPollVotesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Marks all poll votes in a chat as read +func (client *Client) ReadAllChatPollVotes(req *ReadAllChatPollVotesRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "readAllChatPollVotes", + }, + 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 CreatePrivateChatRequest struct { // User identifier UserId int64 `json:"user_id"` @@ -14830,7 +15182,7 @@ type ImportMessagesRequest struct { AttachedFiles []InputFile `json:"attached_files"` } -// Imports messages exported from another app +// Imports messages exported from another application func (client *Client) ImportMessages(req *ImportMessagesRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -16369,7 +16721,7 @@ func (client *Client) SetLiveStoryMessageSender(req *SetLiveStoryMessageSenderRe type SendGroupCallMessageRequest struct { // Group call identifier GroupCallId int32 `json:"group_call_id"` - // Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, which depends on paid_message_star_count. Can't contain line feeds for live stories + // Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, which depends on paid_message_star_count. Can't contain line feeds for live stories. Can contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities for live stories Text *FormattedText `json:"text"` // The number of Telegram Stars the user agreed to pay to send the message; for live stories only; 0-getOption("paid_group_call_message_star_count_max"). Must be 0 for messages sent to live stories posted by the current user PaidMessageStarCount int64 `json:"paid_message_star_count"` @@ -17656,7 +18008,7 @@ func (client *Client) SetUserPersonalProfilePhoto(req *SetUserPersonalProfilePho type SetUserNoteRequest struct { // User identifier UserId int64 `json:"user_id"` - // Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Note *FormattedText `json:"note"` } @@ -20672,6 +21024,117 @@ func (client *Client) DeleteBotMediaPreviews(req *DeleteBotMediaPreviewsRequest) return UnmarshalOk(result.Data) } +type CheckBotUsernameRequest struct { + // Username to be checked + Username string `json:"username"` +} + +// Checks whether a username can be set for a new bot. Use checkChatUsername to check username for other chat types +func (client *Client) CheckBotUsername(req *CheckBotUsernameRequest) (CheckChatUsernameResult, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkBotUsername", + }, + Data: map[string]interface{}{ + "username": req.Username, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypeCheckChatUsernameResultOk: + return UnmarshalCheckChatUsernameResultOk(result.Data) + + case TypeCheckChatUsernameResultUsernameInvalid: + return UnmarshalCheckChatUsernameResultUsernameInvalid(result.Data) + + case TypeCheckChatUsernameResultUsernameOccupied: + return UnmarshalCheckChatUsernameResultUsernameOccupied(result.Data) + + case TypeCheckChatUsernameResultUsernamePurchasable: + return UnmarshalCheckChatUsernameResultUsernamePurchasable(result.Data) + + case TypeCheckChatUsernameResultPublicChatsTooMany: + return UnmarshalCheckChatUsernameResultPublicChatsTooMany(result.Data) + + case TypeCheckChatUsernameResultPublicGroupsUnavailable: + return UnmarshalCheckChatUsernameResultPublicGroupsUnavailable(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + +type CreateBotRequest struct { + // Identifier of the bot that will manage the created bot + ManagerBotUserId int64 `json:"manager_bot_user_id"` + // Name of the bot; 1-64 characters + Name string `json:"name"` + // Username of the bot. The username must end with "bot". Use checkBotUsername to find whether the name is suitable + Username string `json:"username"` + // Pass true if the bot is created from an internalLinkTypeRequestManagedBot link + ViaLink bool `json:"via_link"` +} + +// Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" if the user already owns the maximum allowed number of bots as per premiumLimitTypeOwnedBotCount. An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error +func (client *Client) CreateBot(req *CreateBotRequest) (*User, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "createBot", + }, + Data: map[string]interface{}{ + "manager_bot_user_id": req.ManagerBotUserId, + "name": req.Name, + "username": req.Username, + "via_link": req.ViaLink, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalUser(result.Data) +} + +type GetBotTokenRequest struct { + // Identifier of the created bot + BotUserId int64 `json:"bot_user_id"` + // Pass true to revoke the current token and create a new one + Revoke bool `json:"revoke"` +} + +// Returns token of a created bot; for bots only +func (client *Client) GetBotToken(req *GetBotTokenRequest) (*Text, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotToken", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "revoke": req.Revoke, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalText(result.Data) +} + type SetBotNameRequest struct { // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` @@ -22221,7 +22684,7 @@ type SendGiftRequest struct { GiftId JsonInt64 `json:"gift_id"` // Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats OwnerId MessageSender `json:"owner_id"` - // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages + // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. Must be empty if the receiver enabled paid messages Text *FormattedText `json:"text"` // Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them IsPrivate bool `json:"is_private"` @@ -22365,7 +22828,7 @@ type PlaceGiftAuctionBidRequest struct { StarCount int64 `json:"star_count"` // Identifier of the user who will receive the gift UserId int64 `json:"user_id"` - // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages + // Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. Must be empty if the receiver enabled paid messages Text *FormattedText `json:"text"` // Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them IsPrivate bool `json:"is_private"` @@ -23138,6 +23601,8 @@ type SearchGiftsForResaleRequest struct { Order GiftForResaleOrder `json:"order"` // Pass true to get only gifts suitable for crafting ForCrafting bool `json:"for_crafting"` + // Pass true to get only gifts that can be bought using Telegram Stars + ForStars bool `json:"for_stars"` // Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. If none attributes of specific type are specified, then all values for this attribute type are allowed Attributes []UpgradedGiftAttributeId `json:"attributes"` // Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results @@ -23156,6 +23621,7 @@ func (client *Client) SearchGiftsForResale(req *SearchGiftsForResaleRequest) (*G "gift_id": req.GiftId, "order": req.Order, "for_crafting": req.ForCrafting, + "for_stars": req.ForStars, "attributes": req.Attributes, "offset": req.Offset, "limit": req.Limit, @@ -26681,7 +27147,7 @@ type GiftPremiumWithStarsRequest struct { StarCount int64 `json:"star_count"` // Number of months the Telegram Premium subscription will be active for the user MonthCount int32 `json:"month_count"` - // Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` } @@ -28591,6 +29057,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatUnreadReactionCount: return UnmarshalUpdateChatUnreadReactionCount(result.Data) + case TypeUpdateChatUnreadPollVoteCount: + return UnmarshalUpdateChatUnreadPollVoteCount(result.Data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(result.Data) @@ -28918,6 +29387,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(result.Data) + case TypeUpdateTextCompositionStyles: + return UnmarshalUpdateTextCompositionStyles(result.Data) + case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(result.Data) @@ -28975,6 +29447,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(result.Data) + case TypeUpdateManagedBot: + return UnmarshalUpdateManagedBot(result.Data) + case TypeUpdateChatMember: return UnmarshalUpdateChatMember(result.Data) diff --git a/client/type.go b/client/type.go index 66044d3..4e37f1e 100755 --- a/client/type.go +++ b/client/type.go @@ -19,6 +19,7 @@ const ( ClassStickerType = "StickerType" ClassStickerFullType = "StickerFullType" ClassPollType = "PollType" + ClassInputPollType = "InputPollType" ClassProfileTab = "ProfileTab" ClassUserType = "UserType" ClassBusinessAwayMessageSchedule = "BusinessAwayMessageSchedule" @@ -77,6 +78,7 @@ const ( ClassButtonStyle = "ButtonStyle" ClassKeyboardButtonType = "KeyboardButtonType" ClassInlineKeyboardButtonType = "InlineKeyboardButtonType" + ClassKeyboardButtonSource = "KeyboardButtonSource" ClassReplyMarkup = "ReplyMarkup" ClassLoginUrlInfo = "LoginUrlInfo" ClassWebAppOpenMode = "WebAppOpenMode" @@ -104,6 +106,7 @@ const ( ClassDateTimePartPrecision = "DateTimePartPrecision" ClassDateTimeFormattingType = "DateTimeFormattingType" ClassTextEntityType = "TextEntityType" + ClassDiffEntityType = "DiffEntityType" ClassInputPaidMediaType = "InputPaidMediaType" ClassMessageSchedulingState = "MessageSchedulingState" ClassMessageSelfDestructType = "MessageSelfDestructType" @@ -210,6 +213,10 @@ const ( ClassTextEntity = "TextEntity" ClassTextEntities = "TextEntities" ClassFormattedText = "FormattedText" + ClassDiffEntity = "DiffEntity" + ClassDiffText = "DiffText" + ClassFixedText = "FixedText" + ClassTextCompositionStyle = "TextCompositionStyle" ClassTermsOfService = "TermsOfService" ClassPasskey = "Passkey" ClassPasskeys = "Passkeys" @@ -226,6 +233,7 @@ const ( ClassClosedVectorPath = "ClosedVectorPath" ClassOutline = "Outline" ClassPollOption = "PollOption" + ClassInputPollOption = "InputPollOption" ClassChecklistTask = "ChecklistTask" ClassInputChecklistTask = "InputChecklistTask" ClassChecklist = "Checklist" @@ -521,6 +529,7 @@ const ( ClassMessageSendOptions = "MessageSendOptions" ClassMessageCopyOptions = "MessageCopyOptions" ClassMessageProperties = "MessageProperties" + ClassPollOptionProperties = "PollOptionProperties" ClassEmojiKeyword = "EmojiKeyword" ClassEmojiKeywords = "EmojiKeywords" ClassStickers = "Stickers" @@ -725,6 +734,10 @@ const ( TypeTextEntity = "textEntity" TypeTextEntities = "textEntities" TypeFormattedText = "formattedText" + TypeDiffEntity = "diffEntity" + TypeDiffText = "diffText" + TypeFixedText = "fixedText" + TypeTextCompositionStyle = "textCompositionStyle" TypeTermsOfService = "termsOfService" TypePasskey = "passkey" TypePasskeys = "passkeys" @@ -780,8 +793,11 @@ const ( TypeClosedVectorPath = "closedVectorPath" TypeOutline = "outline" TypePollOption = "pollOption" + TypeInputPollOption = "inputPollOption" TypePollTypeRegular = "pollTypeRegular" TypePollTypeQuiz = "pollTypeQuiz" + TypeInputPollTypeRegular = "inputPollTypeRegular" + TypeInputPollTypeQuiz = "inputPollTypeQuiz" TypeChecklistTask = "checklistTask" TypeInputChecklistTask = "inputChecklistTask" TypeChecklist = "checklist" @@ -1261,6 +1277,7 @@ const ( TypeKeyboardButtonTypeRequestPoll = "keyboardButtonTypeRequestPoll" TypeKeyboardButtonTypeRequestUsers = "keyboardButtonTypeRequestUsers" TypeKeyboardButtonTypeRequestChat = "keyboardButtonTypeRequestChat" + TypeKeyboardButtonTypeRequestManagedBot = "keyboardButtonTypeRequestManagedBot" TypeKeyboardButtonTypeWebApp = "keyboardButtonTypeWebApp" TypeKeyboardButton = "keyboardButton" TypeInlineKeyboardButtonTypeUrl = "inlineKeyboardButtonTypeUrl" @@ -1273,6 +1290,8 @@ const ( TypeInlineKeyboardButtonTypeBuy = "inlineKeyboardButtonTypeBuy" TypeInlineKeyboardButtonTypeUser = "inlineKeyboardButtonTypeUser" TypeInlineKeyboardButtonTypeCopyText = "inlineKeyboardButtonTypeCopyText" + TypeKeyboardButtonSourceMessage = "keyboardButtonSourceMessage" + TypeKeyboardButtonSourceWebApp = "keyboardButtonSourceWebApp" TypeInlineKeyboardButton = "inlineKeyboardButton" TypeReplyMarkupRemoveKeyboard = "replyMarkupRemoveKeyboard" TypeReplyMarkupForceReply = "replyMarkupForceReply" @@ -1390,6 +1409,7 @@ const ( TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" + TypeLinkPreviewTypeRequestManagedBot = "linkPreviewTypeRequestManagedBot" TypeLinkPreviewTypeShareableChatFolder = "linkPreviewTypeShareableChatFolder" TypeLinkPreviewTypeSticker = "linkPreviewTypeSticker" TypeLinkPreviewTypeStickerSet = "linkPreviewTypeStickerSet" @@ -1550,6 +1570,8 @@ const ( TypeMessageVideoChatStarted = "messageVideoChatStarted" TypeMessageVideoChatEnded = "messageVideoChatEnded" TypeMessageInviteVideoChatParticipants = "messageInviteVideoChatParticipants" + TypeMessagePollOptionAdded = "messagePollOptionAdded" + TypeMessagePollOptionDeleted = "messagePollOptionDeleted" TypeMessageBasicGroupChatCreate = "messageBasicGroupChatCreate" TypeMessageSupergroupChatCreate = "messageSupergroupChatCreate" TypeMessageChatChangeTitle = "messageChatChangeTitle" @@ -1579,6 +1601,7 @@ const ( TypeMessageSuggestBirthdate = "messageSuggestBirthdate" TypeMessageCustomServiceAction = "messageCustomServiceAction" TypeMessageGameScore = "messageGameScore" + TypeMessageManagedBotCreated = "messageManagedBotCreated" TypeMessagePaymentSuccessful = "messagePaymentSuccessful" TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" TypeMessagePaymentRefunded = "messagePaymentRefunded" @@ -1644,6 +1667,9 @@ const ( TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp" TypeTextEntityTypeDateTime = "textEntityTypeDateTime" + TypeDiffEntityTypeInsert = "diffEntityTypeInsert" + TypeDiffEntityTypeReplace = "diffEntityTypeReplace" + TypeDiffEntityTypeDelete = "diffEntityTypeDelete" TypeInputThumbnail = "inputThumbnail" TypeInputPaidMediaTypePhoto = "inputPaidMediaTypePhoto" TypeInputPaidMediaTypeVideo = "inputPaidMediaTypeVideo" @@ -1677,11 +1703,13 @@ const ( TypeInputMessageChecklist = "inputMessageChecklist" TypeInputMessageForwarded = "inputMessageForwarded" TypeMessageProperties = "messageProperties" + TypePollOptionProperties = "pollOptionProperties" TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" TypeSearchMessagesFilterDocument = "searchMessagesFilterDocument" TypeSearchMessagesFilterPhoto = "searchMessagesFilterPhoto" + TypeSearchMessagesFilterPoll = "searchMessagesFilterPoll" TypeSearchMessagesFilterVideo = "searchMessagesFilterVideo" TypeSearchMessagesFilterVoiceNote = "searchMessagesFilterVoiceNote" TypeSearchMessagesFilterPhotoAndVideo = "searchMessagesFilterPhotoAndVideo" @@ -1692,6 +1720,7 @@ const ( TypeSearchMessagesFilterMention = "searchMessagesFilterMention" TypeSearchMessagesFilterUnreadMention = "searchMessagesFilterUnreadMention" TypeSearchMessagesFilterUnreadReaction = "searchMessagesFilterUnreadReaction" + TypeSearchMessagesFilterUnreadPollVote = "searchMessagesFilterUnreadPollVote" TypeSearchMessagesFilterFailedToSend = "searchMessagesFilterFailedToSend" TypeSearchMessagesFilterPinned = "searchMessagesFilterPinned" TypeSearchMessagesChatTypeFilterPrivate = "searchMessagesChatTypeFilterPrivate" @@ -2011,6 +2040,7 @@ const ( TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" TypePremiumLimitTypeSimilarChatCount = "premiumLimitTypeSimilarChatCount" + TypePremiumLimitTypeOwnedBotCount = "premiumLimitTypeOwnedBotCount" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -2038,6 +2068,7 @@ const ( TypePremiumFeatureChecklists = "premiumFeatureChecklists" TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages" TypePremiumFeatureProtectPrivateChatContent = "premiumFeatureProtectPrivateChatContent" + TypePremiumFeatureTextComposition = "premiumFeatureTextComposition" TypeBusinessFeatureLocation = "businessFeatureLocation" TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours" TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies" @@ -2188,6 +2219,7 @@ const ( TypePushMessageContentProximityAlertTriggered = "pushMessageContentProximityAlertTriggered" TypePushMessageContentChecklistTasksAdded = "pushMessageContentChecklistTasksAdded" TypePushMessageContentChecklistTasksDone = "pushMessageContentChecklistTasksDone" + TypePushMessageContentPollOptionAdded = "pushMessageContentPollOptionAdded" TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards" TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum" TypeNotificationTypeNewMessage = "notificationTypeNewMessage" @@ -2352,6 +2384,7 @@ const ( TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" + TypeInternalLinkTypeRequestManagedBot = "internalLinkTypeRequestManagedBot" TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" TypeInternalLinkTypeSavedMessages = "internalLinkTypeSavedMessages" TypeInternalLinkTypeSearch = "internalLinkTypeSearch" @@ -2377,6 +2410,7 @@ const ( TypeFileTypeAnimation = "fileTypeAnimation" TypeFileTypeAudio = "fileTypeAudio" TypeFileTypeDocument = "fileTypeDocument" + TypeFileTypeLivePhotoVideo = "fileTypeLivePhotoVideo" TypeFileTypeNotificationSound = "fileTypeNotificationSound" TypeFileTypePhoto = "fileTypePhoto" TypeFileTypePhotoStory = "fileTypePhotoStory" @@ -2384,6 +2418,7 @@ const ( TypeFileTypeSecret = "fileTypeSecret" TypeFileTypeSecretThumbnail = "fileTypeSecretThumbnail" TypeFileTypeSecure = "fileTypeSecure" + TypeFileTypeSelfDestructingLivePhotoVideo = "fileTypeSelfDestructingLivePhotoVideo" TypeFileTypeSelfDestructingPhoto = "fileTypeSelfDestructingPhoto" TypeFileTypeSelfDestructingVideo = "fileTypeSelfDestructingVideo" TypeFileTypeSelfDestructingVideoNote = "fileTypeSelfDestructingVideoNote" @@ -2557,6 +2592,7 @@ const ( TypeUpdateChatTheme = "updateChatTheme" TypeUpdateChatUnreadMentionCount = "updateChatUnreadMentionCount" TypeUpdateChatUnreadReactionCount = "updateChatUnreadReactionCount" + TypeUpdateChatUnreadPollVoteCount = "updateChatUnreadPollVoteCount" TypeUpdateChatVideoChat = "updateChatVideoChat" TypeUpdateChatDefaultDisableNotification = "updateChatDefaultDisableNotification" TypeUpdateChatHasProtectedContent = "updateChatHasProtectedContent" @@ -2666,6 +2702,7 @@ const ( TypeUpdateStakeDiceState = "updateStakeDiceState" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" TypeUpdateAnimationSearchParameters = "updateAnimationSearchParameters" + TypeUpdateTextCompositionStyles = "updateTextCompositionStyles" TypeUpdateSuggestedActions = "updateSuggestedActions" TypeUpdateSpeedLimitNotification = "updateSpeedLimitNotification" TypeUpdateContactCloseBirthdays = "updateContactCloseBirthdays" @@ -2685,6 +2722,7 @@ const ( TypeUpdateNewCustomQuery = "updateNewCustomQuery" TypeUpdatePoll = "updatePoll" TypeUpdatePollAnswer = "updatePollAnswer" + TypeUpdateManagedBot = "updateManagedBot" TypeUpdateChatMember = "updateChatMember" TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" TypeUpdateChatBoost = "updateChatBoost" @@ -2767,6 +2805,11 @@ type PollType interface { PollTypeType() string } +// Describes the type of poll to send +type InputPollType interface { + InputPollTypeType() string +} + // Describes a tab shown in a user or a chat profile type ProfileTab interface { ProfileTabType() string @@ -3057,6 +3100,11 @@ type InlineKeyboardButtonType interface { InlineKeyboardButtonTypeType() string } +// Describes source of a keyboard button +type KeyboardButtonSource interface { + KeyboardButtonSourceType() string +} + // Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots type ReplyMarkup interface { ReplyMarkupType() string @@ -3077,7 +3125,7 @@ type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string } -// Describes a built-in theme of an official app +// Describes a built-in theme of an official application type BuiltInTheme interface { BuiltInThemeType() string } @@ -3192,6 +3240,11 @@ type TextEntityType interface { TextEntityTypeType() string } +// Represents a change of a text +type DiffEntityType interface { + DiffEntityTypeType() string +} + // Describes type of paid media to sent type InputPaidMediaType interface { InputPaidMediaTypeType() string @@ -4322,7 +4375,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code, PreCode, and DateTime entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -4342,6 +4395,131 @@ func (*FormattedText) GetType() string { return TypeFormattedText } +// Represents a change of a text +type DiffEntity struct { + meta + // Offset of the entity, in UTF-16 code units + Offset int32 `json:"offset"` + // Length of the entity, in UTF-16 code units + Length int32 `json:"length"` + // Type of the entity + Type DiffEntityType `json:"type"` +} + +func (entity *DiffEntity) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiffEntity + + return json.Marshal((*stub)(entity)) +} + +func (*DiffEntity) GetClass() string { + return ClassDiffEntity +} + +func (*DiffEntity) GetType() string { + return TypeDiffEntity +} + +func (diffEntity *DiffEntity) UnmarshalJSON(data []byte) error { + var tmp struct { + Offset int32 `json:"offset"` + Length int32 `json:"length"` + Type json.RawMessage `json:"type"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + diffEntity.Offset = tmp.Offset + diffEntity.Length = tmp.Length + + fieldType, _ := UnmarshalDiffEntityType(tmp.Type) + diffEntity.Type = fieldType + + return nil +} + +// A text with some changes highlighted +type DiffText struct { + meta + // The text + Text string `json:"text"` + // Entities describing changes in the text. Entities doesn't mutually intersect with each other + Entities []*DiffEntity `json:"entities"` +} + +func (entity *DiffText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiffText + + return json.Marshal((*stub)(entity)) +} + +func (*DiffText) GetClass() string { + return ClassDiffText +} + +func (*DiffText) GetType() string { + return TypeDiffText +} + +// A text fixed using fixTextWithAi +type FixedText struct { + meta + // The resulting text + Text *FormattedText `json:"text"` + // Changes made to the original text + DiffText *DiffText `json:"diff_text"` +} + +func (entity *FixedText) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FixedText + + return json.Marshal((*stub)(entity)) +} + +func (*FixedText) GetClass() string { + return ClassFixedText +} + +func (*FixedText) GetType() string { + return TypeFixedText +} + +// Describes a style that can be used to compose a text +type TextCompositionStyle struct { + meta + // Name of the style + Name string `json:"name"` + // Identifier of the custom emoji corresponding to the style + CustomEmojiId JsonInt64 `json:"custom_emoji_id"` + // Title of the style in the user application's language + Title string `json:"title"` +} + +func (entity *TextCompositionStyle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextCompositionStyle + + return json.Marshal((*stub)(entity)) +} + +func (*TextCompositionStyle) GetClass() string { + return ClassTextCompositionStyle +} + +func (*TextCompositionStyle) GetType() string { + return TypeTextCompositionStyle +} + // Contains Telegram terms of service type TermsOfService struct { meta @@ -5890,16 +6068,26 @@ func (*Outline) GetType() string { // Describes one answer option of a poll type PollOption struct { meta - // Option text; 1-100 characters. Only custom emoji entities are allowed + // Unique identifier of the option in the poll + Id string `json:"id"` + // Option text; 1-100 characters; may contain only custom emoji entities Text *FormattedText `json:"text"` - // Number of voters for this option, available only for closed or voted polls + // Option media. Currently, can be only of the types messageAnimation, messageLocation, messagePhoto, messageSticker, messageVenue, or messageVideo without caption + Media MessageContent `json:"media"` + // Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll VoterCount int32 `json:"voter_count"` // The percentage of votes for this option; 0-100 VotePercentage int32 `json:"vote_percentage"` + // Identifiers of recent voters for the option, if the poll is non-anonymous and poll results are available + RecentVoterIds []MessageSender `json:"recent_voter_ids"` // True, if the option was chosen by the user IsChosen bool `json:"is_chosen"` // True, if the option is being chosen by a pending setPollAnswer request IsBeingChosen bool `json:"is_being_chosen"` + // Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll + Author MessageSender `json:"author"` + // Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll + AdditionDate int32 `json:"addition_date"` } func (entity *PollOption) MarshalJSON() ([]byte, error) { @@ -5918,11 +6106,71 @@ func (*PollOption) GetType() string { return TypePollOption } -// A regular poll -type PollTypeRegular struct { +func (pollOption *PollOption) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + Text *FormattedText `json:"text"` + Media json.RawMessage `json:"media"` + VoterCount int32 `json:"voter_count"` + VotePercentage int32 `json:"vote_percentage"` + RecentVoterIds []json.RawMessage `json:"recent_voter_ids"` + IsChosen bool `json:"is_chosen"` + IsBeingChosen bool `json:"is_being_chosen"` + Author json.RawMessage `json:"author"` + AdditionDate int32 `json:"addition_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pollOption.Id = tmp.Id + pollOption.Text = tmp.Text + pollOption.VoterCount = tmp.VoterCount + pollOption.VotePercentage = tmp.VotePercentage + pollOption.IsChosen = tmp.IsChosen + pollOption.IsBeingChosen = tmp.IsBeingChosen + pollOption.AdditionDate = tmp.AdditionDate + + fieldMedia, _ := UnmarshalMessageContent(tmp.Media) + pollOption.Media = fieldMedia + + fieldRecentVoterIds, _ := UnmarshalListOfMessageSender(tmp.RecentVoterIds) + pollOption.RecentVoterIds = fieldRecentVoterIds + + fieldAuthor, _ := UnmarshalMessageSender(tmp.Author) + pollOption.Author = fieldAuthor + + return nil +} + +// Describes one answer option of a poll to be created +type InputPollOption struct { + meta + // Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users + Text *FormattedText `json:"text"` +} + +func (entity *InputPollOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollOption + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollOption) GetClass() string { + return ClassInputPollOption +} + +func (*InputPollOption) GetType() string { + return TypeInputPollOption +} + +// A regular poll +type PollTypeRegular struct{ meta - // True, if multiple answer options can be chosen simultaneously - AllowMultipleAnswers bool `json:"allow_multiple_answers"` } func (entity *PollTypeRegular) MarshalJSON() ([]byte, error) { @@ -5945,13 +6193,15 @@ func (*PollTypeRegular) PollTypeType() string { return TypePollTypeRegular } -// A poll in quiz mode, which has exactly one correct answer option and can be answered only once +// A poll in quiz mode, which has predefined correct answers type PollTypeQuiz struct { meta - // 0-based identifier of the correct answer option; -1 for a yet unanswered poll - CorrectOptionId int32 `json:"correct_option_id"` - // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll + // Increasing list of 0-based identifiers of the correct answer options; empty for a yet unanswered poll + CorrectOptionIds []int32 `json:"correct_option_ids"` + // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; empty for a yet unanswered poll Explanation *FormattedText `json:"explanation"` + // Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; may be null if none or the poll is unanswered yet. Currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption + ExplanationMedia MessageContent `json:"explanation_media"` } func (entity *PollTypeQuiz) MarshalJSON() ([]byte, error) { @@ -5974,12 +6224,89 @@ func (*PollTypeQuiz) PollTypeType() string { return TypePollTypeQuiz } +func (pollTypeQuiz *PollTypeQuiz) UnmarshalJSON(data []byte) error { + var tmp struct { + CorrectOptionIds []int32 `json:"correct_option_ids"` + Explanation *FormattedText `json:"explanation"` + ExplanationMedia json.RawMessage `json:"explanation_media"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + pollTypeQuiz.CorrectOptionIds = tmp.CorrectOptionIds + pollTypeQuiz.Explanation = tmp.Explanation + + fieldExplanationMedia, _ := UnmarshalMessageContent(tmp.ExplanationMedia) + pollTypeQuiz.ExplanationMedia = fieldExplanationMedia + + return nil +} + +// A regular poll +type InputPollTypeRegular struct { + meta + // True, if answer options can be added to the poll after creation; not supported in channel chats and for anonymous polls + AllowAddingOptions bool `json:"allow_adding_options"` +} + +func (entity *InputPollTypeRegular) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollTypeRegular + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollTypeRegular) GetClass() string { + return ClassInputPollType +} + +func (*InputPollTypeRegular) GetType() string { + return TypeInputPollTypeRegular +} + +func (*InputPollTypeRegular) InputPollTypeType() string { + return TypeInputPollTypeRegular +} + +// A poll in quiz mode, which has predefined correct answers +type InputPollTypeQuiz struct { + meta + // Increasing list of 0-based identifiers of the correct answer options; must be non-empty + CorrectOptionIds []int32 `json:"correct_option_ids"` + // Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds + Explanation *FormattedText `json:"explanation"` +} + +func (entity *InputPollTypeQuiz) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputPollTypeQuiz + + return json.Marshal((*stub)(entity)) +} + +func (*InputPollTypeQuiz) GetClass() string { + return ClassInputPollType +} + +func (*InputPollTypeQuiz) GetType() string { + return TypeInputPollTypeQuiz +} + +func (*InputPollTypeQuiz) InputPollTypeType() string { + return TypeInputPollTypeQuiz +} + // Describes a task in a checklist type ChecklistTask struct { meta // Unique identifier of the task Id int32 `json:"id"` - // Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities + // Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, DateTime and automatically found entities Text *FormattedText `json:"text"` // Identifier of the user or chat that completed the task; may be null if the task isn't completed yet CompletedBy MessageSender `json:"completed_by"` @@ -6031,7 +6358,7 @@ type InputChecklistTask struct { meta // Unique identifier of the task; must be positive Id int32 `json:"id"` - // Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities + // Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities Text *FormattedText `json:"text"` } @@ -6054,7 +6381,7 @@ func (*InputChecklistTask) GetType() string { // Describes a checklist type Checklist struct { meta - // Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities + // Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities Title *FormattedText `json:"title"` // List of tasks in the checklist Tasks []*ChecklistTask `json:"tasks"` @@ -6087,7 +6414,7 @@ func (*Checklist) GetType() string { // Describes a checklist to be sent type InputChecklist struct { meta - // Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities + // Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities Title *FormattedText `json:"title"` // List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks Tasks []*InputChecklistTask `json:"tasks"` @@ -6735,16 +7062,24 @@ type Poll struct { meta // Unique poll identifier Id JsonInt64 `json:"id"` - // Poll question; 1-300 characters. Only custom emoji entities are allowed + // Poll question; 1-300 characters; may contain only custom emoji entities Question *FormattedText `json:"question"` // List of poll answer options Options []*PollOption `json:"options"` // Total number of voters, participating in the poll TotalVoterCount int32 `json:"total_voter_count"` - // Identifiers of recent voters, if the poll is non-anonymous + // Identifiers of recent voters, if the poll is non-anonymous and poll results are available RecentVoterIds []MessageSender `json:"recent_voter_ids"` + // True, if the current user can get voters in the poll + CanGetVoters bool `json:"can_get_voters"` // True, if the poll is anonymous IsAnonymous bool `json:"is_anonymous"` + // True, if multiple answer options can be chosen simultaneously + AllowsMultipleAnswers bool `json:"allows_multiple_answers"` + // True, if the poll can be answered multiple times + AllowsRevoting bool `json:"allows_revoting"` + // The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed + OptionOrder []int32 `json:"option_order"` // Type of the poll Type PollType `json:"type"` // Amount of time the poll will be active after creation, in seconds @@ -6778,7 +7113,11 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { Options []*PollOption `json:"options"` TotalVoterCount int32 `json:"total_voter_count"` RecentVoterIds []json.RawMessage `json:"recent_voter_ids"` + CanGetVoters bool `json:"can_get_voters"` IsAnonymous bool `json:"is_anonymous"` + AllowsMultipleAnswers bool `json:"allows_multiple_answers"` + AllowsRevoting bool `json:"allows_revoting"` + OptionOrder []int32 `json:"option_order"` Type json.RawMessage `json:"type"` OpenPeriod int32 `json:"open_period"` CloseDate int32 `json:"close_date"` @@ -6794,7 +7133,11 @@ func (poll *Poll) UnmarshalJSON(data []byte) error { poll.Question = tmp.Question poll.Options = tmp.Options poll.TotalVoterCount = tmp.TotalVoterCount + poll.CanGetVoters = tmp.CanGetVoters poll.IsAnonymous = tmp.IsAnonymous + poll.AllowsMultipleAnswers = tmp.AllowsMultipleAnswers + poll.AllowsRevoting = tmp.AllowsRevoting + poll.OptionOrder = tmp.OptionOrder poll.OpenPeriod = tmp.OpenPeriod poll.CloseDate = tmp.CloseDate poll.IsClosed = tmp.IsClosed @@ -7307,6 +7650,8 @@ type UserTypeBot struct { HasTopics bool `json:"has_topics"` // True, if users can create and delete topics in the chat with the bot AllowsUsersToCreateTopics bool `json:"allows_users_to_create_topics"` + // True, if the bot can manage other bots + CanManageBots bool `json:"can_manage_bots"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` // Placeholder for inline queries (displayed on the application input field) @@ -15264,6 +15609,8 @@ type BotInfo struct { Photo *Photo `json:"photo"` // Animation shown in the chat with the bot if the chat is empty; may be null Animation *Animation `json:"animation"` + // Identifier of the bot, which manages the bot; 0 if none or unknown; for owner of the bot only + ManagerBotUserId int64 `json:"manager_bot_user_id"` // Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown MenuButton *BotMenuButton `json:"menu_button"` // List of the bot commands @@ -15324,6 +15671,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { Description string `json:"description"` Photo *Photo `json:"photo"` Animation *Animation `json:"animation"` + ManagerBotUserId int64 `json:"manager_bot_user_id"` MenuButton *BotMenuButton `json:"menu_button"` Commands []*BotCommand `json:"commands"` PrivacyPolicyUrl string `json:"privacy_policy_url"` @@ -15353,6 +15701,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { botInfo.Description = tmp.Description botInfo.Photo = tmp.Photo botInfo.Animation = tmp.Animation + botInfo.ManagerBotUserId = tmp.ManagerBotUserId botInfo.MenuButton = tmp.MenuButton botInfo.Commands = tmp.Commands botInfo.PrivacyPolicyUrl = tmp.PrivacyPolicyUrl @@ -15412,6 +15761,8 @@ type UserFullInfo struct { NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` // True, if the user set chat background for both chat users and it wasn't reverted yet SetChatBackground bool `json:"set_chat_background"` + // True, if the user uses an unofficial application that poses a security risk + UsesUnofficialApp bool `json:"uses_unofficial_app"` // A short user bio; may be null for bots Bio *FormattedText `json:"bio"` // Birthdate of the user; may be null if unknown @@ -15479,6 +15830,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { HasSponsoredMessagesEnabled bool `json:"has_sponsored_messages_enabled"` NeedPhoneNumberPrivacyException bool `json:"need_phone_number_privacy_exception"` SetChatBackground bool `json:"set_chat_background"` + UsesUnofficialApp bool `json:"uses_unofficial_app"` Bio *FormattedText `json:"bio"` Birthdate *Birthdate `json:"birthdate"` PersonalChatId int64 `json:"personal_chat_id"` @@ -15515,6 +15867,7 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error { userFullInfo.HasSponsoredMessagesEnabled = tmp.HasSponsoredMessagesEnabled userFullInfo.NeedPhoneNumberPrivacyException = tmp.NeedPhoneNumberPrivacyException userFullInfo.SetChatBackground = tmp.SetChatBackground + userFullInfo.UsesUnofficialApp = tmp.UsesUnofficialApp userFullInfo.Bio = tmp.Bio userFullInfo.Birthdate = tmp.Birthdate userFullInfo.PersonalChatId = tmp.PersonalChatId @@ -15600,6 +15953,8 @@ type ChatAdministrator struct { CustomTitle string `json:"custom_title"` // True, if the user is the owner of the chat IsOwner bool `json:"is_owner"` + // True, if the current user can edit the administrator privileges for the administrator + CanBeEdited bool `json:"can_be_edited"` } func (entity *ChatAdministrator) MarshalJSON() ([]byte, error) { @@ -18768,7 +19123,7 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { // Describes manually or automatically chosen quote from another message type TextQuote struct { meta - // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text + // Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text Text *FormattedText `json:"text"` // Approximate quote position in the original message in UTF-16 code units as specified by the message sender Position int32 `json:"position"` @@ -18795,7 +19150,7 @@ func (*TextQuote) GetType() string { // Describes manually chosen quote from another message type InputTextQuote struct { meta - // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote + // Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote Text *FormattedText `json:"text"` // Quote position in the original message in UTF-16 code units Position int32 `json:"position"` @@ -18828,6 +19183,8 @@ type MessageReplyToMessage struct { Quote *TextQuote `json:"quote"` // Identifier of the checklist task in the original message that was replied; 0 if none ChecklistTaskId int32 `json:"checklist_task_id"` + // Identifier of the poll option in the original message that was replied; empty if none + PollOptionId string `json:"poll_option_id"` // Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat Origin MessageOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat @@ -18862,6 +19219,7 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e MessageId int64 `json:"message_id"` Quote *TextQuote `json:"quote"` ChecklistTaskId int32 `json:"checklist_task_id"` + PollOptionId string `json:"poll_option_id"` Origin json.RawMessage `json:"origin"` OriginSendDate int32 `json:"origin_send_date"` Content json.RawMessage `json:"content"` @@ -18876,6 +19234,7 @@ func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) e messageReplyToMessage.MessageId = tmp.MessageId messageReplyToMessage.Quote = tmp.Quote messageReplyToMessage.ChecklistTaskId = tmp.ChecklistTaskId + messageReplyToMessage.PollOptionId = tmp.PollOptionId messageReplyToMessage.OriginSendDate = tmp.OriginSendDate fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) @@ -18925,6 +19284,8 @@ type InputMessageReplyToMessage struct { Quote *InputTextQuote `json:"quote"` // Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message ChecklistTaskId int32 `json:"checklist_task_id"` + // Identifier of the poll option in the message to be replied; pass an empty string if none + PollOptionId string `json:"poll_option_id"` } func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { @@ -18958,6 +19319,8 @@ type InputMessageReplyToExternalMessage struct { Quote *InputTextQuote `json:"quote"` // Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message ChecklistTaskId int32 `json:"checklist_task_id"` + // Identifier of the poll option in the message to be replied; pass an empty string if none + PollOptionId string `json:"poll_option_id"` } func (entity *InputMessageReplyToExternalMessage) MarshalJSON() ([]byte, error) { @@ -19809,7 +20172,7 @@ type SponsoredMessage struct { IsRecommended bool `json:"is_recommended"` // True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage CanBeReported bool `json:"can_be_reported"` - // Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen + // Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen. The content must be fully downloaded before the message is shown Content MessageContent `json:"content"` // Information about the sponsor of the message Sponsor *AdvertisementSponsor `json:"sponsor"` @@ -20498,13 +20861,15 @@ func (*ReactionNotificationSourceAll) ReactionNotificationSourceType() string { return TypeReactionNotificationSourceAll } -// Contains information about notification settings for reactions +// Contains information about notification settings for reactions and poll votes type ReactionNotificationSettings struct { meta // Source of message reactions for which notifications are shown MessageReactionSource ReactionNotificationSource `json:"message_reaction_source"` // Source of story reactions for which notifications are shown StoryReactionSource ReactionNotificationSource `json:"story_reaction_source"` + // Source of poll votes for which notifications are shown + PollVoteSource ReactionNotificationSource `json:"poll_vote_source"` // Identifier of the notification sound to be played; 0 if sound is disabled SoundId JsonInt64 `json:"sound_id"` // True, if reaction sender and emoji must be displayed in notifications @@ -20531,6 +20896,7 @@ func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON( var tmp struct { MessageReactionSource json.RawMessage `json:"message_reaction_source"` StoryReactionSource json.RawMessage `json:"story_reaction_source"` + PollVoteSource json.RawMessage `json:"poll_vote_source"` SoundId JsonInt64 `json:"sound_id"` ShowPreview bool `json:"show_preview"` } @@ -20549,6 +20915,9 @@ func (reactionNotificationSettings *ReactionNotificationSettings) UnmarshalJSON( fieldStoryReactionSource, _ := UnmarshalReactionNotificationSource(tmp.StoryReactionSource) reactionNotificationSettings.StoryReactionSource = fieldStoryReactionSource + fieldPollVoteSource, _ := UnmarshalReactionNotificationSource(tmp.PollVoteSource) + reactionNotificationSettings.PollVoteSource = fieldPollVoteSource + return nil } @@ -21514,6 +21883,8 @@ type Chat struct { UnreadMentionCount int32 `json:"unread_mention_count"` // Number of messages with unread reactions in the chat UnreadReactionCount int32 `json:"unread_reaction_count"` + // Number of messages with unread poll votes in the chat + UnreadPollVoteCount int32 `json:"unread_poll_vote_count"` // Notification settings for the chat NotificationSettings *ChatNotificationSettings `json:"notification_settings"` // Types of reaction, available in the chat @@ -21589,6 +21960,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { LastReadOutboxMessageId int64 `json:"last_read_outbox_message_id"` UnreadMentionCount int32 `json:"unread_mention_count"` UnreadReactionCount int32 `json:"unread_reaction_count"` + UnreadPollVoteCount int32 `json:"unread_poll_vote_count"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"` AvailableReactions json.RawMessage `json:"available_reactions"` MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` @@ -21634,6 +22006,7 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.LastReadOutboxMessageId = tmp.LastReadOutboxMessageId chat.UnreadMentionCount = tmp.UnreadMentionCount chat.UnreadReactionCount = tmp.UnreadReactionCount + chat.UnreadPollVoteCount = tmp.UnreadPollVoteCount chat.NotificationSettings = tmp.NotificationSettings chat.MessageAutoDeleteTime = tmp.MessageAutoDeleteTime chat.EmojiStatus = tmp.EmojiStatus @@ -22310,6 +22683,37 @@ func (*KeyboardButtonTypeRequestChat) KeyboardButtonTypeType() string { return TypeKeyboardButtonTypeRequestChat } +// A button that requests creation of a managed bot by the current user; available only in private chats. Use the method createBot to complete the request +type KeyboardButtonTypeRequestManagedBot struct { + meta + // Unique button identifier + Id int32 `json:"id"` + // Suggested name for the bot; may be empty if not specified + SuggestedName string `json:"suggested_name"` + // Suggested username for the bot; may be empty if not specified + SuggestedUsername string `json:"suggested_username"` +} + +func (entity *KeyboardButtonTypeRequestManagedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonTypeRequestManagedBot + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonTypeRequestManagedBot) GetClass() string { + return ClassKeyboardButtonType +} + +func (*KeyboardButtonTypeRequestManagedBot) GetType() string { + return TypeKeyboardButtonTypeRequestManagedBot +} + +func (*KeyboardButtonTypeRequestManagedBot) KeyboardButtonTypeType() string { + return TypeKeyboardButtonTypeRequestManagedBot +} + // A button that opens a Web App by calling getWebAppUrl type KeyboardButtonTypeWebApp struct { meta @@ -22682,6 +23086,64 @@ func (*InlineKeyboardButtonTypeCopyText) InlineKeyboardButtonTypeType() string { return TypeInlineKeyboardButtonTypeCopyText } +// The button is from a bot's message +type KeyboardButtonSourceMessage struct { + meta + // Identifier of the chat with the message + ChatId int64 `json:"chat_id"` + // Identifier of the message with the button + MessageId int64 `json:"message_id"` +} + +func (entity *KeyboardButtonSourceMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonSourceMessage + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonSourceMessage) GetClass() string { + return ClassKeyboardButtonSource +} + +func (*KeyboardButtonSourceMessage) GetType() string { + return TypeKeyboardButtonSourceMessage +} + +func (*KeyboardButtonSourceMessage) KeyboardButtonSourceType() string { + return TypeKeyboardButtonSourceMessage +} + +// The button is a prepared keyboard button from a Mini App received via getPreparedKeyboardButton +type KeyboardButtonSourceWebApp struct { + meta + // Identifier of the bot that created the button + BotUserId int64 `json:"bot_user_id"` + // Identifier of the prepared button + PreparedButtonId string `json:"prepared_button_id"` +} + +func (entity *KeyboardButtonSourceWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub KeyboardButtonSourceWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*KeyboardButtonSourceWebApp) GetClass() string { + return ClassKeyboardButtonSource +} + +func (*KeyboardButtonSourceWebApp) GetType() string { + return TypeKeyboardButtonSourceWebApp +} + +func (*KeyboardButtonSourceWebApp) KeyboardButtonSourceType() string { + return TypeKeyboardButtonSourceWebApp +} + // Represents a single button in an inline keyboard type InlineKeyboardButton struct { meta @@ -22921,12 +23383,16 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string { // Information about the OAuth authorization type OauthLinkInfo struct { meta - // Identifier of the user for which the link was generated; may be 0 if unknown. The corresponding user may be unknown. If the user is logged in the app, then they must be chosen for authorization by default + // Identifier of the user for which the link was generated; may be 0 if unknown. The corresponding user may be unknown. If the user is logged in the application, then they must be chosen for authorization by default UserId int64 `json:"user_id"` // An HTTP URL where the user authorizes Url string `json:"url"` // A domain of the URL Domain string `json:"domain"` + // True, if the authorization originates from an application + FromApp bool `json:"from_app"` + // Verified name of the application; if empty, then "Unverified App" must be shown instead + VerifiedAppName string `json:"verified_app_name"` // User identifier of a bot linked with the website BotUserId int64 `json:"bot_user_id"` // True, if the user must be asked for the permission to the bot to send them messages @@ -23613,6 +24079,8 @@ type ForumTopic struct { UnreadMentionCount int32 `json:"unread_mention_count"` // Number of messages with unread reactions in the topic UnreadReactionCount int32 `json:"unread_reaction_count"` + // Number of messages with unread poll votes in the topic + UnreadPollVoteCount int32 `json:"unread_poll_vote_count"` // Notification settings for the topic NotificationSettings *ChatNotificationSettings `json:"notification_settings"` // A draft of a message in the topic; may be null if none @@ -27043,6 +27511,31 @@ func (*LinkPreviewTypePremiumGiftCode) LinkPreviewTypeType() string { return TypeLinkPreviewTypePremiumGiftCode } +// The link is a link to a dialog for creating of a managed bot +type LinkPreviewTypeRequestManagedBot struct{ + meta +} + +func (entity *LinkPreviewTypeRequestManagedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeRequestManagedBot + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeRequestManagedBot) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeRequestManagedBot) GetType() string { + return TypeLinkPreviewTypeRequestManagedBot +} + +func (*LinkPreviewTypeRequestManagedBot) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeRequestManagedBot +} + // The link is a link to a shareable chat folder type LinkPreviewTypeShareableChatFolder struct{ meta @@ -28694,6 +29187,8 @@ type PaidMediaPhoto struct { meta // The photo Photo *Photo `json:"photo"` + // The video representing the live photo; may be null if the photo is static + Video *Video `json:"video"` } func (entity *PaidMediaPhoto) MarshalJSON() ([]byte, error) { @@ -31141,6 +31636,8 @@ type MessagePhoto struct { meta // The photo Photo *Photo `json:"photo"` + // The video representing the live photo; may be null if the photo is static + Video *Video `json:"video"` // Photo caption Caption *FormattedText `json:"caption"` // True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo @@ -31615,8 +32112,14 @@ func (*MessageGame) MessageContentType() string { // A message with a poll type MessagePoll struct { meta - // The poll description + // Information about the poll Poll *Poll `json:"poll"` + // Description of the poll + Description *FormattedText `json:"description"` + // Media attached to the poll. Currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption + Media MessageContent `json:"media"` + // True, if an option can be added to the poll using addPollOption + CanAddOption bool `json:"can_add_option"` } func (entity *MessagePoll) MarshalJSON() ([]byte, error) { @@ -31639,6 +32142,29 @@ func (*MessagePoll) MessageContentType() string { return TypeMessagePoll } +func (messagePoll *MessagePoll) UnmarshalJSON(data []byte) error { + var tmp struct { + Poll *Poll `json:"poll"` + Description *FormattedText `json:"description"` + Media json.RawMessage `json:"media"` + CanAddOption bool `json:"can_add_option"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messagePoll.Poll = tmp.Poll + messagePoll.Description = tmp.Description + messagePoll.CanAddOption = tmp.CanAddOption + + fieldMedia, _ := UnmarshalMessageContent(tmp.Media) + messagePoll.Media = fieldMedia + + return nil +} + // A stake dice message. The dice value is randomly generated by the server type MessageStakeDice struct { meta @@ -32067,6 +32593,68 @@ func (*MessageInviteVideoChatParticipants) MessageContentType() string { return TypeMessageInviteVideoChatParticipants } +// A message with information about an added poll option +type MessagePollOptionAdded struct { + meta + // Identifier of the message with the poll; can be an identifier of a deleted message or 0 + PollMessageId int64 `json:"poll_message_id"` + // Identifier of the added option in the poll + OptionId string `json:"option_id"` + // Text of the option; 1-100 characters; may contain only custom emoji entities + Text *FormattedText `json:"text"` +} + +func (entity *MessagePollOptionAdded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePollOptionAdded + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePollOptionAdded) GetClass() string { + return ClassMessageContent +} + +func (*MessagePollOptionAdded) GetType() string { + return TypeMessagePollOptionAdded +} + +func (*MessagePollOptionAdded) MessageContentType() string { + return TypeMessagePollOptionAdded +} + +// A message with information about a deleted poll option +type MessagePollOptionDeleted struct { + meta + // Identifier of the message with the poll; can be an identifier of a deleted message or 0 + PollMessageId int64 `json:"poll_message_id"` + // Identifier of the deleted option in the poll + OptionId string `json:"option_id"` + // Text of the option; 1-100 characters; may contain only custom emoji entities + Text *FormattedText `json:"text"` +} + +func (entity *MessagePollOptionDeleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePollOptionDeleted + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePollOptionDeleted) GetClass() string { + return ClassMessageContent +} + +func (*MessagePollOptionDeleted) GetType() string { + return TypeMessagePollOptionDeleted +} + +func (*MessagePollOptionDeleted) MessageContentType() string { + return TypeMessagePollOptionDeleted +} + // A newly created basic group type MessageBasicGroupChatCreate struct { meta @@ -32884,6 +33472,33 @@ func (*MessageGameScore) MessageContentType() string { return TypeMessageGameScore } +// A bot managed by another bot was created by the user +type MessageManagedBotCreated struct { + meta + // User identifier of the created bot + BotUserId int64 `json:"bot_user_id"` +} + +func (entity *MessageManagedBotCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageManagedBotCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessageManagedBotCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessageManagedBotCreated) GetType() string { + return TypeMessageManagedBotCreated +} + +func (*MessageManagedBotCreated) MessageContentType() string { + return TypeMessageManagedBotCreated +} + // A payment has been sent to a bot or a business account type MessagePaymentSuccessful struct { meta @@ -35274,10 +35889,10 @@ func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string { return TypeTextEntityTypeMediaTimestamp } -// A data and time +// A date and time type TextEntityTypeDateTime struct { meta - // Point in time (Unix timestamp) representing the data and time + // Point in time (Unix timestamp) representing the date and time UnixTime int32 `json:"unix_time"` // Date and time formatting type; may be null if none and the original text must not be changed FormattingType DateTimeFormattingType `json:"formatting_type"` @@ -35322,6 +35937,83 @@ func (textEntityTypeDateTime *TextEntityTypeDateTime) UnmarshalJSON(data []byte) return nil } +// Addition of some text +type DiffEntityTypeInsert struct{ + meta +} + +func (entity *DiffEntityTypeInsert) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiffEntityTypeInsert + + return json.Marshal((*stub)(entity)) +} + +func (*DiffEntityTypeInsert) GetClass() string { + return ClassDiffEntityType +} + +func (*DiffEntityTypeInsert) GetType() string { + return TypeDiffEntityTypeInsert +} + +func (*DiffEntityTypeInsert) DiffEntityTypeType() string { + return TypeDiffEntityTypeInsert +} + +// Change of some text +type DiffEntityTypeReplace struct { + meta + // The old text + OldText string `json:"old_text"` +} + +func (entity *DiffEntityTypeReplace) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiffEntityTypeReplace + + return json.Marshal((*stub)(entity)) +} + +func (*DiffEntityTypeReplace) GetClass() string { + return ClassDiffEntityType +} + +func (*DiffEntityTypeReplace) GetType() string { + return TypeDiffEntityTypeReplace +} + +func (*DiffEntityTypeReplace) DiffEntityTypeType() string { + return TypeDiffEntityTypeReplace +} + +// Removal of some text +type DiffEntityTypeDelete struct{ + meta +} + +func (entity *DiffEntityTypeDelete) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub DiffEntityTypeDelete + + return json.Marshal((*stub)(entity)) +} + +func (*DiffEntityTypeDelete) GetClass() string { + return ClassDiffEntityType +} + +func (*DiffEntityTypeDelete) GetType() string { + return TypeDiffEntityTypeDelete +} + +func (*DiffEntityTypeDelete) DiffEntityTypeType() string { + return TypeDiffEntityTypeDelete +} + // A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size type InputThumbnail struct { meta @@ -35371,8 +36063,10 @@ func (inputThumbnail *InputThumbnail) UnmarshalJSON(data []byte) error { } // The media is a photo. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 -type InputPaidMediaTypePhoto struct{ +type InputPaidMediaTypePhoto struct { meta + // Video of the live photo; pass null if the photo isn't a live photo + Video InputFile `json:"video"` } func (entity *InputPaidMediaTypePhoto) MarshalJSON() ([]byte, error) { @@ -35395,6 +36089,22 @@ func (*InputPaidMediaTypePhoto) InputPaidMediaTypeType() string { return TypeInputPaidMediaTypePhoto } +func (inputPaidMediaTypePhoto *InputPaidMediaTypePhoto) UnmarshalJSON(data []byte) error { + var tmp struct { + Video json.RawMessage `json:"video"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputPaidMediaTypePhoto.Video = fieldVideo + + return nil +} + // The media is a video type InputPaidMediaTypeVideo struct { meta @@ -35758,7 +36468,7 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl, MentionName, and DateTime entities are allowed to be specified manually Text *FormattedText `json:"text"` // Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` @@ -36024,6 +36734,8 @@ type InputMessagePhoto struct { Photo InputFile `json:"photo"` // Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats Thumbnail *InputThumbnail `json:"thumbnail"` + // Video of the live photo; not supported in secret chats; pass null if the photo isn't a live photo + Video InputFile `json:"video"` // File identifiers of the stickers added to the photo, if applicable AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` // Photo width @@ -36064,6 +36776,7 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { var tmp struct { Photo json.RawMessage `json:"photo"` Thumbnail *InputThumbnail `json:"thumbnail"` + Video json.RawMessage `json:"video"` AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` Width int32 `json:"width"` Height int32 `json:"height"` @@ -36089,6 +36802,9 @@ func (inputMessagePhoto *InputMessagePhoto) UnmarshalJSON(data []byte) error { fieldPhoto, _ := UnmarshalInputFile(tmp.Photo) inputMessagePhoto.Photo = fieldPhoto + fieldVideo, _ := UnmarshalInputFile(tmp.Video) + inputMessagePhoto.Video = fieldVideo + fieldSelfDestructType, _ := UnmarshalMessageSelfDestructType(tmp.SelfDestructType) inputMessagePhoto.SelfDestructType = fieldSelfDestructType @@ -36576,15 +37292,25 @@ type InputMessagePoll struct { meta // Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users Question *FormattedText `json:"question"` - // List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users - Options []*FormattedText `json:"options"` + // List of poll answer options; 2-getOption("poll_answer_count_max") options + Options []*InputPollOption `json:"options"` + // Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters + Description *FormattedText `json:"description"` // True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels IsAnonymous bool `json:"is_anonymous"` + // True, if multiple answer options can be chosen simultaneously + AllowsMultipleAnswers bool `json:"allows_multiple_answers"` + // True, if the poll can be answered multiple times + AllowsRevoting bool `json:"allows_revoting"` + // True, if poll options must be shown in a fixed random order + ShuffleOptions bool `json:"shuffle_options"` + // True, if the poll results will appear only after the poll closes + HideResultsUntilCloses bool `json:"hide_results_until_closes"` // Type of the poll - Type PollType `json:"type"` - // Amount of time the poll will be active after creation, in seconds; for bots only + Type InputPollType `json:"type"` + // Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified OpenPeriod int32 `json:"open_period"` - // Point in time (Unix timestamp) when the poll will automatically be closed; for bots only + // Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified CloseDate int32 `json:"close_date"` // True, if the poll needs to be sent already closed; for bots only IsClosed bool `json:"is_closed"` @@ -36613,8 +37339,13 @@ func (*InputMessagePoll) InputMessageContentType() string { func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { var tmp struct { Question *FormattedText `json:"question"` - Options []*FormattedText `json:"options"` + Options []*InputPollOption `json:"options"` + Description *FormattedText `json:"description"` IsAnonymous bool `json:"is_anonymous"` + AllowsMultipleAnswers bool `json:"allows_multiple_answers"` + AllowsRevoting bool `json:"allows_revoting"` + ShuffleOptions bool `json:"shuffle_options"` + HideResultsUntilCloses bool `json:"hide_results_until_closes"` Type json.RawMessage `json:"type"` OpenPeriod int32 `json:"open_period"` CloseDate int32 `json:"close_date"` @@ -36628,12 +37359,17 @@ func (inputMessagePoll *InputMessagePoll) UnmarshalJSON(data []byte) error { inputMessagePoll.Question = tmp.Question inputMessagePoll.Options = tmp.Options + inputMessagePoll.Description = tmp.Description inputMessagePoll.IsAnonymous = tmp.IsAnonymous + inputMessagePoll.AllowsMultipleAnswers = tmp.AllowsMultipleAnswers + inputMessagePoll.AllowsRevoting = tmp.AllowsRevoting + inputMessagePoll.ShuffleOptions = tmp.ShuffleOptions + inputMessagePoll.HideResultsUntilCloses = tmp.HideResultsUntilCloses inputMessagePoll.OpenPeriod = tmp.OpenPeriod inputMessagePoll.CloseDate = tmp.CloseDate inputMessagePoll.IsClosed = tmp.IsClosed - fieldType, _ := UnmarshalPollType(tmp.Type) + fieldType, _ := UnmarshalInputPollType(tmp.Type) inputMessagePoll.Type = fieldType return nil @@ -36858,6 +37594,35 @@ func (*MessageProperties) GetType() string { return TypeMessageProperties } +// Contains properties of a poll option and describes actions that can be done with the option right now +type PollOptionProperties struct { + meta + // True, if the option can be deleted using deletePollOption + CanBeDeleted bool `json:"can_be_deleted"` + // True, if the poll option can be replied in the same chat and forum topic using inputMessageReplyToMessage + CanBeReplied bool `json:"can_be_replied"` + // True, if the poll option can be replied in another chat or forum topic using inputMessageReplyToExternalMessage + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` + // True, if a link can be generated for the poll option using getMessageLink + CanGetLink bool `json:"can_get_link"` +} + +func (entity *PollOptionProperties) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PollOptionProperties + + return json.Marshal((*stub)(entity)) +} + +func (*PollOptionProperties) GetClass() string { + return ClassPollOptionProperties +} + +func (*PollOptionProperties) GetType() string { + return TypePollOptionProperties +} + // Returns all found messages, no filter is applied type SearchMessagesFilterEmpty struct{ meta @@ -36983,6 +37748,31 @@ func (*SearchMessagesFilterPhoto) SearchMessagesFilterType() string { return TypeSearchMessagesFilterPhoto } +// Returns only poll messages +type SearchMessagesFilterPoll struct{ + meta +} + +func (entity *SearchMessagesFilterPoll) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterPoll + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterPoll) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterPoll) GetType() string { + return TypeSearchMessagesFilterPoll +} + +func (*SearchMessagesFilterPoll) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterPoll +} + // Returns only video messages type SearchMessagesFilterVideo struct{ meta @@ -37183,7 +37973,7 @@ func (*SearchMessagesFilterMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterMention } -// Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +// Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query or by the sending user type SearchMessagesFilterUnreadMention struct{ meta } @@ -37208,7 +37998,7 @@ func (*SearchMessagesFilterUnreadMention) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadMention } -// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query or by the sending user type SearchMessagesFilterUnreadReaction struct{ meta } @@ -37233,6 +38023,31 @@ func (*SearchMessagesFilterUnreadReaction) SearchMessagesFilterType() string { return TypeSearchMessagesFilterUnreadReaction } +// Returns only messages with unread poll votes for the current user. When using this filter the results can't be additionally filtered by a query or by the sending user +type SearchMessagesFilterUnreadPollVote struct{ + meta +} + +func (entity *SearchMessagesFilterUnreadPollVote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub SearchMessagesFilterUnreadPollVote + + return json.Marshal((*stub)(entity)) +} + +func (*SearchMessagesFilterUnreadPollVote) GetClass() string { + return ClassSearchMessagesFilter +} + +func (*SearchMessagesFilterUnreadPollVote) GetType() string { + return TypeSearchMessagesFilterUnreadPollVote +} + +func (*SearchMessagesFilterUnreadPollVote) SearchMessagesFilterType() string { + return TypeSearchMessagesFilterUnreadPollVote +} + // Returns only failed to send messages. This filter can be used only if the message database is used type SearchMessagesFilterFailedToSend struct{ meta @@ -43301,7 +44116,7 @@ type ImportedContact struct { FirstName string `json:"first_name"` // Last name of the user; 0-64 characters LastName string `json:"last_name"` - // Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed; pass null to keep the current user's note + // Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed; pass null to keep the current user's note Note *FormattedText `json:"note"` } @@ -48002,6 +48817,31 @@ func (*PremiumLimitTypeSimilarChatCount) PremiumLimitTypeType() string { return TypePremiumLimitTypeSimilarChatCount } +// The maximum number of owned bots +type PremiumLimitTypeOwnedBotCount struct{ + meta +} + +func (entity *PremiumLimitTypeOwnedBotCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeOwnedBotCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeOwnedBotCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeOwnedBotCount) GetType() string { + return TypePremiumLimitTypeOwnedBotCount +} + +func (*PremiumLimitTypeOwnedBotCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeOwnedBotCount +} + // Increased limits type PremiumFeatureIncreasedLimits struct{ meta @@ -48677,6 +49517,31 @@ func (*PremiumFeatureProtectPrivateChatContent) PremiumFeatureType() string { return TypePremiumFeatureProtectPrivateChatContent } +// The ability to compose text with AI +type PremiumFeatureTextComposition struct{ + meta +} + +func (entity *PremiumFeatureTextComposition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureTextComposition + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureTextComposition) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureTextComposition) GetType() string { + return TypePremiumFeatureTextComposition +} + +func (*PremiumFeatureTextComposition) PremiumFeatureType() string { + return TypePremiumFeatureTextComposition +} + // The ability to set location type BusinessFeatureLocation struct{ meta @@ -49643,7 +50508,7 @@ type StorePaymentPurposePremiumGift struct { Amount int64 `json:"amount"` // Identifiers of the user which will receive Telegram Premium UserId int64 `json:"user_id"` - // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` } @@ -49678,7 +50543,7 @@ type StorePaymentPurposePremiumGiftCodes struct { Amount int64 `json:"amount"` // Identifiers of the users which can activate the gift codes UserIds []int64 `json:"user_ids"` - // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` } @@ -49903,7 +50768,7 @@ type TelegramPaymentPurposePremiumGift struct { UserId int64 `json:"user_id"` // Number of months the Telegram Premium subscription will be active for the user MonthCount int32 `json:"month_count"` - // Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` } @@ -49940,7 +50805,7 @@ type TelegramPaymentPurposePremiumGiftCodes struct { UserIds []int64 `json:"user_ids"` // Number of months the Telegram Premium subscription will be active for the users MonthCount int32 `json:"month_count"` - // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed + // Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed Text *FormattedText `json:"text"` } @@ -53057,6 +53922,33 @@ func (*PushMessageContentChecklistTasksDone) PushMessageContentType() string { return TypePushMessageContentChecklistTasksDone } +// An option was added to a poll +type PushMessageContentPollOptionAdded struct { + meta + // Text of the option + Text string `json:"text"` +} + +func (entity *PushMessageContentPollOptionAdded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPollOptionAdded + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPollOptionAdded) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPollOptionAdded) GetType() string { + return TypePushMessageContentPollOptionAdded +} + +func (*PushMessageContentPollOptionAdded) PushMessageContentType() string { + return TypePushMessageContentPollOptionAdded +} + // A forwarded messages type PushMessageContentMessageForwards struct { meta @@ -57687,6 +58579,37 @@ func (*InternalLinkTypeQrCodeAuthentication) InternalLinkTypeType() string { return TypeInternalLinkTypeQrCodeAuthentication } +// The link is a link to a dialog for creating of a managed bot. Call searchPublicChat with the given manager bot username. If the chat is found, the chat is a chat with a bot and the bot has can_manage_bots == true, then show bot creation confirmation dialog with the given suggested_bot_username and suggested_bot_name. If user agrees, call createBot with via_link == true to create the bot +type InternalLinkTypeRequestManagedBot struct { + meta + // Username of the bot which will manage the new bot + ManagerBotUsername string `json:"manager_bot_username"` + // Suggested username for the bot + SuggestedBotUsername string `json:"suggested_bot_username"` + // Suggested name for the bot; may be empty if not specified + SuggestedBotName string `json:"suggested_bot_name"` +} + +func (entity *InternalLinkTypeRequestManagedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeRequestManagedBot + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeRequestManagedBot) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeRequestManagedBot) GetType() string { + return TypeInternalLinkTypeRequestManagedBot +} + +func (*InternalLinkTypeRequestManagedBot) InternalLinkTypeType() string { + return TypeInternalLinkTypeRequestManagedBot +} + // The link forces restore of App Store purchases when opened. For official iOS application only type InternalLinkTypeRestorePurchases struct{ meta @@ -58185,6 +59108,10 @@ type MessageLinkInfo struct { Message *Message `json:"message"` // Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview MediaTimestamp int32 `json:"media_timestamp"` + // Identifier of the checklist task that is linked; 0 if none + ChecklistTaskId int32 `json:"checklist_task_id"` + // Identifier of the poll option that is linked; empty if none + PollOptionId string `json:"poll_option_id"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` } @@ -58212,6 +59139,8 @@ func (messageLinkInfo *MessageLinkInfo) UnmarshalJSON(data []byte) error { TopicId json.RawMessage `json:"topic_id"` Message *Message `json:"message"` MediaTimestamp int32 `json:"media_timestamp"` + ChecklistTaskId int32 `json:"checklist_task_id"` + PollOptionId string `json:"poll_option_id"` ForAlbum bool `json:"for_album"` } @@ -58224,6 +59153,8 @@ func (messageLinkInfo *MessageLinkInfo) UnmarshalJSON(data []byte) error { messageLinkInfo.ChatId = tmp.ChatId messageLinkInfo.Message = tmp.Message messageLinkInfo.MediaTimestamp = tmp.MediaTimestamp + messageLinkInfo.ChecklistTaskId = tmp.ChecklistTaskId + messageLinkInfo.PollOptionId = tmp.PollOptionId messageLinkInfo.ForAlbum = tmp.ForAlbum fieldTopicId, _ := UnmarshalMessageTopic(tmp.TopicId) @@ -58432,6 +59363,31 @@ func (*FileTypeDocument) FileTypeType() string { return TypeFileTypeDocument } +// The file is a video for a live photo +type FileTypeLivePhotoVideo struct{ + meta +} + +func (entity *FileTypeLivePhotoVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeLivePhotoVideo + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeLivePhotoVideo) GetClass() string { + return ClassFileType +} + +func (*FileTypeLivePhotoVideo) GetType() string { + return TypeFileTypeLivePhotoVideo +} + +func (*FileTypeLivePhotoVideo) FileTypeType() string { + return TypeFileTypeLivePhotoVideo +} + // The file is a notification sound type FileTypeNotificationSound struct{ meta @@ -58607,6 +59563,31 @@ func (*FileTypeSecure) FileTypeType() string { return TypeFileTypeSecure } +// The file is a seld-destructing video for a live photo in a private chat +type FileTypeSelfDestructingLivePhotoVideo struct{ + meta +} + +func (entity *FileTypeSelfDestructingLivePhotoVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FileTypeSelfDestructingLivePhotoVideo + + return json.Marshal((*stub)(entity)) +} + +func (*FileTypeSelfDestructingLivePhotoVideo) GetClass() string { + return ClassFileType +} + +func (*FileTypeSelfDestructingLivePhotoVideo) GetType() string { + return TypeFileTypeSelfDestructingLivePhotoVideo +} + +func (*FileTypeSelfDestructingLivePhotoVideo) FileTypeType() string { + return TypeFileTypeSelfDestructingLivePhotoVideo +} + // The file is a self-destructing photo in a private chat type FileTypeSelfDestructingPhoto struct{ meta @@ -60564,7 +61545,7 @@ func (*SuggestedActionCustom) SuggestedActionType() string { // Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address type SuggestedActionSetLoginEmailAddress struct { meta - // True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the app without setting up the email address + // True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the application without setting up the email address CanBeHidden bool `json:"can_be_hidden"` } @@ -62308,7 +63289,7 @@ func (*VectorPathCommandLine) VectorPathCommandType() string { return TypeVectorPathCommandLine } -// A cubic Bézier curve to a given point +// A cubic Bézier curve to a given point type VectorPathCommandCubicBezierCurve struct { meta // The start control point of the curve @@ -63992,6 +64973,35 @@ func (*UpdateChatUnreadReactionCount) UpdateType() string { return TypeUpdateChatUnreadReactionCount } +// The chat unread_poll_vote_count has changed +type UpdateChatUnreadPollVoteCount struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The number of messages with unread poll votes left in the chat + UnreadPollVoteCount int32 `json:"unread_poll_vote_count"` +} + +func (entity *UpdateChatUnreadPollVoteCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatUnreadPollVoteCount + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatUnreadPollVoteCount) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatUnreadPollVoteCount) GetType() string { + return TypeUpdateChatUnreadPollVoteCount +} + +func (*UpdateChatUnreadPollVoteCount) UpdateType() string { + return TypeUpdateChatUnreadPollVoteCount +} + // A chat video chat state has changed type UpdateChatVideoChat struct { meta @@ -64590,6 +65600,8 @@ type UpdateForumTopic struct { UnreadMentionCount int32 `json:"unread_mention_count"` // Number of messages with unread reactions in the topic UnreadReactionCount int32 `json:"unread_reaction_count"` + // Number of messages with unread poll votes in the topic + UnreadPollVoteCount int32 `json:"unread_poll_vote_count"` // Notification settings for the topic NotificationSettings *ChatNotificationSettings `json:"notification_settings"` // A draft of a message in the topic; may be null if none @@ -66735,7 +67747,7 @@ func (*UpdateEmojiChatThemes) UpdateType() string { // The list of supported accent colors has changed type UpdateAccentColors struct { meta - // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme + // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the application theme Colors []*AccentColor `json:"colors"` // The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specified order AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` @@ -67564,6 +68576,33 @@ func (*UpdateAnimationSearchParameters) UpdateType() string { return TypeUpdateAnimationSearchParameters } +// The styles supported for text composition have changed +type UpdateTextCompositionStyles struct { + meta + // The new list of supported styles + Styles []*TextCompositionStyle `json:"styles"` +} + +func (entity *UpdateTextCompositionStyles) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateTextCompositionStyles + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateTextCompositionStyles) GetClass() string { + return ClassUpdate +} + +func (*UpdateTextCompositionStyles) GetType() string { + return TypeUpdateTextCompositionStyles +} + +func (*UpdateTextCompositionStyles) UpdateType() string { + return TypeUpdateTextCompositionStyles +} + // The list of suggested to the user actions has changed type UpdateSuggestedActions struct { meta @@ -68282,8 +69321,10 @@ type UpdatePollAnswer struct { PollId JsonInt64 `json:"poll_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"` + // Unique identifiers of answer options, that were chosen by the user + OptionIds []string `json:"option_ids"` + // 0-based identifiers of answer options, that were chosen by the user + OptionPositions []int32 `json:"option_positions"` } func (entity *UpdatePollAnswer) MarshalJSON() ([]byte, error) { @@ -68310,7 +69351,8 @@ 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"` + OptionIds []string `json:"option_ids"` + OptionPositions []int32 `json:"option_positions"` } err := json.Unmarshal(data, &tmp) @@ -68320,6 +69362,7 @@ func (updatePollAnswer *UpdatePollAnswer) UnmarshalJSON(data []byte) error { updatePollAnswer.PollId = tmp.PollId updatePollAnswer.OptionIds = tmp.OptionIds + updatePollAnswer.OptionPositions = tmp.OptionPositions fieldVoterId, _ := UnmarshalMessageSender(tmp.VoterId) updatePollAnswer.VoterId = fieldVoterId @@ -68327,6 +69370,35 @@ func (updatePollAnswer *UpdatePollAnswer) UnmarshalJSON(data []byte) error { return nil } +// A bot that can be managed by the current bot was created or updated; for bots only +type UpdateManagedBot struct { + meta + // Identifier of the user who created the bot + UserId int64 `json:"user_id"` + // Identifier of the created managed bot + BotUserId int64 `json:"bot_user_id"` +} + +func (entity *UpdateManagedBot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateManagedBot + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateManagedBot) GetClass() string { + return ClassUpdate +} + +func (*UpdateManagedBot) GetType() string { + return TypeUpdateManagedBot +} + +func (*UpdateManagedBot) UpdateType() string { + return TypeUpdateManagedBot +} + // User rights changed in a chat; for bots only type UpdateChatMember struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 4ffa38f..2f45531 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -511,6 +511,40 @@ func UnmarshalListOfPollType(dataList []json.RawMessage) ([]PollType, error) { return list, nil } +func UnmarshalInputPollType(data json.RawMessage) (InputPollType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputPollTypeRegular: + return UnmarshalInputPollTypeRegular(data) + + case TypeInputPollTypeQuiz: + return UnmarshalInputPollTypeQuiz(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputPollType(dataList []json.RawMessage) ([]InputPollType, error) { + list := []InputPollType{} + + for _, data := range dataList { + entity, err := UnmarshalInputPollType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalProfileTab(data json.RawMessage) (ProfileTab, error) { var meta meta @@ -2835,6 +2869,9 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro case TypeKeyboardButtonTypeRequestChat: return UnmarshalKeyboardButtonTypeRequestChat(data) + case TypeKeyboardButtonTypeRequestManagedBot: + return UnmarshalKeyboardButtonTypeRequestManagedBot(data) + case TypeKeyboardButtonTypeWebApp: return UnmarshalKeyboardButtonTypeWebApp(data) @@ -2915,6 +2952,40 @@ func UnmarshalListOfInlineKeyboardButtonType(dataList []json.RawMessage) ([]Inli return list, nil } +func UnmarshalKeyboardButtonSource(data json.RawMessage) (KeyboardButtonSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeKeyboardButtonSourceMessage: + return UnmarshalKeyboardButtonSourceMessage(data) + + case TypeKeyboardButtonSourceWebApp: + return UnmarshalKeyboardButtonSourceWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfKeyboardButtonSource(dataList []json.RawMessage) ([]KeyboardButtonSource, error) { + list := []KeyboardButtonSource{} + + for _, data := range dataList { + entity, err := UnmarshalKeyboardButtonSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalReplyMarkup(data json.RawMessage) (ReplyMarkup, error) { var meta meta @@ -3486,6 +3557,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { case TypeLinkPreviewTypePremiumGiftCode: return UnmarshalLinkPreviewTypePremiumGiftCode(data) + case TypeLinkPreviewTypeRequestManagedBot: + return UnmarshalLinkPreviewTypeRequestManagedBot(data) + case TypeLinkPreviewTypeShareableChatFolder: return UnmarshalLinkPreviewTypeShareableChatFolder(data) @@ -4222,6 +4296,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageInviteVideoChatParticipants: return UnmarshalMessageInviteVideoChatParticipants(data) + case TypeMessagePollOptionAdded: + return UnmarshalMessagePollOptionAdded(data) + + case TypeMessagePollOptionDeleted: + return UnmarshalMessagePollOptionDeleted(data) + case TypeMessageBasicGroupChatCreate: return UnmarshalMessageBasicGroupChatCreate(data) @@ -4309,6 +4389,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageGameScore: return UnmarshalMessageGameScore(data) + case TypeMessageManagedBotCreated: + return UnmarshalMessageManagedBotCreated(data) + case TypeMessagePaymentSuccessful: return UnmarshalMessagePaymentSuccessful(data) @@ -4607,6 +4690,43 @@ func UnmarshalListOfTextEntityType(dataList []json.RawMessage) ([]TextEntityType return list, nil } +func UnmarshalDiffEntityType(data json.RawMessage) (DiffEntityType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeDiffEntityTypeInsert: + return UnmarshalDiffEntityTypeInsert(data) + + case TypeDiffEntityTypeReplace: + return UnmarshalDiffEntityTypeReplace(data) + + case TypeDiffEntityTypeDelete: + return UnmarshalDiffEntityTypeDelete(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfDiffEntityType(dataList []json.RawMessage) ([]DiffEntityType, error) { + list := []DiffEntityType{} + + for _, data := range dataList { + entity, err := UnmarshalDiffEntityType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputPaidMediaType(data json.RawMessage) (InputPaidMediaType, error) { var meta meta @@ -4827,6 +4947,9 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterPhoto: return UnmarshalSearchMessagesFilterPhoto(data) + case TypeSearchMessagesFilterPoll: + return UnmarshalSearchMessagesFilterPoll(data) + case TypeSearchMessagesFilterVideo: return UnmarshalSearchMessagesFilterVideo(data) @@ -4857,6 +4980,9 @@ func UnmarshalSearchMessagesFilter(data json.RawMessage) (SearchMessagesFilter, case TypeSearchMessagesFilterUnreadReaction: return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterUnreadPollVote: + return UnmarshalSearchMessagesFilterUnreadPollVote(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -6602,6 +6728,9 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeSimilarChatCount: return UnmarshalPremiumLimitTypeSimilarChatCount(data) + case TypePremiumLimitTypeOwnedBotCount: + return UnmarshalPremiumLimitTypeOwnedBotCount(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6711,6 +6840,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureProtectPrivateChatContent: return UnmarshalPremiumFeatureProtectPrivateChatContent(data) + case TypePremiumFeatureTextComposition: + return UnmarshalPremiumFeatureTextComposition(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -7682,6 +7814,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentChecklistTasksDone: return UnmarshalPushMessageContentChecklistTasksDone(data) + case TypePushMessageContentPollOptionAdded: + return UnmarshalPushMessageContentPollOptionAdded(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -8518,6 +8653,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRequestManagedBot: + return UnmarshalInternalLinkTypeRequestManagedBot(data) + case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) @@ -8637,6 +8775,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeLivePhotoVideo: + return UnmarshalFileTypeLivePhotoVideo(data) + case TypeFileTypeNotificationSound: return UnmarshalFileTypeNotificationSound(data) @@ -8658,6 +8799,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) { case TypeFileTypeSecure: return UnmarshalFileTypeSecure(data) + case TypeFileTypeSelfDestructingLivePhotoVideo: + return UnmarshalFileTypeSelfDestructingLivePhotoVideo(data) + case TypeFileTypeSelfDestructingPhoto: return UnmarshalFileTypeSelfDestructingPhoto(data) @@ -9552,6 +9696,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatUnreadReactionCount: return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatUnreadPollVoteCount: + return UnmarshalUpdateChatUnreadPollVoteCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -9879,6 +10026,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(data) + case TypeUpdateTextCompositionStyles: + return UnmarshalUpdateTextCompositionStyles(data) + case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) @@ -9936,6 +10086,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(data) + case TypeUpdateManagedBot: + return UnmarshalUpdateManagedBot(data) + case TypeUpdateChatMember: return UnmarshalUpdateChatMember(data) @@ -10186,6 +10339,38 @@ func UnmarshalFormattedText(data json.RawMessage) (*FormattedText, error) { return &resp, err } +func UnmarshalDiffEntity(data json.RawMessage) (*DiffEntity, error) { + var resp DiffEntity + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiffText(data json.RawMessage) (*DiffText, error) { + var resp DiffText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFixedText(data json.RawMessage) (*FixedText, error) { + var resp FixedText + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTextCompositionStyle(data json.RawMessage) (*TextCompositionStyle, error) { + var resp TextCompositionStyle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTermsOfService(data json.RawMessage) (*TermsOfService, error) { var resp TermsOfService @@ -10626,6 +10811,14 @@ func UnmarshalPollOption(data json.RawMessage) (*PollOption, error) { return &resp, err } +func UnmarshalInputPollOption(data json.RawMessage) (*InputPollOption, error) { + var resp InputPollOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPollTypeRegular(data json.RawMessage) (*PollTypeRegular, error) { var resp PollTypeRegular @@ -10642,6 +10835,22 @@ func UnmarshalPollTypeQuiz(data json.RawMessage) (*PollTypeQuiz, error) { return &resp, err } +func UnmarshalInputPollTypeRegular(data json.RawMessage) (*InputPollTypeRegular, error) { + var resp InputPollTypeRegular + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputPollTypeQuiz(data json.RawMessage) (*InputPollTypeQuiz, error) { + var resp InputPollTypeQuiz + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChecklistTask(data json.RawMessage) (*ChecklistTask, error) { var resp ChecklistTask @@ -14474,6 +14683,14 @@ func UnmarshalKeyboardButtonTypeRequestChat(data json.RawMessage) (*KeyboardButt return &resp, err } +func UnmarshalKeyboardButtonTypeRequestManagedBot(data json.RawMessage) (*KeyboardButtonTypeRequestManagedBot, error) { + var resp KeyboardButtonTypeRequestManagedBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) { var resp KeyboardButtonTypeWebApp @@ -14570,6 +14787,22 @@ func UnmarshalInlineKeyboardButtonTypeCopyText(data json.RawMessage) (*InlineKey return &resp, err } +func UnmarshalKeyboardButtonSourceMessage(data json.RawMessage) (*KeyboardButtonSourceMessage, error) { + var resp KeyboardButtonSourceMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalKeyboardButtonSourceWebApp(data json.RawMessage) (*KeyboardButtonSourceWebApp, error) { + var resp KeyboardButtonSourceWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInlineKeyboardButton(data json.RawMessage) (*InlineKeyboardButton, error) { var resp InlineKeyboardButton @@ -15506,6 +15739,14 @@ func UnmarshalLinkPreviewTypePremiumGiftCode(data json.RawMessage) (*LinkPreview return &resp, err } +func UnmarshalLinkPreviewTypeRequestManagedBot(data json.RawMessage) (*LinkPreviewTypeRequestManagedBot, error) { + var resp LinkPreviewTypeRequestManagedBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalLinkPreviewTypeShareableChatFolder(data json.RawMessage) (*LinkPreviewTypeShareableChatFolder, error) { var resp LinkPreviewTypeShareableChatFolder @@ -16786,6 +17027,22 @@ func UnmarshalMessageInviteVideoChatParticipants(data json.RawMessage) (*Message return &resp, err } +func UnmarshalMessagePollOptionAdded(data json.RawMessage) (*MessagePollOptionAdded, error) { + var resp MessagePollOptionAdded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePollOptionDeleted(data json.RawMessage) (*MessagePollOptionDeleted, error) { + var resp MessagePollOptionDeleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageBasicGroupChatCreate(data json.RawMessage) (*MessageBasicGroupChatCreate, error) { var resp MessageBasicGroupChatCreate @@ -17018,6 +17275,14 @@ func UnmarshalMessageGameScore(data json.RawMessage) (*MessageGameScore, error) return &resp, err } +func UnmarshalMessageManagedBotCreated(data json.RawMessage) (*MessageManagedBotCreated, error) { + var resp MessageManagedBotCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessagePaymentSuccessful(data json.RawMessage) (*MessagePaymentSuccessful, error) { var resp MessagePaymentSuccessful @@ -17538,6 +17803,30 @@ func UnmarshalTextEntityTypeDateTime(data json.RawMessage) (*TextEntityTypeDateT return &resp, err } +func UnmarshalDiffEntityTypeInsert(data json.RawMessage) (*DiffEntityTypeInsert, error) { + var resp DiffEntityTypeInsert + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiffEntityTypeReplace(data json.RawMessage) (*DiffEntityTypeReplace, error) { + var resp DiffEntityTypeReplace + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalDiffEntityTypeDelete(data json.RawMessage) (*DiffEntityTypeDelete, error) { + var resp DiffEntityTypeDelete + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) { var resp InputThumbnail @@ -17802,6 +18091,14 @@ func UnmarshalMessageProperties(data json.RawMessage) (*MessageProperties, error return &resp, err } +func UnmarshalPollOptionProperties(data json.RawMessage) (*PollOptionProperties, error) { + var resp PollOptionProperties + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterEmpty(data json.RawMessage) (*SearchMessagesFilterEmpty, error) { var resp SearchMessagesFilterEmpty @@ -17842,6 +18139,14 @@ func UnmarshalSearchMessagesFilterPhoto(data json.RawMessage) (*SearchMessagesFi return &resp, err } +func UnmarshalSearchMessagesFilterPoll(data json.RawMessage) (*SearchMessagesFilterPoll, error) { + var resp SearchMessagesFilterPoll + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterVideo(data json.RawMessage) (*SearchMessagesFilterVideo, error) { var resp SearchMessagesFilterVideo @@ -17922,6 +18227,14 @@ func UnmarshalSearchMessagesFilterUnreadReaction(data json.RawMessage) (*SearchM return &resp, err } +func UnmarshalSearchMessagesFilterUnreadPollVote(data json.RawMessage) (*SearchMessagesFilterUnreadPollVote, error) { + var resp SearchMessagesFilterUnreadPollVote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterFailedToSend(data json.RawMessage) (*SearchMessagesFilterFailedToSend, error) { var resp SearchMessagesFilterFailedToSend @@ -20474,6 +20787,14 @@ func UnmarshalPremiumLimitTypeSimilarChatCount(data json.RawMessage) (*PremiumLi return &resp, err } +func UnmarshalPremiumLimitTypeOwnedBotCount(data json.RawMessage) (*PremiumLimitTypeOwnedBotCount, error) { + var resp PremiumLimitTypeOwnedBotCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { var resp PremiumFeatureIncreasedLimits @@ -20690,6 +21011,14 @@ func UnmarshalPremiumFeatureProtectPrivateChatContent(data json.RawMessage) (*Pr return &resp, err } +func UnmarshalPremiumFeatureTextComposition(data json.RawMessage) (*PremiumFeatureTextComposition, error) { + var resp PremiumFeatureTextComposition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) { var resp BusinessFeatureLocation @@ -21890,6 +22219,14 @@ func UnmarshalPushMessageContentChecklistTasksDone(data json.RawMessage) (*PushM return &resp, err } +func UnmarshalPushMessageContentPollOptionAdded(data json.RawMessage) (*PushMessageContentPollOptionAdded, error) { + var resp PushMessageContentPollOptionAdded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) { var resp PushMessageContentMessageForwards @@ -23202,6 +23539,14 @@ func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*Inter return &resp, err } +func UnmarshalInternalLinkTypeRequestManagedBot(data json.RawMessage) (*InternalLinkTypeRequestManagedBot, error) { + var resp InternalLinkTypeRequestManagedBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalLinkTypeRestorePurchases, error) { var resp InternalLinkTypeRestorePurchases @@ -23402,6 +23747,14 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error) return &resp, err } +func UnmarshalFileTypeLivePhotoVideo(data json.RawMessage) (*FileTypeLivePhotoVideo, error) { + var resp FileTypeLivePhotoVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) { var resp FileTypeNotificationSound @@ -23458,6 +23811,14 @@ func UnmarshalFileTypeSecure(data json.RawMessage) (*FileTypeSecure, error) { return &resp, err } +func UnmarshalFileTypeSelfDestructingLivePhotoVideo(data json.RawMessage) (*FileTypeSelfDestructingLivePhotoVideo, error) { + var resp FileTypeSelfDestructingLivePhotoVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFileTypeSelfDestructingPhoto(data json.RawMessage) (*FileTypeSelfDestructingPhoto, error) { var resp FileTypeSelfDestructingPhoto @@ -24842,6 +25203,14 @@ func UnmarshalUpdateChatUnreadReactionCount(data json.RawMessage) (*UpdateChatUn return &resp, err } +func UnmarshalUpdateChatUnreadPollVoteCount(data json.RawMessage) (*UpdateChatUnreadPollVoteCount, error) { + var resp UpdateChatUnreadPollVoteCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatVideoChat(data json.RawMessage) (*UpdateChatVideoChat, error) { var resp UpdateChatVideoChat @@ -25714,6 +26083,14 @@ func UnmarshalUpdateAnimationSearchParameters(data json.RawMessage) (*UpdateAnim return &resp, err } +func UnmarshalUpdateTextCompositionStyles(data json.RawMessage) (*UpdateTextCompositionStyles, error) { + var resp UpdateTextCompositionStyles + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSuggestedActions(data json.RawMessage) (*UpdateSuggestedActions, error) { var resp UpdateSuggestedActions @@ -25866,6 +26243,14 @@ func UnmarshalUpdatePollAnswer(data json.RawMessage) (*UpdatePollAnswer, error) return &resp, err } +func UnmarshalUpdateManagedBot(data json.RawMessage) (*UpdateManagedBot, error) { + var resp UpdateManagedBot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatMember(data json.RawMessage) (*UpdateChatMember, error) { var resp UpdateChatMember @@ -26101,6 +26486,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFormattedText: return UnmarshalFormattedText(data) + case TypeDiffEntity: + return UnmarshalDiffEntity(data) + + case TypeDiffText: + return UnmarshalDiffText(data) + + case TypeFixedText: + return UnmarshalFixedText(data) + + case TypeTextCompositionStyle: + return UnmarshalTextCompositionStyle(data) + case TypeTermsOfService: return UnmarshalTermsOfService(data) @@ -26266,12 +26663,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePollOption: return UnmarshalPollOption(data) + case TypeInputPollOption: + return UnmarshalInputPollOption(data) + case TypePollTypeRegular: return UnmarshalPollTypeRegular(data) case TypePollTypeQuiz: return UnmarshalPollTypeQuiz(data) + case TypeInputPollTypeRegular: + return UnmarshalInputPollTypeRegular(data) + + case TypeInputPollTypeQuiz: + return UnmarshalInputPollTypeQuiz(data) + case TypeChecklistTask: return UnmarshalChecklistTask(data) @@ -27709,6 +28115,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeKeyboardButtonTypeRequestChat: return UnmarshalKeyboardButtonTypeRequestChat(data) + case TypeKeyboardButtonTypeRequestManagedBot: + return UnmarshalKeyboardButtonTypeRequestManagedBot(data) + case TypeKeyboardButtonTypeWebApp: return UnmarshalKeyboardButtonTypeWebApp(data) @@ -27745,6 +28154,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInlineKeyboardButtonTypeCopyText: return UnmarshalInlineKeyboardButtonTypeCopyText(data) + case TypeKeyboardButtonSourceMessage: + return UnmarshalKeyboardButtonSourceMessage(data) + + case TypeKeyboardButtonSourceWebApp: + return UnmarshalKeyboardButtonSourceWebApp(data) + case TypeInlineKeyboardButton: return UnmarshalInlineKeyboardButton(data) @@ -28096,6 +28511,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeLinkPreviewTypePremiumGiftCode: return UnmarshalLinkPreviewTypePremiumGiftCode(data) + case TypeLinkPreviewTypeRequestManagedBot: + return UnmarshalLinkPreviewTypeRequestManagedBot(data) + case TypeLinkPreviewTypeShareableChatFolder: return UnmarshalLinkPreviewTypeShareableChatFolder(data) @@ -28576,6 +28994,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageInviteVideoChatParticipants: return UnmarshalMessageInviteVideoChatParticipants(data) + case TypeMessagePollOptionAdded: + return UnmarshalMessagePollOptionAdded(data) + + case TypeMessagePollOptionDeleted: + return UnmarshalMessagePollOptionDeleted(data) + case TypeMessageBasicGroupChatCreate: return UnmarshalMessageBasicGroupChatCreate(data) @@ -28663,6 +29087,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageGameScore: return UnmarshalMessageGameScore(data) + case TypeMessageManagedBotCreated: + return UnmarshalMessageManagedBotCreated(data) + case TypeMessagePaymentSuccessful: return UnmarshalMessagePaymentSuccessful(data) @@ -28858,6 +29285,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypeDateTime: return UnmarshalTextEntityTypeDateTime(data) + case TypeDiffEntityTypeInsert: + return UnmarshalDiffEntityTypeInsert(data) + + case TypeDiffEntityTypeReplace: + return UnmarshalDiffEntityTypeReplace(data) + + case TypeDiffEntityTypeDelete: + return UnmarshalDiffEntityTypeDelete(data) + case TypeInputThumbnail: return UnmarshalInputThumbnail(data) @@ -28957,6 +29393,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageProperties: return UnmarshalMessageProperties(data) + case TypePollOptionProperties: + return UnmarshalPollOptionProperties(data) + case TypeSearchMessagesFilterEmpty: return UnmarshalSearchMessagesFilterEmpty(data) @@ -28972,6 +29411,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterPhoto: return UnmarshalSearchMessagesFilterPhoto(data) + case TypeSearchMessagesFilterPoll: + return UnmarshalSearchMessagesFilterPoll(data) + case TypeSearchMessagesFilterVideo: return UnmarshalSearchMessagesFilterVideo(data) @@ -29002,6 +29444,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSearchMessagesFilterUnreadReaction: return UnmarshalSearchMessagesFilterUnreadReaction(data) + case TypeSearchMessagesFilterUnreadPollVote: + return UnmarshalSearchMessagesFilterUnreadPollVote(data) + case TypeSearchMessagesFilterFailedToSend: return UnmarshalSearchMessagesFilterFailedToSend(data) @@ -29959,6 +30404,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeSimilarChatCount: return UnmarshalPremiumLimitTypeSimilarChatCount(data) + case TypePremiumLimitTypeOwnedBotCount: + return UnmarshalPremiumLimitTypeOwnedBotCount(data) + case TypePremiumFeatureIncreasedLimits: return UnmarshalPremiumFeatureIncreasedLimits(data) @@ -30040,6 +30488,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureProtectPrivateChatContent: return UnmarshalPremiumFeatureProtectPrivateChatContent(data) + case TypePremiumFeatureTextComposition: + return UnmarshalPremiumFeatureTextComposition(data) + case TypeBusinessFeatureLocation: return UnmarshalBusinessFeatureLocation(data) @@ -30490,6 +30941,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentChecklistTasksDone: return UnmarshalPushMessageContentChecklistTasksDone(data) + case TypePushMessageContentPollOptionAdded: + return UnmarshalPushMessageContentPollOptionAdded(data) + case TypePushMessageContentMessageForwards: return UnmarshalPushMessageContentMessageForwards(data) @@ -30982,6 +31436,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeQrCodeAuthentication: return UnmarshalInternalLinkTypeQrCodeAuthentication(data) + case TypeInternalLinkTypeRequestManagedBot: + return UnmarshalInternalLinkTypeRequestManagedBot(data) + case TypeInternalLinkTypeRestorePurchases: return UnmarshalInternalLinkTypeRestorePurchases(data) @@ -31057,6 +31514,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeDocument: return UnmarshalFileTypeDocument(data) + case TypeFileTypeLivePhotoVideo: + return UnmarshalFileTypeLivePhotoVideo(data) + case TypeFileTypeNotificationSound: return UnmarshalFileTypeNotificationSound(data) @@ -31078,6 +31538,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeFileTypeSecure: return UnmarshalFileTypeSecure(data) + case TypeFileTypeSelfDestructingLivePhotoVideo: + return UnmarshalFileTypeSelfDestructingLivePhotoVideo(data) + case TypeFileTypeSelfDestructingPhoto: return UnmarshalFileTypeSelfDestructingPhoto(data) @@ -31597,6 +32060,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatUnreadReactionCount: return UnmarshalUpdateChatUnreadReactionCount(data) + case TypeUpdateChatUnreadPollVoteCount: + return UnmarshalUpdateChatUnreadPollVoteCount(data) + case TypeUpdateChatVideoChat: return UnmarshalUpdateChatVideoChat(data) @@ -31924,6 +32390,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateAnimationSearchParameters: return UnmarshalUpdateAnimationSearchParameters(data) + case TypeUpdateTextCompositionStyles: + return UnmarshalUpdateTextCompositionStyles(data) + case TypeUpdateSuggestedActions: return UnmarshalUpdateSuggestedActions(data) @@ -31981,6 +32450,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdatePollAnswer: return UnmarshalUpdatePollAnswer(data) + case TypeUpdateManagedBot: + return UnmarshalUpdateManagedBot(data) + case TypeUpdateChatMember: return UnmarshalUpdateChatMember(data) diff --git a/data/td_api.tl b/data/td_api.tl index 988dd2c..78e880a 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -113,13 +113,30 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other +//-Pre, Code, PreCode, and DateTime entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; +//@description Represents a change of a text @offset Offset of the entity, in UTF-16 code units @length Length of the entity, in UTF-16 code units @type Type of the entity +diffEntity offset:int32 length:int32 type:DiffEntityType = DiffEntity; + +//@description A text with some changes highlighted @text The text @entities Entities describing changes in the text. Entities doesn't mutually intersect with each other +diffText text:string entities:vector = DiffText; + +//@description A text fixed using fixTextWithAi @text The resulting text @diff_text Changes made to the original text +fixedText text:formattedText diff_text:diffText = FixedText; + + +//@description Describes a style that can be used to compose a text +//@name Name of the style +//@custom_emoji_id Identifier of the custom emoji corresponding to the style +//@title Title of the style in the user application's language +textCompositionStyle name:string custom_emoji_id:int64 title:string = TextCompositionStyle; + //@description Contains Telegram terms of service @text Text of the terms of service @min_user_age The minimum age of a user to be able to accept the terms; 0 if age isn't restricted @show_popup True, if a blocking popup with terms of service must be shown to the user termsOfService text:formattedText min_user_age:int32 show_popup:Bool = TermsOfService; + //@description Describes a passkey //@id Unique identifier of the passkey //@name Name of the passkey @@ -383,39 +400,61 @@ outline paths:vector = Outline; //@description Describes one answer option of a poll -//@text Option text; 1-100 characters. Only custom emoji entities are allowed -//@voter_count Number of voters for this option, available only for closed or voted polls +//@id Unique identifier of the option in the poll +//@text Option text; 1-100 characters; may contain only custom emoji entities +//@media Option media. Currently, can be only of the types messageAnimation, messageLocation, messagePhoto, messageSticker, messageVenue, or messageVideo without caption +//@voter_count Number of voters for this option, available only for closed or voted polls, or if the current user is the creator of the poll //@vote_percentage The percentage of votes for this option; 0-100 +//@recent_voter_ids Identifiers of recent voters for the option, if the poll is non-anonymous and poll results are available //@is_chosen True, if the option was chosen by the user //@is_being_chosen True, if the option is being chosen by a pending setPollAnswer request -pollOption text:formattedText voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption; +//@author Identifier of the user or chat who added the option; may be null if the option existed from creation of the poll +//@addition_date Point in time (Unix timestamp) when the option was added; 0 if the option existed from creation of the poll +pollOption id:string text:formattedText media:MessageContent voter_count:int32 vote_percentage:int32 recent_voter_ids:vector is_chosen:Bool is_being_chosen:Bool author:MessageSender addition_date:int32 = PollOption; + +//@description Describes one answer option of a poll to be created +//@text Option text; 1-100 characters. Only custom emoji entities are allowed to be added and only by Premium users +inputPollOption text:formattedText = InputPollOption; //@class PollType @description Describes the type of poll -//@description A regular poll @allow_multiple_answers True, if multiple answer options can be chosen simultaneously -pollTypeRegular allow_multiple_answers:Bool = PollType; +//@description A regular poll +pollTypeRegular = PollType; -//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once -//@correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll -//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll -pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType; +//@description A poll in quiz mode, which has predefined correct answers +//@correct_option_ids Increasing list of 0-based identifiers of the correct answer options; empty for a yet unanswered poll +//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; empty for a yet unanswered poll +//@explanation_media Media that is shown when the user chooses an incorrect answer or taps on the lamp icon; may be null if none or the poll is unanswered yet. +//-Currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption +pollTypeQuiz correct_option_ids:vector explanation:formattedText explanation_media:MessageContent = PollType; + + +//@class InputPollType @description Describes the type of poll to send + +//@description A regular poll @allow_adding_options True, if answer options can be added to the poll after creation; not supported in channel chats and for anonymous polls +inputPollTypeRegular allow_adding_options:Bool = InputPollType; + +//@description A poll in quiz mode, which has predefined correct answers +//@correct_option_ids Increasing list of 0-based identifiers of the correct answer options; must be non-empty +//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds +inputPollTypeQuiz correct_option_ids:vector explanation:formattedText = InputPollType; //@description Describes a task in a checklist //@id Unique identifier of the task -//@text Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities +//@text Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, DateTime and automatically found entities //@completed_by Identifier of the user or chat that completed the task; may be null if the task isn't completed yet //@completion_date Point in time (Unix timestamp) when the task was completed; 0 if the task isn't completed checklistTask id:int32 text:formattedText completed_by:MessageSender completion_date:int32 = ChecklistTask; //@description Describes a task in a checklist to be sent //@id Unique identifier of the task; must be positive -//@text Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities +//@text Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities inputChecklistTask id:int32 text:formattedText = InputChecklistTask; //@description Describes a checklist -//@title Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities +//@title Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities //@tasks List of tasks in the checklist //@others_can_add_tasks True, if users other than creator of the list can add tasks to the list //@can_add_tasks True, if the current user can add tasks to the list if they have Telegram Premium subscription @@ -424,7 +463,7 @@ inputChecklistTask id:int32 text:formattedText = InputChecklistTask; checklist title:formattedText tasks:vector others_can_add_tasks:Bool can_add_tasks:Bool others_can_mark_tasks_as_done:Bool can_mark_tasks_as_done:Bool = Checklist; //@description Describes a checklist to be sent -//@title Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities +//@title Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities //@tasks List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks //@others_can_add_tasks True, if other users can add tasks to the list //@others_can_mark_tasks_as_done True, if other users can mark tasks as done or not done @@ -575,16 +614,20 @@ webApp short_name:string title:string description:string photo:photo animation:a //@description Describes a poll //@id Unique poll identifier -//@question Poll question; 1-300 characters. Only custom emoji entities are allowed +//@question Poll question; 1-300 characters; may contain only custom emoji entities //@options List of poll answer options //@total_voter_count Total number of voters, participating in the poll -//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous +//@recent_voter_ids Identifiers of recent voters, if the poll is non-anonymous and poll results are available +//@can_get_voters True, if the current user can get voters in the poll //@is_anonymous True, if the poll is anonymous +//@allows_multiple_answers True, if multiple answer options can be chosen simultaneously +//@allows_revoting True, if the poll can be answered multiple times +//@option_order The list of 0-based poll identifiers in which the options of the poll must be shown; empty if the order of options must not be changed //@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:formattedText 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; +poll id:int64 question:formattedText options:vector total_voter_count:int32 recent_voter_ids:vector can_get_voters:Bool is_anonymous:Bool allows_multiple_answers:Bool allows_revoting:Bool option_order:vector type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; //@description Describes an alternative re-encoded quality of a video file @@ -680,13 +723,14 @@ userTypeDeleted = UserType; //@has_main_web_app True, if the bot has the main Web App //@has_topics True, if the bot has topics //@allows_users_to_create_topics True, if users can create and delete topics in the chat with the bot +//@can_manage_bots True, if the bot can manage other bots //@is_inline True, if the bot supports inline queries //@inline_query_placeholder Placeholder for inline queries (displayed on the application input field) //@need_location True, if the location of the user is expected to be sent with every inline query to this bot //@can_connect_to_business True, if the bot supports connection to Telegram Business accounts //@can_be_added_to_attachment_menu True, if the bot can be added to attachment or side menu //@active_user_count The number of recently active users of the bot -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool allows_users_to_create_topics:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; +userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool has_main_web_app:Bool has_topics:Bool allows_users_to_create_topics:Bool can_manage_bots:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool active_user_count:int32 = UserType; //@description No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type userTypeUnknown = UserType; @@ -2141,6 +2185,7 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use //@param_description The text shown in the chat with the bot if the chat is empty //@photo Photo shown in the chat with the bot if the chat is empty; may be null //@animation Animation shown in the chat with the bot if the chat is empty; may be null +//@manager_bot_user_id Identifier of the bot, which manages the bot; 0 if none or unknown; for owner of the bot only //@menu_button Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown //@commands List of the bot commands //@privacy_policy_url The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn't supported, then https://telegram.org/privacy-tpa must be opened @@ -2159,7 +2204,7 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use //@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 privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights affiliate_program:affiliateProgramInfo web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 verification_parameters:botVerificationParameters can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; +botInfo short_description:string description:string photo:photo animation:animation manager_bot_user_id:int53 menu_button:botMenuButton commands:vector privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights affiliate_program:affiliateProgramInfo web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 verification_parameters:botVerificationParameters can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool 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. @@ -2178,6 +2223,7 @@ botInfo short_description:string description:string photo:photo animation:animat //@has_sponsored_messages_enabled True, if the user always enabled sponsored messages; known only for the current user //@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 //@set_chat_background True, if the user set chat background for both chat users and it wasn't reverted yet +//@uses_unofficial_app True, if the user uses an unofficial application that poses a security risk //@bio A short user bio; may be null for bots //@birthdate Birthdate of the user; may be null if unknown //@personal_chat_id Identifier of the personal chat of the user; 0 if none @@ -2195,7 +2241,7 @@ botInfo short_description:string description:string photo:photo animation:animat //@note Note added to the user's contact; may be null if none //@business_info Information about business settings for Telegram Business accounts; may be null if none //@bot_info For bots, information about the bot; may be null if the user isn't a bot -userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList 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_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 gift_settings:giftSettings bot_verification:botVerification main_profile_tab:ProfileTab first_profile_audio:audio rating:userRating pending_rating:userRating pending_rating_date:int32 note:formattedText business_info:businessInfo bot_info:botInfo = UserFullInfo; +userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList 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_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool uses_unofficial_app:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 incoming_paid_message_star_count:int53 outgoing_paid_message_star_count:int53 gift_settings:giftSettings bot_verification:botVerification main_profile_tab:ProfileTab first_profile_audio:audio rating:userRating pending_rating:userRating pending_rating_date:int32 note:formattedText business_info:businessInfo 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; @@ -2204,8 +2250,12 @@ users total_count:int32 user_ids:vector = Users; foundUsers user_ids:vector next_offset:string = FoundUsers; -//@description Contains information about a chat administrator @user_id User identifier of the administrator @custom_title Custom title of the administrator @is_owner True, if the user is the owner of the chat -chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdministrator; +//@description Contains information about a chat administrator +//@user_id User identifier of the administrator +//@custom_title Custom title of the administrator +//@is_owner True, if the user is the owner of the chat +//@can_be_edited True, if the current user can edit the administrator privileges for the administrator +chatAdministrator user_id:int53 custom_title:string is_owner:Bool can_be_edited:Bool = ChatAdministrator; //@description Represents a list of chat administrators @administrators A list of chat administrators chatAdministrators administrators:vector = ChatAdministrators; @@ -2742,13 +2792,13 @@ messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool ne //@description Describes manually or automatically chosen quote from another message -//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text +//@text Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities can be present in the text //@position Approximate quote position in the original message in UTF-16 code units as specified by the message sender //@is_manual True, if the quote was manually chosen by the message sender textQuote text:formattedText position:int32 is_manual:Bool = TextQuote; //@description Describes manually chosen quote from another message -//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +//@text Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed to be kept and must be kept in the quote //@position Quote position in the original message in UTF-16 code units inputTextQuote text:formattedText position:int32 = InputTextQuote; @@ -2760,13 +2810,14 @@ inputTextQuote text:formattedText position:int32 = InputTextQuote; //@message_id The identifier of the message; may be 0 if the replied message is in unknown chat //@quote Chosen quote from the replied message; may be null if none //@checklist_task_id Identifier of the checklist task in the original message that was replied; 0 if none +//@poll_option_id Identifier of the poll option in the original message that was replied; empty if none //@origin Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat //@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat //@content Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. //-Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, -//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, messageSticker, messageStory, -//-messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote -messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote checklist_task_id:int32 origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; +//-messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageStakeDice, +//-messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote +messageReplyToMessage chat_id:int53 message_id:int53 quote:textQuote checklist_task_id:int32 poll_option_id:string origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; //@description Describes a story replied by a given message @story_poster_chat_id The identifier of the poster of the story @story_id The identifier of the story messageReplyToStory story_poster_chat_id:int53 story_id:int32 = MessageReplyTo; @@ -2778,14 +2829,16 @@ messageReplyToStory story_poster_chat_id:int53 story_id:int32 = MessageReplyTo; //@message_id The identifier of the message to be replied in the same chat and forum topic. A message can be replied in the same chat and forum topic only if messageProperties.can_be_replied //@quote Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats //@checklist_task_id Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message -inputMessageReplyToMessage message_id:int53 quote:inputTextQuote checklist_task_id:int32 = InputMessageReplyTo; +//@poll_option_id Identifier of the poll option in the message to be replied; pass an empty string if none +inputMessageReplyToMessage message_id:int53 quote:inputTextQuote checklist_task_id:int32 poll_option_id:string = InputMessageReplyTo; //@description Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats //@chat_id The identifier of the chat to which the message to be replied belongs //@message_id The identifier of the message to be replied in the specified chat. A message can be replied in another chat or forum topic only if messageProperties.can_be_replied_in_another_chat //@quote Quote from the message to be replied; pass null if none //@checklist_task_id Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message -inputMessageReplyToExternalMessage chat_id:int53 message_id:int53 quote:inputTextQuote checklist_task_id:int32 = InputMessageReplyTo; +//@poll_option_id Identifier of the poll option in the message to be replied; pass an empty string if none +inputMessageReplyToExternalMessage chat_id:int53 message_id:int53 quote:inputTextQuote checklist_task_id:int32 poll_option_id:string = InputMessageReplyTo; //@description Describes a story to be replied //@story_poster_chat_id The identifier of the poster of the story. Currently, stories can be replied only in the chat that posted the story; channel stories can't be replied @@ -2924,7 +2977,8 @@ advertisementSponsor url:string photo:photo info:string = AdvertisementSponsor; //@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" //@can_be_reported True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage -//@content Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen +//@content Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen. +//-The content must be fully downloaded before the message is shown //@sponsor Information about the sponsor of the message //@title Title of the sponsored message //@button_text Text for the message action button @@ -3063,12 +3117,13 @@ reactionNotificationSourceContacts = ReactionNotificationSource; reactionNotificationSourceAll = ReactionNotificationSource; -//@description Contains information about notification settings for reactions +//@description Contains information about notification settings for reactions and poll votes //@message_reaction_source Source of message reactions for which notifications are shown //@story_reaction_source Source of story reactions for which notifications are shown +//@poll_vote_source Source of poll votes for which notifications are shown //@sound_id Identifier of the notification sound to be played; 0 if sound is disabled //@show_preview True, if reaction sender and emoji must be displayed in notifications -reactionNotificationSettings message_reaction_source:ReactionNotificationSource story_reaction_source:ReactionNotificationSource sound_id:int64 show_preview:Bool = ReactionNotificationSettings; +reactionNotificationSettings message_reaction_source:ReactionNotificationSource story_reaction_source:ReactionNotificationSource poll_vote_source:ReactionNotificationSource sound_id:int64 show_preview:Bool = ReactionNotificationSettings; //@description Contains information about a message draft @@ -3256,6 +3311,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the chat //@unread_reaction_count Number of messages with unread reactions in the chat +//@unread_poll_vote_count Number of messages with unread poll votes in the chat //@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 @@ -3269,7 +3325,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 reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@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 accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics: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 emoji_status:emojiStatus background:chatBackground theme:ChatTheme action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar 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 accent_color_id:int32 background_custom_emoji_id:int64 upgraded_gift_colors:upgradedGiftColors profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector chat_lists:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool view_as_topics: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 unread_poll_vote_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 emoji_status:emojiStatus background:chatBackground theme:ChatTheme action_bar:ChatActionBar business_bot_manage_bar:businessBotManageBar 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; @@ -3392,6 +3448,12 @@ keyboardButtonTypeRequestUsers id:int32 restrict_user_is_bot:Bool user_is_bot:Bo //@request_photo Pass true to request photo of the chat; bots only keyboardButtonTypeRequestChat id:int32 chat_is_channel:Bool restrict_chat_is_forum:Bool chat_is_forum:Bool restrict_chat_has_username:Bool chat_has_username:Bool chat_is_created:Bool user_administrator_rights:chatAdministratorRights bot_administrator_rights:chatAdministratorRights bot_is_member:Bool request_title:Bool request_username:Bool request_photo:Bool = KeyboardButtonType; +//@description A button that requests creation of a managed bot by the current user; available only in private chats. Use the method createBot to complete the request +//@id Unique button identifier +//@suggested_name Suggested name for the bot; may be empty if not specified +//@suggested_username Suggested username for the bot; may be empty if not specified +keyboardButtonTypeRequestManagedBot id:int32 suggested_name:string suggested_username:string = KeyboardButtonType; + //@description A button that opens a Web App by calling getWebAppUrl @url An HTTP URL to pass to getWebAppUrl keyboardButtonTypeWebApp url:string = KeyboardButtonType; @@ -3437,6 +3499,19 @@ inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType; inlineKeyboardButtonTypeCopyText text:string = InlineKeyboardButtonType; +//@class KeyboardButtonSource @description Describes source of a keyboard button + +//@description The button is from a bot's message +//@chat_id Identifier of the chat with the message +//@message_id Identifier of the message with the button +keyboardButtonSourceMessage chat_id:int53 message_id:int53 = KeyboardButtonSource; + +//@description The button is a prepared keyboard button from a Mini App received via getPreparedKeyboardButton +//@bot_user_id Identifier of the bot that created the button +//@prepared_button_id Identifier of the prepared button +keyboardButtonSourceWebApp bot_user_id:int53 prepared_button_id:string = KeyboardButtonSource; + + //@description Represents a single button in an inline keyboard //@text Text of the button //@icon_custom_emoji_id Identifier of the custom emoji that must be shown on the button; 0 if none @@ -3485,9 +3560,11 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 reque //@description Information about the OAuth authorization //@user_id Identifier of the user for which the link was generated; may be 0 if unknown. The corresponding user may be unknown. -//-If the user is logged in the app, then they must be chosen for authorization by default +//-If the user is logged in the application, then they must be chosen for authorization by default //@url An HTTP URL where the user authorizes //@domain A domain of the URL +//@from_app True, if the authorization originates from an application +//@verified_app_name Verified name of the application; if empty, then "Unverified App" must be shown instead //@bot_user_id User identifier of a bot linked with the website //@request_write_access True, if the user must be asked for the permission to the bot to send them messages //@request_phone_number_access True, if the user must be asked for the permission to share their phone number @@ -3497,7 +3574,7 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 reque //@location Human-readable description of a country and a region from which the authorization is performed, based on the IP address //@match_code_first True, if code matching dialog must be shown first and checkOauthRequestMatchCode must be called before acceptOauthRequest. Otherwise, checkOauthRequestMatchCode must not be called //@match_codes The list of codes to match; may be empty if irrelevant -oauthLinkInfo user_id:int53 url:string domain:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool browser:string platform:string ip_address:string location:string match_code_first:Bool match_codes:vector = OauthLinkInfo; +oauthLinkInfo user_id:int53 url:string domain:string from_app:Bool verified_app_name:string bot_user_id:int53 request_write_access:Bool request_phone_number_access:Bool browser:string platform:string ip_address:string location:string match_code_first:Bool match_codes:vector = OauthLinkInfo; //@description Contains parameters of the application theme @@ -3625,9 +3702,10 @@ forumTopicInfo chat_id:int53 forum_topic_id:int32 name:string icon:forumTopicIco //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic +//@unread_poll_vote_count Number of messages with unread poll votes in the topic //@notification_settings Notification settings for the topic //@draft_message A draft of a message in the topic; may be null if none -forumTopic info:forumTopicInfo last_message:message order:int64 is_pinned: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 draft_message:draftMessage = ForumTopic; +forumTopic info:forumTopicInfo last_message:message order:int64 is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 unread_poll_vote_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic; //@description Describes a list of forum topics //@total_count Approximate total number of forum topics found @@ -3663,7 +3741,7 @@ sharedUser user_id:int53 first_name:string last_name:string username:string phot sharedChat chat_id:int53 title:string username:string photo:photo = SharedChat; -//@class BuiltInTheme @description Describes a built-in theme of an official app +//@class BuiltInTheme @description Describes a built-in theme of an official application //@description Classic light theme builtInThemeClassic = BuiltInTheme; @@ -4066,6 +4144,9 @@ linkPreviewTypePhoto photo:photo = LinkPreviewType; //@description The link is a link to a Telegram Premium gift code linkPreviewTypePremiumGiftCode = LinkPreviewType; +//@description The link is a link to a dialog for creating of a managed bot +linkPreviewTypeRequestManagedBot = LinkPreviewType; + //@description The link is a link to a shareable chat folder linkPreviewTypeShareableChatFolder = LinkPreviewType; @@ -4354,8 +4435,10 @@ inputInvoiceTelegram purpose:TelegramPaymentPurpose = InputInvoice; //@minithumbnail Media minithumbnail; may be null paidMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail = PaidMedia; -//@description The media is a photo @photo The photo -paidMediaPhoto photo:photo = PaidMedia; +//@description The media is a photo +//@photo The photo +//@video The video representing the live photo; may be null if the photo is static +paidMediaPhoto photo:photo video:video = PaidMedia; //@description The media is a video //@video The video @@ -4691,11 +4774,12 @@ messagePaidMedia star_count:int53 media:vector caption:formattedText //@description A photo message //@photo The photo +//@video The video representing the live photo; may be null if the photo is static //@caption Photo caption //@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo //@has_spoiler True, if the photo preview must be covered by a spoiler animation //@is_secret True, if the photo must be blurred and must be shown only while tapped -messagePhoto photo:photo caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; +messagePhoto photo:photo video:video caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; //@description A sticker message @sticker The sticker description @is_premium True, if premium animation of the sticker must be played messageSticker sticker:sticker is_premium:Bool = MessageContent; @@ -4758,8 +4842,12 @@ messageDice initial_state:DiceStickers final_state:DiceStickers emoji:string val //@description A message with a game @game The game description messageGame game:game = MessageContent; -//@description A message with a poll @poll The poll description -messagePoll poll:poll = MessageContent; +//@description A message with a poll +//@poll Information about the poll +//@param_description Description of the poll +//@media Media attached to the poll. Currently, can be only of the types messageAnimation, messageAudio, messageDocument, messageLocation, messagePhoto, messageVenue, or messageVideo without caption +//@can_add_option True, if an option can be added to the poll using addPollOption +messagePoll poll:poll description:formattedText media:MessageContent can_add_option:Bool = MessageContent; //@description A stake dice message. The dice value is randomly generated by the server //@initial_state The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known @@ -4820,6 +4908,18 @@ messageVideoChatEnded duration:int32 = MessageContent; //@description A message with information about an invitation to a video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @user_ids Invited user identifiers messageInviteVideoChatParticipants group_call_id:int32 user_ids:vector = MessageContent; +//@description A message with information about an added poll option +//@poll_message_id Identifier of the message with the poll; can be an identifier of a deleted message or 0 +//@option_id Identifier of the added option in the poll +//@text Text of the option; 1-100 characters; may contain only custom emoji entities +messagePollOptionAdded poll_message_id:int53 option_id:string text:formattedText = MessageContent; + +//@description A message with information about a deleted poll option +//@poll_message_id Identifier of the message with the poll; can be an identifier of a deleted message or 0 +//@option_id Identifier of the deleted option in the poll +//@text Text of the option; 1-100 characters; may contain only custom emoji entities +messagePollOptionDeleted poll_message_id:int53 option_id:string text:formattedText = MessageContent; + //@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group messageBasicGroupChatCreate title:string member_user_ids:vector = MessageContent; @@ -4919,6 +5019,9 @@ messageCustomServiceAction text:string = MessageContent; //@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent; +//@description A bot managed by another bot was created by the user @bot_user_id User identifier of the created bot +messageManagedBotCreated bot_user_id:int53 = MessageContent; + //@description A payment has been sent to a bot or a business account //@invoice_chat_id Identifier of the chat, containing the corresponding invoice message //@invoice_message_id Identifier of the message with the corresponding invoice; may be 0 or an identifier of a deleted message @@ -5274,10 +5377,22 @@ textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType; //@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the link preview of the current message, or in the same places in the replied message textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; -//@description A data and time @unix_time Point in time (Unix timestamp) representing the data and time @formatting_type Date and time formatting type; may be null if none and the original text must not be changed +//@description A date and time @unix_time Point in time (Unix timestamp) representing the date and time @formatting_type Date and time formatting type; may be null if none and the original text must not be changed textEntityTypeDateTime unix_time:int32 formatting_type:DateTimeFormattingType = TextEntityType; +//@class DiffEntityType @description Represents a change of a text + +//@description Addition of some text +diffEntityTypeInsert = DiffEntityType; + +//@description Change of some text @old_text The old text +diffEntityTypeReplace old_text:string = DiffEntityType; + +//@description Removal of some text +diffEntityTypeDelete = DiffEntityType; + + //@description A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size //@thumbnail Thumbnail file to send. Sending thumbnails by file_id is currently not supported //@width Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown @@ -5288,7 +5403,8 @@ inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail; //@class InputPaidMediaType @description Describes type of paid media to sent //@description The media is a photo. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 -inputPaidMediaTypePhoto = InputPaidMediaType; +//@video Video of the live photo; pass null if the photo isn't a live photo +inputPaidMediaTypePhoto video:InputFile = InputPaidMediaType; //@description The media is a video //@cover Cover of the video; pass null to skip cover uploading @@ -5361,7 +5477,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@description A text message //@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, -//-Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//-Code, Pre, PreCode, TextUrl, MentionName, and DateTime entities are allowed to be specified manually //@link_preview_options Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options //@clear_draft True, if the chat message draft must be deleted inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; @@ -5405,6 +5521,7 @@ inputMessagePaidMedia star_count:int53 paid_media:vector caption //@description A photo message //@photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 //@thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats +//@video Video of the live photo; not supported in secret chats; pass null if the photo isn't a live photo //@added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable //@width Photo width //@height Photo height @@ -5412,7 +5529,7 @@ inputMessagePaidMedia star_count:int53 paid_media:vector caption //@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo; not supported in secret chats //@self_destruct_type Photo self-destruct type; pass null if none; private chats only //@has_spoiler True, if the photo preview must be covered by a spoiler animation; not supported in secret chats -inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; +inputMessagePhoto photo:InputFile thumbnail:inputThumbnail video:InputFile added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; //@description A sticker message //@sticker Sticker to be sent @@ -5491,13 +5608,18 @@ inputMessageInvoice invoice:invoice title:string description:string photo_url:st //@description A message with a poll. Polls can't be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat //@question Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users -//@options List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users +//@options List of poll answer options; 2-getOption("poll_answer_count_max") options +//@param_description Poll description; pass null to use an empty description; 0-getOption("message_caption_length_max") characters //@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels +//@allows_multiple_answers True, if multiple answer options can be chosen simultaneously +//@allows_revoting True, if the poll can be answered multiple times +//@shuffle_options True, if poll options must be shown in a fixed random order +//@hide_results_until_closes True, if the poll results will appear only after the poll closes //@type Type of the poll -//@open_period Amount of time the poll will be active after creation, in seconds; for bots only -//@close_date Point in time (Unix timestamp) when the poll will automatically be closed; for bots only +//@open_period Amount of time the poll will be active after creation, in seconds; 0-getOption("poll_open_period_max"); pass 0 if not specified +//@close_date Point in time (Unix timestamp) when the poll will automatically be closed; must be 0-getOption("poll_open_period_max") seconds in the future; pass 0 if not specified //@is_closed True, if the poll needs to be sent already closed; for bots only -inputMessagePoll question:formattedText options:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; +inputMessagePoll question:formattedText options:vector description:formattedText is_anonymous:Bool allows_multiple_answers:Bool allows_revoting:Bool shuffle_options:Bool hide_results_until_closes:Bool type:InputPollType open_period:int32 close_date:int32 is_closed:Bool = InputMessageContent; //@description A stake dice message //@state_hash Hash of the stake dice state. The state hash can be used only if it was received recently enough. Otherwise, a new state must be requested using getStakeDiceState @@ -5566,6 +5688,13 @@ inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool rep //@need_show_statistics True, if message statistics must be available from context menu of the message messageProperties can_add_offer:Bool can_add_tasks:Bool can_be_approved:Bool can_be_copied:Bool can_be_copied_to_secret_chat:Bool can_be_declined:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_paid:Bool can_be_pinned:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_shared_in_story:Bool can_edit_media:Bool can_edit_scheduling_state:Bool can_edit_suggested_post_info:Bool can_get_author:Bool can_get_embedding_code:Bool can_get_link:Bool can_get_media_timestamp_links:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_statistics:Bool can_get_video_advertisements:Bool can_get_viewers:Bool can_mark_tasks_as_done:Bool can_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool has_protected_content_by_current_user:Bool has_protected_content_by_other_user:Bool need_show_statistics:Bool = MessageProperties; +//@description Contains properties of a poll option and describes actions that can be done with the option right now +//@can_be_deleted True, if the option can be deleted using deletePollOption +//@can_be_replied True, if the poll option can be replied in the same chat and forum topic using inputMessageReplyToMessage +//@can_be_replied_in_another_chat True, if the poll option can be replied in another chat or forum topic using inputMessageReplyToExternalMessage +//@can_get_link True, if a link can be generated for the poll option using getMessageLink +pollOptionProperties can_be_deleted:Bool can_be_replied:Bool can_be_replied_in_another_chat:Bool can_get_link:Bool = PollOptionProperties; + //@class SearchMessagesFilter @description Represents a filter for message search results @@ -5584,6 +5713,9 @@ searchMessagesFilterDocument = SearchMessagesFilter; //@description Returns only photo messages searchMessagesFilterPhoto = SearchMessagesFilter; +//@description Returns only poll messages +searchMessagesFilterPoll = SearchMessagesFilter; + //@description Returns only video messages searchMessagesFilterVideo = SearchMessagesFilter; @@ -5608,12 +5740,15 @@ searchMessagesFilterVoiceAndVideoNote = SearchMessagesFilter; //@description Returns only messages with mentions of the current user, or messages that are replies to their messages searchMessagesFilterMention = SearchMessagesFilter; -//@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +//@description Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query or by the sending user searchMessagesFilterUnreadMention = SearchMessagesFilter; -//@description Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user +//@description Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query or by the sending user searchMessagesFilterUnreadReaction = SearchMessagesFilter; +//@description Returns only messages with unread poll votes for the current user. When using this filter the results can't be additionally filtered by a query or by the sending user +searchMessagesFilterUnreadPollVote = SearchMessagesFilter; + //@description Returns only failed to send messages. This filter can be used only if the message database is used searchMessagesFilterFailedToSend = SearchMessagesFilter; @@ -6648,7 +6783,7 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente //@phone_number Phone number of the user //@first_name First name of the user; 1-64 characters //@last_name Last name of the user; 0-64 characters -//@note Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed; +//@note Note to add about the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed; //-pass null to keep the current user's note importedContact phone_number:string first_name:string last_name:string note:formattedText = ImportedContact; @@ -7330,6 +7465,9 @@ premiumLimitTypeStorySuggestedReactionAreaCount = PremiumLimitType; //@description The maximum number of received similar chats premiumLimitTypeSimilarChatCount = PremiumLimitType; +//@description The maximum number of owned bots +premiumLimitTypeOwnedBotCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -7415,6 +7553,9 @@ premiumFeaturePaidMessages = PremiumFeature; //@description The ability to enable content protection in private chats premiumFeatureProtectPrivateChatContent = PremiumFeature; +//@description The ability to compose text with AI +premiumFeatureTextComposition = PremiumFeature; + //@class BusinessFeature @description Describes a feature available to Business user accounts @@ -7533,7 +7674,7 @@ storePaymentPurposePremiumSubscription is_restore:Bool is_upgrade:Bool = StorePa //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@user_id Identifiers of the user which will receive Telegram Premium -//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed storePaymentPurposePremiumGift currency:string amount:int53 user_id:int53 text:formattedText = StorePaymentPurpose; //@description The user boosting a chat by creating Telegram Premium gift codes for other users @@ -7541,7 +7682,7 @@ storePaymentPurposePremiumGift currency:string amount:int53 user_id:int53 text:f //@currency ISO 4217 currency code of the payment currency //@amount Paid amount, in the smallest units of the currency //@user_ids Identifiers of the users which can activate the gift codes -//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed storePaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector text:formattedText = StorePaymentPurpose; //@description The user creating a Telegram Premium giveaway @@ -7592,7 +7733,7 @@ storeTransactionGooglePlay package_name:string store_product_id:string purchase_ //@amount Paid amount, in the smallest units of the currency //@user_id Identifier of the user which will receive Telegram Premium //@month_count Number of months the Telegram Premium subscription will be active for the user -//@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed telegramPaymentPurposePremiumGift currency:string amount:int53 user_id:int53 month_count:int32 text:formattedText = TelegramPaymentPurpose; //@description The user boosting a chat by creating Telegram Premium gift codes for other users @@ -7601,7 +7742,7 @@ telegramPaymentPurposePremiumGift currency:string amount:int53 user_id:int53 mon //@amount Paid amount, in the smallest units of the currency //@user_ids Identifiers of the users which can activate the gift codes //@month_count Number of months the Telegram Premium subscription will be active for the users -//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@text Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 text:formattedText = TelegramPaymentPurpose; //@description The user creating a Telegram Premium giveaway @@ -8052,6 +8193,9 @@ pushMessageContentChecklistTasksAdded task_count:int32 = PushMessageContent; //@description Some tasks from a checklist were marked as done or not done @task_count Number of changed tasks pushMessageContentChecklistTasksDone task_count:int32 = PushMessageContent; +//@description An option was added to a poll @text Text of the option +pushMessageContentPollOptionAdded text:string = PushMessageContent; + //@description A forwarded messages @total_count Number of forwarded messages pushMessageContentMessageForwards total_count:int32 = PushMessageContent; @@ -8816,6 +8960,14 @@ internalLinkTypePublicChat chat_username:string draft_text:string open_profile:B //-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown internalLinkTypeQrCodeAuthentication = InternalLinkType; +//@description The link is a link to a dialog for creating of a managed bot. Call searchPublicChat with the given manager bot username. +//-If the chat is found, the chat is a chat with a bot and the bot has can_manage_bots == true, then show bot creation confirmation dialog +//-with the given suggested_bot_username and suggested_bot_name. If user agrees, call createBot with via_link == true to create the bot +//@manager_bot_username Username of the bot which will manage the new bot +//@suggested_bot_username Suggested username for the bot +//@suggested_bot_name Suggested name for the bot; may be empty if not specified +internalLinkTypeRequestManagedBot manager_bot_username:string suggested_bot_username:string suggested_bot_name:string = InternalLinkType; + //@description The link forces restore of App Store purchases when opened. For official iOS application only internalLinkTypeRestorePurchases = InternalLinkType; @@ -8898,8 +9050,10 @@ messageLink link:string is_public:Bool = MessageLink; //@topic_id Identifier of the specific topic in which the message must be opened, or a topic to open if the message is missing; may be null if none //@message If found, the linked message; may be null //@media_timestamp Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview +//@checklist_task_id Identifier of the checklist task that is linked; 0 if none +//@poll_option_id Identifier of the poll option that is linked; empty if none //@for_album True, if the whole media album to which the message belongs is linked -messageLinkInfo is_public:Bool chat_id:int53 topic_id:MessageTopic message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; +messageLinkInfo is_public:Bool chat_id:int53 topic_id:MessageTopic message:message media_timestamp:int32 checklist_task_id:int32 poll_option_id:string for_album:Bool = MessageLinkInfo; //@description Contains an HTTPS link to boost a chat @link The link @is_public True, if the link will work for non-members of the chat @@ -8934,6 +9088,9 @@ fileTypeAudio = FileType; //@description The file is a document fileTypeDocument = FileType; +//@description The file is a video for a live photo +fileTypeLivePhotoVideo = FileType; + //@description The file is a notification sound fileTypeNotificationSound = FileType; @@ -8955,6 +9112,9 @@ fileTypeSecretThumbnail = FileType; //@description The file is a file from Secure storage used for storing Telegram Passport files fileTypeSecure = FileType; +//@description The file is a seld-destructing video for a live photo in a private chat +fileTypeSelfDestructingLivePhotoVideo = FileType; + //@description The file is a self-destructing photo in a private chat fileTypeSelfDestructingPhoto = FileType; @@ -9249,7 +9409,7 @@ suggestedActionExtendStarSubscriptions = SuggestedAction; suggestedActionCustom name:string title:formattedText description:formattedText url:string = SuggestedAction; //@description Suggests the user to add login email address. Call isLoginEmailAddressRequired, and then setLoginEmailAddress or checkLoginEmailAddressCode to change the login email address -//@can_be_hidden True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the app without setting up the email address +//@can_be_hidden True, if the suggested action can be hidden using hideSuggestedAction. Otherwise, the user must not be able to use the application without setting up the email address suggestedActionSetLoginEmailAddress can_be_hidden:Bool = SuggestedAction; //@description Suggests the user to add a passkey for login using addLoginPasskey @@ -9537,7 +9697,7 @@ point x:double y:double = Point; //@description A straight line to a given point @end_point The end point of the straight line vectorPathCommandLine end_point:point = VectorPathCommand; -//@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve +//@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve vectorPathCommandCubicBezierCurve start_control_point:point end_control_point:point end_point:point = VectorPathCommand; @@ -9746,6 +9906,9 @@ updateChatUnreadMentionCount chat_id:int53 unread_mention_count:int32 = Update; //@description The chat unread_reaction_count has changed @chat_id Chat identifier @unread_reaction_count The number of messages with unread reactions left in the chat updateChatUnreadReactionCount chat_id:int53 unread_reaction_count:int32 = Update; +//@description The chat unread_poll_vote_count has changed @chat_id Chat identifier @unread_poll_vote_count The number of messages with unread poll votes left in the chat +updateChatUnreadPollVoteCount chat_id:int53 unread_poll_vote_count:int32 = Update; + //@description A chat video chat state has changed @chat_id Chat identifier @video_chat New value of video_chat updateChatVideoChat chat_id:int53 video_chat:videoChat = Update; @@ -9825,9 +9988,10 @@ updateForumTopicInfo info:forumTopicInfo = Update; //@last_read_outbox_message_id Identifier of the last read outgoing message //@unread_mention_count Number of unread messages with a mention/reply in the topic //@unread_reaction_count Number of messages with unread reactions in the topic +//@unread_poll_vote_count Number of messages with unread poll votes in the topic //@notification_settings Notification settings for the topic //@draft_message A draft of a message in the topic; may be null if none -updateForumTopic chat_id:int53 forum_topic_id:int32 is_pinned:Bool last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = Update; +updateForumTopic chat_id:int53 forum_topic_id:int32 is_pinned:Bool last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 unread_poll_vote_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = Update; //@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update; @@ -10099,7 +10263,7 @@ updateEmojiChatThemes chat_themes:vector = Update; //@description The list of supported accent colors has changed //@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported -//-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme +//-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the application theme //@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specified order updateAccentColors colors:vector available_accent_color_ids:vector = Update; @@ -10205,6 +10369,9 @@ updateAnimatedEmojiMessageClicked chat_id:int53 message_id:int53 sticker:sticker //@description The parameters of animation search through getOption("animation_search_bot_username") bot has changed @provider Name of the animation search provider @emojis The new list of emojis suggested for searching updateAnimationSearchParameters provider:string emojis:vector = Update; +//@description The styles supported for text composition have changed @styles The new list of supported styles +updateTextCompositionStyles styles:vector = Update; + //@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions updateSuggestedActions added_actions:vector removed_actions:vector = Update; @@ -10306,8 +10473,14 @@ updatePoll poll:poll = 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; +//@option_ids Unique identifiers of answer options, that were chosen by the user +//@option_positions 0-based identifiers of answer options, that were chosen by the user +updatePollAnswer poll_id:int64 voter_id:MessageSender option_ids:vector option_positions:vector = Update; + +//@description A bot that can be managed by the current bot was created or updated; for bots only +//@user_id Identifier of the user who created the bot +//@bot_user_id Identifier of the created managed bot +updateManagedBot user_id:int53 bot_user_id:int53 = Update; //@description User rights changed in a chat; for bots only //@chat_id Chat identifier @@ -10645,6 +10818,7 @@ getMessageLocally chat_id:int53 message_id:int53 = Message; //-the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, //-the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, //-the message with the request to disable content protection for messageChatHasProtectedContentToggled, +//-the message with the poll for messagePollOptionAdded and messagePollOptionDeleted, //-and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist //@chat_id Identifier of the chat the message belongs to //@message_id Identifier of the reply message @@ -10662,6 +10836,12 @@ getMessages chat_id:int53 message_ids:vector = Messages; //@description Returns properties of a message. This is an offline method @chat_id Chat identifier @message_id Identifier of the message getMessageProperties chat_id:int53 message_id:int53 = MessageProperties; +//@description Returns properties of a poll option. This is an offline method +//@chat_id Chat identifier +//@message_id Identifier of the message +//@poll_option_id Unique identifier of the answer option, which properties will be returned +getPollOptionProperties chat_id:int53 message_id:int53 poll_option_id:string = PollOptionProperties; + //@description Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message getMessageThread chat_id:int53 message_id:int53 = MessageThreadInfo; @@ -10947,7 +11127,8 @@ searchChatMessages chat_id:int53 topic_id:MessageTopic query:string sender_id:Me //@query Query to search for //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function +//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, +//-searchMessagesFilterUnreadPollVote, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function //@chat_type_filter Additional filter for type of the chat of the searched messages; pass null to search for messages in all chats //@min_date If not 0, the minimum date of the messages to return //@max_date If not 0, the maximum date of the messages to return @@ -11043,7 +11224,8 @@ getChatMessageByDate chat_id:int53 date:int32 = Message; //@description Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). //-Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database //@chat_id Identifier of the chat in which to return information about message positions -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, +//-and searchMessagesFilterUnreadPollVote are unsupported in this function //@from_message_id The message identifier from which to return information about message positions //@limit The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages //@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages, or for chats other than Saved Messages @@ -11052,7 +11234,8 @@ getChatSparseMessagePositions chat_id:int53 filter:SearchMessagesFilter from_mes //@description Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset" //@chat_id Identifier of the chat in which to return information about messages //@topic_id Pass topic identifier to get the result only in specific topic; pass null to get the result in all topics; forum topics and message threads aren't supported -//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function +//@filter Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, +//-and searchMessagesFilterUnreadPollVote are unsupported in this function //@from_message_id The message identifier from which to return information about messages; use 0 to get results from the last message getChatMessageCalendar chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFilter from_message_id:int53 = MessageCalendar; @@ -11066,7 +11249,8 @@ getChatMessageCount chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFil //@description Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat and topic. Cannot be used in secret chats //@chat_id Identifier of the chat in which to find message position //@topic_id Pass topic identifier to get position among messages only in specific topic; pass null to get position among all chat messages; message threads aren't supported -//@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function +//@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterUnreadPollVote, +//-and searchMessagesFilterFailedToSend are unsupported in this function //@message_id Message identifier getChatMessagePosition chat_id:int53 topic_id:MessageTopic filter:SearchMessagesFilter message_id:int53 = Count; @@ -11131,9 +11315,11 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message //@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note/story playing must start, in seconds. The media can be in the message content or in its link preview +//@checklist_task_id If not 0, identifier of the checklist task in the message to be linked +//@poll_option_id If not empty, identifier of the poll option in the message to be linked //@for_album Pass true to create a link for the whole media album //@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic -getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink; +getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 checklist_task_id:int32 poll_option_id:string for_album:Bool in_message_thread:Bool = MessageLink; //@description Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code //@chat_id Identifier of the chat to which the message belongs @@ -11145,26 +11331,40 @@ getMessageEmbeddingCode chat_id:int53 message_id:int53 for_album:Bool = Text; getMessageLinkInfo url:string = MessageLinkInfo; -//@description Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +//@description Translates a text to the given language; must not be used in secret chats. If the current user is a Telegram Premium user, then text formatting is preserved //@text Text to translate //@to_language_code Language code of the language to which the message is translated. Must be one of //-"af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", //-"fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko", //-"ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", //-"st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu" -translateText text:formattedText to_language_code:string = FormattedText; +//@tone Tone of the translation; must be one of "", "formal", "neutral", "casual"; defaults to "neutral" +translateText text:formattedText to_language_code:string tone:string = FormattedText; -//@description Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved +//@description Extracts text or caption of the given message and translates it to the given language; must not be used in secret chats. If the current user is a Telegram Premium user, then text formatting is preserved //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message //@to_language_code Language code of the language to which the message is translated. See translateText.to_language_code for the list of supported values -translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; +//@tone Tone of the translation; see translateText.tone for the list of supported values +translateMessageText chat_id:int53 message_id:int53 to_language_code:string tone:string = FormattedText; //@description Summarizes content of the message with non-empty summary_language_code //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message -//@translate_to_language_code Pass a language code to which the summary will be translated; may be empty if translation isn't needed. See translateText.to_language_code for the list of supported values -summarizeMessage chat_id:int53 message_id:int53 translate_to_language_code:string = FormattedText; +//@translate_to_language_code Pass a language code to which the summary will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values +//@tone Tone of the summarization; see translateText.tone for the list of supported values +summarizeMessage chat_id:int53 message_id:int53 translate_to_language_code:string tone:string = FormattedText; + +//@description Changes text using an AI model; must not be used in secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +//@text The original text +//@translate_to_language_code Pass a language code to which the text will be translated; pass an empty string if translation isn't needed. See translateText.to_language_code for the list of supported values +//@style_name Name of the style of the resulted text; handle updateTextCompositionStyles to get the list of supported styles; pass an empty string to keep the current style of the text +//@add_emojis Pass true to add emoji to the text +composeTextWithAi text:formattedText translate_to_language_code:string style_name:string add_emojis:Bool = FormattedText; + +//@description Fixes text using an AI model; must not be used in secret chats. May return an error with a message "AICOMPOSE_FLOOD_PREMIUM" if Telegram Premium is required to send further requests +//@text The original text +fixTextWithAi text:formattedText = FixedText; //@description Recognizes speech in a video note or a voice note message //@chat_id Identifier of the chat to which the message belongs @@ -11667,6 +11867,11 @@ readAllForumTopicMentions chat_id:int53 forum_topic_id:int32 = Ok; //@forum_topic_id Forum topic identifier in which reactions are marked as read readAllForumTopicReactions chat_id:int53 forum_topic_id:int32 = Ok; +//@description Marks all poll votes in a topic in a forum supergroup chat as read +//@chat_id Chat identifier +//@forum_topic_id Forum topic identifier in which poll votes are marked as read +readAllForumTopicPollVotes chat_id:int53 forum_topic_id:int32 = Ok; + //@description Removes all pinned messages from a topic in a forum supergroup chat or a chat with a bot with topics; requires can_pin_messages member right in the supergroup //@chat_id Identifier of the chat //@forum_topic_id Forum topic identifier in which messages will be unpinned @@ -11777,8 +11982,8 @@ searchQuote text:formattedText quote:formattedText quote_position:int32 = FoundP //@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, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl -//-and MentionName entities from a marked-up text. Can be called synchronously +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl, +//-MentionName, and DateTime entities from a marked-up text. Can be called synchronously //@text The text to parse //@parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; @@ -11819,13 +12024,26 @@ getJsonString json_value:JsonValue = Text; getThemeParametersJsonString theme:themeParameters = Text; -//@description Changes the user answer to a poll. A poll in quiz mode can be answered only once +//@description Adds an option to a poll +//@chat_id Identifier of the chat to which the poll belongs +//@message_id Identifier of the message containing the poll. Use messagePoll.can_add_option to check whether an option can be added +//@option The new option +addPollOption chat_id:int53 message_id:int53 option:inputPollOption = Ok; + +//@description Adds an option to a poll +//@chat_id Identifier of the chat to which the poll belongs +//@message_id Identifier of the message containing the poll +//@option_id Unique identifier of the option. Use pollOptionProperties.can_be_deleted to check whether the option can be deleted by the user +deletePollOption chat_id:int53 message_id:int53 option_id:string = Ok; + +//@description Changes the user answer to a poll //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@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 message senders 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 poll; use poll.can_get_voters to check whether the method can be used. +//-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 @@ -11881,22 +12099,20 @@ getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bo //@description Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot -//@chat_id Identifier of the chat with the bot -//@message_id Identifier of the message with the button +//@source Source of the button //@button_id Identifier of the button //@shared_user_ids Identifiers of the shared users //@only_check Pass true to check that the users can be shared by the button instead of actually sharing them -shareUsersWithBot chat_id:int53 message_id:int53 button_id:int32 shared_user_ids:vector only_check:Bool = Ok; +shareUsersWithBot source:KeyboardButtonSource button_id:int32 shared_user_ids:vector only_check:Bool = Ok; //@description Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot -//@chat_id Identifier of the chat with the bot -//@message_id Identifier of the message with the button +//@source Source of the button //@button_id Identifier of the button //@shared_chat_id Identifier of the shared chat //@only_check Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions. //-If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat. //-If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights -shareChatWithBot chat_id:int53 message_id:int53 button_id:int32 shared_chat_id:int53 only_check:Bool = Ok; +shareChatWithBot source:KeyboardButtonSource button_id:int32 shared_chat_id:int53 only_check:Bool = Ok; //@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 @@ -11927,6 +12143,16 @@ savePreparedInlineMessage user_id:int53 result:InputInlineQueryResult chat_types //@prepared_message_id Identifier of the prepared message getPreparedInlineMessage bot_user_id:int53 prepared_message_id:string = PreparedInlineMessage; +//@description Saves a keyboard button to be shown to the given user; for bots only +//@user_id Identifier of the user +//@button The button; must be of the type keyboardButtonTypeRequestUsers, keyboardButtonTypeRequestChat, or keyboardButtonTypeRequestManagedBot +savePreparedKeyboardButton user_id:int53 button:keyboardButton = Text; + +//@description Returns a keyboard button prepared by the bot for the user. The button will be of the type keyboardButtonTypeRequestUsers, keyboardButtonTypeRequestChat, or keyboardButtonTypeRequestManagedBot +//@bot_user_id Identifier of the bot that created the button +//@prepared_button_id Identifier of the prepared button +getPreparedKeyboardButton bot_user_id:int53 prepared_button_id:string = KeyboardButton; + //@description Returns the most grossing Web App bots //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -12084,6 +12310,21 @@ openMessageContent chat_id:int53 message_id:int53 = Ok; //@description Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played @chat_id Chat identifier of the message @message_id Identifier of the clicked message clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker; +//@description Informs TDLib that an audio was listened by the user +//@audio_file_id Identifier of the file with an audio +//@duration Duration of the listening to the audio, in seconds +listenToAudio audio_file_id:int32 duration:int32 = Ok; + +//@description Informs TDLib about details of a message view by the user from a chat, a message thread or a forum topic history. The method must be called if +//-the message wasn't seen for more than 300 milliseconds, the viewport was destroyed, or the total view duration exceeded 5 minutes +//@chat_id Chat identifier +//@message_id The identifier of the message being viewed +//@time_in_view_ms The amount of time the message was seen by at least 1 pixel; in milliseconds +//@active_time_in_view_ms The amount of time the message was seen by at least 1 pixel within 15 seconds after any action from the user; in milliseconds +//@height_to_viewport_ratio_per_mille The ratio of the post height to the viewport height in 1/1000 fractions +//@seen_range_ratio_per_mille The ratio of the viewed post height to the full post height in 1/1000 fractions; 0-1000 +sendMessageViewMetrics chat_id:int53 message_id:int53 time_in_view_ms:int32 active_time_in_view_ms:int32 height_to_viewport_ratio_per_mille:int32 seen_range_ratio_per_mille:int32 = Ok; + //@description Returns an HTTPS or a tg: link with the given type. Can be called before authorization @type Expected type of the link @is_http Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link getInternalLink type:InternalLinkType is_http:Bool = HttpUrl; @@ -12129,6 +12370,9 @@ readAllChatMentions chat_id:int53 = Ok; //@description Marks all reactions in a chat as read @chat_id Chat identifier readAllChatReactions chat_id:int53 = Ok; +//@description Marks all poll votes in a chat as read @chat_id Chat identifier +readAllChatPollVotes chat_id:int53 = Ok; + //@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createPrivateChat user_id:int53 force:Bool = Chat; @@ -12900,7 +13144,7 @@ getMessageFileType message_file_head:string = MessageFileType; //@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right getMessageImportConfirmationText chat_id:int53 = Text; -//@description Imports messages exported from another app +//@description Imports messages exported from another application //@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info member right //@message_file File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded //@attached_files Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded @@ -13157,7 +13401,7 @@ setLiveStoryMessageSender group_call_id:int32 message_sender_id:MessageSender = //@description Sends a message to other participants of a group call. Requires groupCall.can_send_messages right //@group_call_id Group call identifier //@text Text of the message to send; 1-getOption("group_call_message_text_length_max") characters for non-live-stories; see updateGroupCallMessageLevels for live story restrictions, -//-which depends on paid_message_star_count. Can't contain line feeds for live stories +//-which depends on paid_message_star_count. Can't contain line feeds for live stories. Can contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities for live stories //@paid_message_star_count The number of Telegram Stars the user agreed to pay to send the message; for live stories only; 0-getOption("paid_group_call_message_star_count_max"). //-Must be 0 for messages sent to live stories posted by the current user sendGroupCallMessage group_call_id:int32 text:formattedText paid_message_star_count:int53 = Ok; @@ -13371,7 +13615,7 @@ setUserPersonalProfilePhoto user_id:int53 photo:InputChatPhoto = Ok; //@description Changes a note of a contact user //@user_id User identifier -//@note Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@note Note to set for the user; 0-getOption("user_note_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed setUserNote user_id:int53 note:formattedText = Ok; //@description Suggests a profile photo to another regular user with common messages and allowing non-paid messages @@ -13830,6 +14074,23 @@ reorderBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector = Ok; +//@description Checks whether a username can be set for a new bot. Use checkChatUsername to check username for other chat types +//@username Username to be checked +checkBotUsername username:string = CheckChatUsernameResult; + +//@description Creates a bot which will be managed by another bot. Returns the created bot. May return an error with a message "BOT_CREATE_LIMIT_EXCEEDED" +//-if the user already owns the maximum allowed number of bots as per premiumLimitTypeOwnedBotCount. An internal link "https://t.me/BotFather?start=deletebot" can be processed to handle the error +//@manager_bot_user_id Identifier of the bot that will manage the created bot +//@name Name of the bot; 1-64 characters +//@username Username of the bot. The username must end with "bot". Use checkBotUsername to find whether the name is suitable +//@via_link Pass true if the bot is created from an internalLinkTypeRequestManagedBot link +createBot manager_bot_user_id:int53 name:string username:string via_link:Bool = User; + +//@description Returns token of a created bot; for bots only +//@bot_user_id Identifier of the created bot +//@revoke Pass true to revoke the current token and create a new one +getBotToken bot_user_id:int53 revoke:Bool = Text; + //@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 @@ -14091,7 +14352,7 @@ canSendGift gift_id:int64 = CanSendGiftResult; //@description Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out //@gift_id Identifier of the gift to send //@owner_id Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats -//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. +//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. //-Must be empty if the receiver enabled paid messages //@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them //@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free @@ -14113,7 +14374,7 @@ closeGiftAuction gift_id:int64 = Ok; //@gift_id Identifier of the gift to place the bid on //@star_count The number of Telegram Stars to place in the bid //@user_id Identifier of the user who will receive the gift -//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. +//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. //-Must be empty if the receiver enabled paid messages //@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them placeGiftAuctionBid gift_id:int64 star_count:int53 user_id:int53 text:formattedText is_private:Bool = Ok; @@ -14253,11 +14514,12 @@ setGiftResalePrice received_gift_id:string price:GiftResalePrice = Ok; //@gift_id Identifier of the regular gift that was upgraded to a unique gift //@order Order in which the results will be sorted //@for_crafting Pass true to get only gifts suitable for crafting +//@for_stars Pass true to get only gifts that can be bought using Telegram Stars //@attributes Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. //-If none attributes of specific type are specified, then all values for this attribute type are allowed //@offset Offset of the first entry to return as received from the previous request with the same order and attributes; use empty string to get the first chunk of results //@limit The maximum number of gifts to return -searchGiftsForResale gift_id:int64 order:GiftForResaleOrder for_crafting:Bool attributes:vector offset:string limit:int32 = GiftsForResale; +searchGiftsForResale gift_id:int64 order:GiftForResaleOrder for_crafting:Bool for_stars:Bool attributes:vector offset:string limit:int32 = GiftsForResale; //@description Returns collections of gifts owned by the given user or chat @@ -14804,7 +15066,7 @@ applyPremiumGiftCode code:string = Ok; //@user_id Identifier of the user which will receive Telegram Premium //@star_count The number of Telegram Stars to pay for subscription //@month_count Number of months the Telegram Premium subscription will be active for the user -//@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed +//@text Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed giftPremiumWithStars user_id:int53 star_count:int53 month_count:int32 text:formattedText = Ok; //@description Launches a prepaid giveaway