diff --git a/client/function.go b/client/function.go index 356fb63..ea870e2 100755 --- a/client/function.go +++ b/client/function.go @@ -1471,6 +1471,35 @@ func (client *Client) GetMessages(req *GetMessagesRequest) (*Messages, error) { return UnmarshalMessages(result.Data) } +type GetMessagePropertiesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` +} + +// Returns properties of a message; this is an offline request +func (client *Client) GetMessageProperties(req *GetMessagePropertiesRequest) (*MessageProperties, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessageProperties", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMessageProperties(result.Data) +} + type GetMessageThreadRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -1478,7 +1507,7 @@ type GetMessageThreadRequest struct { MessageId int64 `json:"message_id"` } -// Returns information about a message thread. Can be used only if message.can_get_message_thread == true +// Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true func (client *Client) GetMessageThread(req *GetMessageThreadRequest) (*MessageThreadInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -1507,7 +1536,7 @@ type GetMessageReadDateRequest struct { MessageId int64 `json:"message_id"` } -// Returns read date of a recent outgoing message in a private chat. The method can be called if message.can_get_read_date == true and the message is read +// Returns read date of a recent outgoing message in a private chat. The method can be called if messageProperties.can_get_read_date == true func (client *Client) GetMessageReadDate(req *GetMessageReadDateRequest) (MessageReadDate, error) { result, err := client.Send(Request{ meta: meta{ @@ -1554,7 +1583,7 @@ type GetMessageViewersRequest struct { MessageId int64 `json:"message_id"` } -// Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true +// Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers == true func (client *Client) GetMessageViewers(req *GetMessageViewersRequest) (*MessageViewers, error) { result, err := client.Send(Request{ meta: meta{ @@ -2308,7 +2337,7 @@ type GetSavedMessagesTopicHistoryRequest struct { Limit int32 `json:"limit"` } -// Returns messages in a Saved Messages topic. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +// Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) func (client *Client) GetSavedMessagesTopicHistory(req *GetSavedMessagesTopicHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -2519,7 +2548,7 @@ type GetChatHistoryRequest struct { OnlyLocal bool `json:"only_local"` } -// Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true +// Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true func (client *Client) GetChatHistory(req *GetChatHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -2557,7 +2586,7 @@ type GetMessageThreadHistoryRequest struct { Limit int32 `json:"limit"` } -// Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +// Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib func (client *Client) GetMessageThreadHistory(req *GetMessageThreadHistoryRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3343,7 +3372,7 @@ type GetChatScheduledMessagesRequest struct { ChatId int64 `json:"chat_id"` } -// Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +// Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequest) (*Messages, error) { result, err := client.Send(Request{ meta: meta{ @@ -3532,7 +3561,7 @@ type GetMessageLinkRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the message 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 web page preview + // 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"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` @@ -3540,7 +3569,7 @@ type GetMessageLinkRequest struct { InMessageThread bool `json:"in_message_thread"` } -// Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request +// Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request func (client *Client) GetMessageLink(req *GetMessageLinkRequest) (*MessageLink, error) { result, err := client.Send(Request{ meta: meta{ @@ -3574,7 +3603,7 @@ type GetMessageEmbeddingCodeRequest struct { ForAlbum bool `json:"for_album"` } -// Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username +// Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code func (client *Client) GetMessageEmbeddingCode(req *GetMessageEmbeddingCodeRequest) (*Text, error) { result, err := client.Send(Request{ meta: meta{ @@ -3687,11 +3716,11 @@ func (client *Client) TranslateMessageText(req *TranslateMessageTextRequest) (*F type RecognizeSpeechRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable MessageId int64 `json:"message_id"` } -// Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat +// Recognizes speech in a video note or a voice note message func (client *Client) RecognizeSpeech(req *RecognizeSpeechRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -3962,7 +3991,7 @@ type ForwardMessagesRequest struct { MessageThreadId int64 `json:"message_thread_id"` // Identifier of the chat from which to forward messages FromChatId int64 `json:"from_chat_id"` - // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded + // Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -4130,7 +4159,7 @@ func (client *Client) AddLocalMessage(req *AddLocalMessageRequest) (*Message, er type DeleteMessagesRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of the messages to be deleted + // Identifiers of the messages to be deleted. Use messageProperties.can_be_deleted_only_for_self and messageProperties.can_be_deleted_for_all_users to get suitable messages MessageIds []int64 `json:"message_ids"` // Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats Revoke bool `json:"revoke"` @@ -4226,7 +4255,7 @@ func (client *Client) DeleteChatMessagesByDate(req *DeleteChatMessagesByDateRequ type EditMessageTextRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` @@ -4234,7 +4263,7 @@ type EditMessageTextRequest struct { InputMessageContent InputMessageContent `json:"input_message_content"` } -// Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +// Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageText(req *EditMessageTextRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4261,7 +4290,7 @@ func (client *Client) EditMessageText(req *EditMessageTextRequest) (*Message, er type EditMessageLiveLocationRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` @@ -4275,7 +4304,7 @@ type EditMessageLiveLocationRequest struct { ProximityAlertRadius int32 `json:"proximity_alert_radius"` } -// Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +// Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4305,7 +4334,7 @@ func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationReques type EditMessageMediaRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` @@ -4313,7 +4342,7 @@ type EditMessageMediaRequest struct { InputMessageContent InputMessageContent `json:"input_message_content"` } -// Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +// Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageMedia(req *EditMessageMediaRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4340,7 +4369,7 @@ func (client *Client) EditMessageMedia(req *EditMessageMediaRequest) (*Message, type EditMessageCaptionRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` @@ -4350,7 +4379,7 @@ type EditMessageCaptionRequest struct { ShowCaptionAboveMedia bool `json:"show_caption_above_media"` } -// Edits the message content caption. Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +// Edits the message content caption. Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageCaption(req *EditMessageCaptionRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4378,13 +4407,13 @@ func (client *Client) EditMessageCaption(req *EditMessageCaptionRequest) (*Messa type EditMessageReplyMarkupRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none ReplyMarkup ReplyMarkup `json:"reply_markup"` } -// Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +// Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side func (client *Client) EditMessageReplyMarkup(req *EditMessageReplyMarkupRequest) (*Message, error) { result, err := client.Send(Request{ meta: meta{ @@ -4579,7 +4608,7 @@ func (client *Client) EditInlineMessageReplyMarkup(req *EditInlineMessageReplyMa type EditMessageSchedulingStateRequest struct { // The chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable MessageId int64 `json:"message_id"` // The new message scheduling state; pass null to send the message immediately SchedulingState MessageSchedulingState `json:"scheduling_state"` @@ -4611,13 +4640,13 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState type SetMessageFactCheckRequest struct { // The channel chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message. The message must be one of the following types: messageAnimation, messageAudio, messageDocument, messagePhoto, messageText, messageVideo + // Identifier of the message MessageId int64 `json:"message_id"` // New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported Text *FormattedText `json:"text"` } -// Changes the fact-check of a message. Can be only used if getOption("can_edit_fact_check") == true +// Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true func (client *Client) SetMessageFactCheck(req *SetMessageFactCheckRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -4965,6 +4994,41 @@ func (client *Client) StopBusinessPoll(req *StopBusinessPollRequest) (*BusinessM return UnmarshalBusinessMessage(result.Data) } +type SetBusinessMessageIsPinnedRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // Pass true to pin the message, pass false to unpin it + IsPinned bool `json:"is_pinned"` +} + +// Pins or unpins a message sent on behalf of a business account; for bots only +func (client *Client) SetBusinessMessageIsPinned(req *SetBusinessMessageIsPinnedRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setBusinessMessageIsPinned", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "is_pinned": req.IsPinned, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type CheckQuickReplyShortcutNameRequest struct { // The name of the shortcut; 1-32 characters Name string `json:"name"` @@ -5889,7 +5953,7 @@ func (client *Client) SetMessageReactions(req *SetMessageReactionsRequest) (*Ok, type GetMessageAddedReactionsRequest struct { // Identifier of the chat to which the message belongs ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. Use messageProperties.can_get_added_reactions to check whether added reactions can be received for the message MessageId int64 `json:"message_id"` // Type of the reactions to return; pass null to return all added reactions ReactionType ReactionType `json:"reaction_type"` @@ -6558,13 +6622,13 @@ func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders, type StopPollRequest struct { // Identifier of the chat to which the poll belongs ChatId int64 `json:"chat_id"` - // Identifier of the message containing the poll + // Identifier of the message containing the poll. Use messageProperties.can_be_edited to check whether the poll can be stopped MessageId int64 `json:"message_id"` // The new message reply markup; pass null if none; for bots only ReplyMarkup ReplyMarkup `json:"reply_markup"` } -// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set +// Stops a poll func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -6661,7 +6725,7 @@ func (client *Client) GetBusinessConnection(req *GetBusinessConnectionRequest) ( type GetLoginUrlInfoRequest struct { // Chat identifier of the message with the button ChatId int64 `json:"chat_id"` - // Message identifier of the message with the button + // Message identifier of the message with the button. The message must not be scheduled MessageId int64 `json:"message_id"` // Button identifier ButtonId int64 `json:"button_id"` @@ -6889,6 +6953,35 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err return UnmarshalOk(result.Data) } +type GetPopularWebAppBotsRequest struct { + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of bots to be returned; up to 100 + Limit int32 `json:"limit"` +} + +// Returns popular Web App bots +func (client *Client) GetPopularWebAppBots(req *GetPopularWebAppBotsRequest) (*FoundUsers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPopularWebAppBots", + }, + Data: map[string]interface{}{ + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundUsers(result.Data) +} + type SearchWebAppRequest struct { // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` @@ -6929,7 +7022,7 @@ type GetWebAppLinkUrlRequest struct { StartParameter string `json:"start_parameter"` // Preferred Web App theme; pass null to use the default theme Theme *ThemeParameters `json:"theme"` - // Short name of the application; 0-64 English letters, digits, and underscores + // Short name of the current application; 0-64 English letters, digits, and underscores ApplicationName string `json:"application_name"` // Pass true if the current user allowed the bot to send them messages AllowWriteAccess bool `json:"allow_write_access"` @@ -6962,18 +7055,56 @@ func (client *Client) GetWebAppLinkUrl(req *GetWebAppLinkUrlRequest) (*HttpUrl, return UnmarshalHttpUrl(result.Data) } -type GetWebAppUrlRequest struct { +type GetMainWebAppRequest struct { + // Identifier of the chat in which the Web App is opened; pass 0 if none + ChatId int64 `json:"chat_id"` // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` - // The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu - Url string `json:"url"` + // Start parameter from internalLinkTypeMainWebApp + StartParameter string `json:"start_parameter"` // Preferred Web App theme; pass null to use the default theme Theme *ThemeParameters `json:"theme"` - // Short name of the application; 0-64 English letters, digits, and underscores + // Short name of the current application; 0-64 English letters, digits, and underscores ApplicationName string `json:"application_name"` } -// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link +// Returns information needed to open the main Web App of a bot +func (client *Client) GetMainWebApp(req *GetMainWebAppRequest) (*MainWebApp, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMainWebApp", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "bot_user_id": req.BotUserId, + "start_parameter": req.StartParameter, + "theme": req.Theme, + "application_name": req.ApplicationName, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalMainWebApp(result.Data) +} + +type GetWebAppUrlRequest struct { + // Identifier of the target bot + BotUserId int64 `json:"bot_user_id"` + // The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, or an empty string when the bot is opened from the side menu + Url string `json:"url"` + // Preferred Web App theme; pass null to use the default theme + Theme *ThemeParameters `json:"theme"` + // Short name of the current application; 0-64 English letters, digits, and underscores + ApplicationName string `json:"application_name"` +} + +// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -7038,7 +7169,7 @@ type OpenWebAppRequest struct { Url string `json:"url"` // Preferred Web App theme; pass null to use the default theme Theme *ThemeParameters `json:"theme"` - // Short name of the application; 0-64 English letters, digits, and underscores + // Short name of the current application; 0-64 English letters, digits, and underscores ApplicationName string `json:"application_name"` // If not 0, the message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` @@ -7131,7 +7262,7 @@ func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWeb type GetCallbackQueryAnswerRequest struct { // Identifier of the chat with the message ChatId int64 `json:"chat_id"` - // Identifier of the message from which the query originated + // Identifier of the message from which the query originated. The message must not be scheduled MessageId int64 `json:"message_id"` // Query payload Payload CallbackQueryPayload `json:"payload"` @@ -7721,6 +7852,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(result.Data) + case TypeInternalLinkTypeMainWebApp: + return UnmarshalInternalLinkTypeMainWebApp(result.Data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(result.Data) @@ -7760,9 +7894,6 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(result.Data) - case TypeInternalLinkTypeSideMenuBot: - return UnmarshalInternalLinkTypeSideMenuBot(result.Data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(result.Data) @@ -7803,7 +7934,7 @@ type GetExternalLinkInfoRequest struct { Link string `json:"link"` } -// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats +// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats func (client *Client) GetExternalLinkInfo(req *GetExternalLinkInfoRequest) (LoginUrlInfo, error) { result, err := client.Send(Request{ meta: meta{ @@ -9534,7 +9665,7 @@ type PinChatMessageRequest struct { OnlyForSelf bool `json:"only_for_self"` } -// Pins a message in a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel +// Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned func (client *Client) PinChatMessage(req *PinChatMessageRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -10317,6 +10448,32 @@ func (client *Client) ReadChatList(req *ReadChatListRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type GetCurrentWeatherRequest struct { + // The location + Location *Location `json:"location"` +} + +// Returns the current weather in the given location +func (client *Client) GetCurrentWeather(req *GetCurrentWeatherRequest) (*CurrentWeather, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getCurrentWeather", + }, + Data: map[string]interface{}{ + "location": req.Location, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalCurrentWeather(result.Data) +} + type GetStoryRequest struct { // Identifier of the chat that posted the story StorySenderChatId int64 `json:"story_sender_chat_id"` @@ -10369,7 +10526,7 @@ func (client *Client) GetChatsToSendStories() (*Chats, error) { } type CanSendStoryRequest struct { - // Chat identifier + // Chat identifier. Pass Saved Messages chat identifier when posting a story on behalf of the current user ChatId int64 `json:"chat_id"` } @@ -10416,7 +10573,7 @@ func (client *Client) CanSendStory(req *CanSendStoryRequest) (CanSendStoryResult } type SendStoryRequest struct { - // Identifier of the chat that will post the story + // Identifier of the chat that will post the story. Pass Saved Messages chat identifier when posting a story on behalf of the current user ChatId int64 `json:"chat_id"` // Content of the story Content InputStoryContent `json:"content"` @@ -10428,7 +10585,7 @@ type SendStoryRequest struct { PrivacySettings StoryPrivacySettings `json:"privacy_settings"` // Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise ActivePeriod int32 `json:"active_period"` - // Full identifier of the original story, which content was used to create the story + // Full identifier of the original story, which content was used to create the story; pass null if the story isn't repost of another story FromStoryFullId *StoryFullId `json:"from_story_full_id"` // Pass true to keep the story accessible after expiration IsPostedToChatPage bool `json:"is_posted_to_chat_page"` @@ -10503,6 +10660,38 @@ func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type EditStoryCoverRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Identifier of the story to edit + StoryId int32 `json:"story_id"` + // New timestamp of the frame, which will be used as video thumbnail + CoverFrameTimestamp float64 `json:"cover_frame_timestamp"` +} + +// Changes cover of a video story. Can be called only if story.can_be_edited == true and the story isn't being edited now +func (client *Client) EditStoryCover(req *EditStoryCoverRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editStoryCover", + }, + Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, + "story_id": req.StoryId, + "cover_frame_timestamp": req.CoverFrameTimestamp, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetStoryPrivacySettingsRequest struct { // Identifier of the story StoryId int32 `json:"story_id"` @@ -10702,7 +10891,7 @@ type GetChatPostedToChatPageStoriesRequest struct { Limit int32 `json:"limit"` } -// Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +// Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib func (client *Client) GetChatPostedToChatPageStories(req *GetChatPostedToChatPageStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ @@ -10734,7 +10923,7 @@ type GetChatArchivedStoriesRequest struct { Limit int32 `json:"limit"` } -// Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +// Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ @@ -15262,7 +15451,7 @@ func (client *Client) RemoveRecentHashtag(req *RemoveRecentHashtagRequest) (*Ok, return UnmarshalOk(result.Data) } -type GetWebPagePreviewRequest struct { +type GetLinkPreviewRequest struct { // Message text with formatting Text *FormattedText `json:"text"` // Options to be used for generation of the link preview; pass null to use default link preview options @@ -15270,10 +15459,10 @@ type GetWebPagePreviewRequest struct { } // Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview -func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage, error) { +func (client *Client) GetLinkPreview(req *GetLinkPreviewRequest) (*LinkPreview, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getWebPagePreview", + Type: "getLinkPreview", }, Data: map[string]interface{}{ "text": req.Text, @@ -15288,7 +15477,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage return nil, buildResponseError(result.Data) } - return UnmarshalWebPage(result.Data) + return UnmarshalLinkPreview(result.Data) } type GetWebPageInstantViewRequest struct { @@ -16543,6 +16732,192 @@ func (client *Client) SendWebAppCustomRequest(req *SendWebAppCustomRequestReques return UnmarshalCustomRequestResult(result.Data) } +type GetBotMediaPreviewsRequest struct { + // Identifier of the target bot. The bot must have the main Web App + BotUserId int64 `json:"bot_user_id"` +} + +// Returns the list of media previews of a bot +func (client *Client) GetBotMediaPreviews(req *GetBotMediaPreviewsRequest) (*BotMediaPreviews, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotMediaPreviews", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMediaPreviews(result.Data) +} + +type GetBotMediaPreviewInfoRequest struct { + // Identifier of the target bot. The bot must be owned and must have the main Web App + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code for which to get previews. If empty, then default previews are returned + LanguageCode string `json:"language_code"` +} + +// Returns the list of media previews for the given language and the list of languages for which the bot has dedicated previews +func (client *Client) GetBotMediaPreviewInfo(req *GetBotMediaPreviewInfoRequest) (*BotMediaPreviewInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getBotMediaPreviewInfo", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMediaPreviewInfo(result.Data) +} + +type AddBotMediaPreviewRequest struct { + // Identifier of the target bot. The bot must be owned and must have the main Web App + BotUserId int64 `json:"bot_user_id"` + // A two-letter ISO 639-1 language code for which preview is added. If empty, then the preview will be shown to all users for whose languages there are no dedicated previews. If non-empty, then there must be an official language pack of the same name, which is returned by getLocalizationTargetInfo + LanguageCode string `json:"language_code"` + // Content of the added preview + Content InputStoryContent `json:"content"` +} + +// Adds a new media preview to the beginning of the list of media previews of a bot. Returns the added preview after addition is completed server-side. The total number of previews must not exceed getOption("bot_media_preview_count_max") for the given language +func (client *Client) AddBotMediaPreview(req *AddBotMediaPreviewRequest) (*BotMediaPreview, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "addBotMediaPreview", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "content": req.Content, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMediaPreview(result.Data) +} + +type EditBotMediaPreviewRequest struct { + // Identifier of the target bot. The bot must be owned and must have the main Web App + BotUserId int64 `json:"bot_user_id"` + // Language code of the media preview to edit + LanguageCode string `json:"language_code"` + // File identifier of the media to replace + FileId int32 `json:"file_id"` + // Content of the new preview + Content InputStoryContent `json:"content"` +} + +// Replaces media preview in the list of media previews of a bot. Returns the new preview after edit is completed server-side +func (client *Client) EditBotMediaPreview(req *EditBotMediaPreviewRequest) (*BotMediaPreview, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBotMediaPreview", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "file_id": req.FileId, + "content": req.Content, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBotMediaPreview(result.Data) +} + +type ReorderBotMediaPreviewsRequest struct { + // Identifier of the target bot. The bot must be owned and must have the main Web App + BotUserId int64 `json:"bot_user_id"` + // Language code of the media previews to reorder + LanguageCode string `json:"language_code"` + // File identifiers of the media in the new order + FileIds []int32 `json:"file_ids"` +} + +// Changes order of media previews in the list of media previews of a bot +func (client *Client) ReorderBotMediaPreviews(req *ReorderBotMediaPreviewsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "reorderBotMediaPreviews", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "file_ids": req.FileIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type DeleteBotMediaPreviewsRequest struct { + // Identifier of the target bot. The bot must be owned and must have the main Web App + BotUserId int64 `json:"bot_user_id"` + // Language code of the media previews to delete + LanguageCode string `json:"language_code"` + // File identifiers of the media to delete + FileIds []int32 `json:"file_ids"` +} + +// Delete media previews from the list of media previews of a bot +func (client *Client) DeleteBotMediaPreviews(req *DeleteBotMediaPreviewsRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "deleteBotMediaPreviews", + }, + Data: map[string]interface{}{ + "bot_user_id": req.BotUserId, + "language_code": req.LanguageCode, + "file_ids": req.FileIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetBotNameRequest struct { // Identifier of the target bot BotUserId int64 `json:"bot_user_id"` @@ -17518,7 +17893,7 @@ func (client *Client) ToggleSupergroupIsBroadcastGroup(req *ToggleSupergroupIsBr type ReportSupergroupSpamRequest struct { // Supergroup identifier SupergroupId int64 `json:"supergroup_id"` - // Identifiers of messages to report + // Identifiers of messages to report. Use messageProperties.can_be_reported to check whether the message can be reported MessageIds []int64 `json:"message_ids"` } @@ -17547,7 +17922,7 @@ func (client *Client) ReportSupergroupSpam(req *ReportSupergroupSpamRequest) (*O type ReportSupergroupAntiSpamFalsePositiveRequest struct { // Supergroup identifier SupergroupId int64 `json:"supergroup_id"` - // Identifier of the erroneously deleted message + // Identifier of the erroneously deleted message from chatEventMessageDeleted MessageId int64 `json:"message_id"` } @@ -17764,7 +18139,7 @@ type SendPaymentFormRequest struct { OrderInfoId string `json:"order_info_id"` // Identifier of a chosen shipping option, if applicable ShippingOptionId string `json:"shipping_option_id"` - // The credentials chosen by user for payment; pass null for a payment in Telegram stars + // The credentials chosen by user for payment; pass null for a payment in Telegram Stars Credentials InputCredentials `json:"credentials"` // Chosen by the user amount of tip in the smallest units of the currency TipAmount int64 `json:"tip_amount"` @@ -18904,7 +19279,7 @@ func (client *Client) RemoveChatActionBar(req *RemoveChatActionBarRequest) (*Ok, type ReportChatRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` - // Identifiers of reported messages; may be empty to report the whole chat + // Identifiers of reported messages; may be empty to report the whole chat. Use messageProperties.can_be_reported to check whether the message can be reported MessageIds []int64 `json:"message_ids"` // The reason for reporting the chat Reason ReportReason `json:"reason"` @@ -18980,7 +19355,7 @@ type ReportMessageReactionsRequest struct { SenderId MessageSender `json:"sender_id"` } -// Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions +// Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if messageProperties.can_report_reactions func (client *Client) ReportMessageReactions(req *ReportMessageReactionsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -19094,13 +19469,13 @@ func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactions } type GetStarRevenueStatisticsRequest struct { - // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat + // Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true OwnerId MessageSender `json:"owner_id"` // Pass true if a dark theme is used by the application IsDark bool `json:"is_dark"` } -// Returns detailed Telegram star revenue statistics +// Returns detailed Telegram Star revenue statistics func (client *Client) GetStarRevenueStatistics(req *GetStarRevenueStatisticsRequest) (*StarRevenueStatistics, error) { result, err := client.Send(Request{ meta: meta{ @@ -19123,15 +19498,15 @@ func (client *Client) GetStarRevenueStatistics(req *GetStarRevenueStatisticsRequ } type GetStarWithdrawalUrlRequest struct { - // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat + // Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat OwnerId MessageSender `json:"owner_id"` - // The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") + // The number of Telegram Stars to withdraw. Must be at least getOption("star_withdrawal_count_min") StarCount int64 `json:"star_count"` // The 2-step verification password of the current user Password string `json:"password"` } -// Returns a URL for Telegram star withdrawal +// Returns a URL for Telegram Star withdrawal func (client *Client) GetStarWithdrawalUrl(req *GetStarWithdrawalUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -19155,11 +19530,11 @@ func (client *Client) GetStarWithdrawalUrl(req *GetStarWithdrawalUrlRequest) (*H } type GetStarAdAccountUrlRequest struct { - // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat + // Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat OwnerId MessageSender `json:"owner_id"` } -// Returns a URL for a Telegram Ad platform account that can be used to set up advertisments for the chat paid in the owned Telegram stars +// Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the owned Telegram Stars func (client *Client) GetStarAdAccountUrl(req *GetStarAdAccountUrlRequest) (*HttpUrl, error) { result, err := client.Send(Request{ meta: meta{ @@ -19227,7 +19602,7 @@ type GetMessageStatisticsRequest struct { IsDark bool `json:"is_dark"` } -// Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true +// Returns detailed statistics about a message. Can be used only if messageProperties.can_get_statistics == true func (client *Client) GetMessageStatistics(req *GetMessageStatisticsRequest) (*MessageStatistics, error) { result, err := client.Send(Request{ meta: meta{ @@ -19261,7 +19636,7 @@ type GetMessagePublicForwardsRequest struct { Limit int32 `json:"limit"` } -// Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +// Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if messageProperties.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*PublicForwards, error) { result, err := client.Send(Request{ meta: meta{ @@ -20973,7 +21348,7 @@ func (client *Client) GetPremiumGiveawayInfo(req *GetPremiumGiveawayInfoRequest) } } -// Returns available options for Telegram stars purchase +// Returns available options for Telegram Stars purchase func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { result, err := client.Send(Request{ meta: meta{ @@ -20992,8 +21367,34 @@ func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { return UnmarshalStarPaymentOptions(result.Data) } +type GetStarGiftPaymentOptionsRequest struct { + // Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user + UserId int64 `json:"user_id"` +} + +// Returns available options for Telegram Stars gifting +func (client *Client) GetStarGiftPaymentOptions(req *GetStarGiftPaymentOptionsRequest) (*StarPaymentOptions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStarGiftPaymentOptions", + }, + Data: map[string]interface{}{ + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStarPaymentOptions(result.Data) +} + type GetStarTransactionsRequest struct { - // Identifier of the owner of the Telegram stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true + // Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true OwnerId MessageSender `json:"owner_id"` // Direction of the transactions to receive; pass null to get all transactions Direction StarTransactionDirection `json:"direction"` @@ -21003,7 +21404,7 @@ type GetStarTransactionsRequest struct { Limit int32 `json:"limit"` } -// Returns the list of Telegram star transactions for the specified owner +// Returns the list of Telegram Star transactions for the specified owner func (client *Client) GetStarTransactions(req *GetStarTransactionsRequest) (*StarTransactions, error) { result, err := client.Send(Request{ meta: meta{ diff --git a/client/type.go b/client/type.go index df140c3..23751f9 100755 --- a/client/type.go +++ b/client/type.go @@ -59,6 +59,8 @@ const ( ClassPageBlockHorizontalAlignment = "PageBlockHorizontalAlignment" ClassPageBlockVerticalAlignment = "PageBlockVerticalAlignment" ClassPageBlock = "PageBlock" + ClassLinkPreviewAlbumMedia = "LinkPreviewAlbumMedia" + ClassLinkPreviewType = "LinkPreviewType" ClassCollectibleItemType = "CollectibleItemType" ClassInputCredentials = "InputCredentials" ClassPaymentProvider = "PaymentProvider" @@ -245,6 +247,7 @@ const ( ClassBotInfo = "BotInfo" ClassUserFullInfo = "UserFullInfo" ClassUsers = "Users" + ClassFoundUsers = "FoundUsers" ClassChatAdministrator = "ChatAdministrator" ClassChatAdministrators = "ChatAdministrators" ClassChatMember = "ChatMember" @@ -328,6 +331,7 @@ const ( ClassInlineKeyboardButton = "InlineKeyboardButton" ClassFoundWebApp = "FoundWebApp" ClassWebAppInfo = "WebAppInfo" + ClassMainWebApp = "MainWebApp" ClassMessageThreadInfo = "MessageThreadInfo" ClassSavedMessagesTopic = "SavedMessagesTopic" ClassForumTopicIcon = "ForumTopicIcon" @@ -337,12 +341,13 @@ const ( ClassLinkPreviewOptions = "LinkPreviewOptions" ClassSharedUser = "SharedUser" ClassSharedChat = "SharedChat" + ClassThemeSettings = "ThemeSettings" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" ClassPageBlockRelatedArticle = "PageBlockRelatedArticle" ClassWebPageInstantView = "WebPageInstantView" - ClassWebPage = "WebPage" + ClassLinkPreview = "LinkPreview" ClassCountryInfo = "CountryInfo" ClassCountries = "Countries" ClassPhoneNumberInfo = "PhoneNumberInfo" @@ -383,6 +388,7 @@ const ( ClassInputPaidMedia = "InputPaidMedia" ClassMessageSendOptions = "MessageSendOptions" ClassMessageCopyOptions = "MessageCopyOptions" + ClassMessageProperties = "MessageProperties" ClassEmojiKeyword = "EmojiKeyword" ClassEmojiKeywords = "EmojiKeywords" ClassStickers = "Stickers" @@ -393,6 +399,7 @@ const ( ClassTrendingStickerSets = "TrendingStickerSets" ClassEmojiCategory = "EmojiCategory" ClassEmojiCategories = "EmojiCategories" + ClassCurrentWeather = "CurrentWeather" ClassStoryAreaPosition = "StoryAreaPosition" ClassStoryArea = "StoryArea" ClassInputStoryArea = "InputStoryArea" @@ -412,6 +419,9 @@ const ( ClassQuickReplyMessages = "QuickReplyMessages" ClassQuickReplyShortcut = "QuickReplyShortcut" ClassPublicForwards = "PublicForwards" + ClassBotMediaPreview = "BotMediaPreview" + ClassBotMediaPreviews = "BotMediaPreviews" + ClassBotMediaPreviewInfo = "BotMediaPreviewInfo" ClassChatBoostLevelFeatures = "ChatBoostLevelFeatures" ClassChatBoostFeatures = "ChatBoostFeatures" ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" @@ -467,7 +477,6 @@ const ( ClassBusinessFeaturePromotionAnimation = "BusinessFeaturePromotionAnimation" ClassPremiumState = "PremiumState" ClassPushReceiverId = "PushReceiverId" - ClassThemeSettings = "ThemeSettings" ClassChatTheme = "ChatTheme" ClassTimeZone = "TimeZone" ClassTimeZones = "TimeZones" @@ -695,6 +704,7 @@ const ( TypeStarTransactionPartnerTelegramAds = "starTransactionPartnerTelegramAds" TypeStarTransactionPartnerBot = "starTransactionPartnerBot" TypeStarTransactionPartnerChannel = "starTransactionPartnerChannel" + TypeStarTransactionPartnerUser = "starTransactionPartnerUser" TypeStarTransactionPartnerUnsupported = "starTransactionPartnerUnsupported" TypeStarTransaction = "starTransaction" TypeStarTransactions = "starTransactions" @@ -715,6 +725,7 @@ const ( TypeBotInfo = "botInfo" TypeUserFullInfo = "userFullInfo" TypeUsers = "users" + TypeFoundUsers = "foundUsers" TypeChatAdministrator = "chatAdministrator" TypeChatAdministrators = "chatAdministrators" TypeChatMemberStatusCreator = "chatMemberStatusCreator" @@ -910,6 +921,7 @@ const ( TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation" TypeFoundWebApp = "foundWebApp" TypeWebAppInfo = "webAppInfo" + TypeMainWebApp = "mainWebApp" TypeMessageThreadInfo = "messageThreadInfo" TypeSavedMessagesTopicTypeMyNotes = "savedMessagesTopicTypeMyNotes" TypeSavedMessagesTopicTypeAuthorHidden = "savedMessagesTopicTypeAuthorHidden" @@ -922,6 +934,7 @@ const ( TypeLinkPreviewOptions = "linkPreviewOptions" TypeSharedUser = "sharedUser" TypeSharedChat = "sharedChat" + TypeThemeSettings = "themeSettings" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -979,7 +992,38 @@ const ( TypePageBlockRelatedArticles = "pageBlockRelatedArticles" TypePageBlockMap = "pageBlockMap" TypeWebPageInstantView = "webPageInstantView" - TypeWebPage = "webPage" + TypeLinkPreviewAlbumMediaPhoto = "linkPreviewAlbumMediaPhoto" + TypeLinkPreviewAlbumMediaVideo = "linkPreviewAlbumMediaVideo" + TypeLinkPreviewTypeAlbum = "linkPreviewTypeAlbum" + TypeLinkPreviewTypeAnimation = "linkPreviewTypeAnimation" + TypeLinkPreviewTypeApp = "linkPreviewTypeApp" + TypeLinkPreviewTypeArticle = "linkPreviewTypeArticle" + TypeLinkPreviewTypeAudio = "linkPreviewTypeAudio" + TypeLinkPreviewTypeBackground = "linkPreviewTypeBackground" + TypeLinkPreviewTypeChannelBoost = "linkPreviewTypeChannelBoost" + TypeLinkPreviewTypeChat = "linkPreviewTypeChat" + TypeLinkPreviewTypeDocument = "linkPreviewTypeDocument" + TypeLinkPreviewTypeEmbeddedAnimationPlayer = "linkPreviewTypeEmbeddedAnimationPlayer" + TypeLinkPreviewTypeEmbeddedAudioPlayer = "linkPreviewTypeEmbeddedAudioPlayer" + TypeLinkPreviewTypeEmbeddedVideoPlayer = "linkPreviewTypeEmbeddedVideoPlayer" + TypeLinkPreviewTypeInvoice = "linkPreviewTypeInvoice" + TypeLinkPreviewTypeMessage = "linkPreviewTypeMessage" + TypeLinkPreviewTypePhoto = "linkPreviewTypePhoto" + TypeLinkPreviewTypePremiumGiftCode = "linkPreviewTypePremiumGiftCode" + TypeLinkPreviewTypeShareableChatFolder = "linkPreviewTypeShareableChatFolder" + TypeLinkPreviewTypeSticker = "linkPreviewTypeSticker" + TypeLinkPreviewTypeStickerSet = "linkPreviewTypeStickerSet" + TypeLinkPreviewTypeStory = "linkPreviewTypeStory" + TypeLinkPreviewTypeSupergroupBoost = "linkPreviewTypeSupergroupBoost" + TypeLinkPreviewTypeTheme = "linkPreviewTypeTheme" + TypeLinkPreviewTypeUnsupported = "linkPreviewTypeUnsupported" + TypeLinkPreviewTypeUser = "linkPreviewTypeUser" + TypeLinkPreviewTypeVideo = "linkPreviewTypeVideo" + TypeLinkPreviewTypeVideoChat = "linkPreviewTypeVideoChat" + TypeLinkPreviewTypeVideoNote = "linkPreviewTypeVideoNote" + TypeLinkPreviewTypeVoiceNote = "linkPreviewTypeVoiceNote" + TypeLinkPreviewTypeWebApp = "linkPreviewTypeWebApp" + TypeLinkPreview = "linkPreview" TypeCountryInfo = "countryInfo" TypeCountries = "countries" TypePhoneNumberInfo = "phoneNumberInfo" @@ -1147,12 +1191,14 @@ const ( TypeMessageGameScore = "messageGameScore" TypeMessagePaymentSuccessful = "messagePaymentSuccessful" TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" + TypeMessagePaymentRefunded = "messagePaymentRefunded" TypeMessageGiftedPremium = "messageGiftedPremium" TypeMessagePremiumGiftCode = "messagePremiumGiftCode" TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" TypeMessagePremiumGiveaway = "messagePremiumGiveaway" TypeMessagePremiumGiveawayCompleted = "messagePremiumGiveawayCompleted" TypeMessagePremiumGiveawayWinners = "messagePremiumGiveawayWinners" + TypeMessageGiftedStars = "messageGiftedStars" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageUsersShared = "messageUsersShared" TypeMessageChatShared = "messageChatShared" @@ -1214,6 +1260,7 @@ const ( TypeInputMessagePoll = "inputMessagePoll" TypeInputMessageStory = "inputMessageStory" TypeInputMessageForwarded = "inputMessageForwarded" + TypeMessageProperties = "messageProperties" TypeSearchMessagesFilterEmpty = "searchMessagesFilterEmpty" TypeSearchMessagesFilterAnimation = "searchMessagesFilterAnimation" TypeSearchMessagesFilterAudio = "searchMessagesFilterAudio" @@ -1268,12 +1315,14 @@ const ( TypeEmojiCategoryTypeRegularStickers = "emojiCategoryTypeRegularStickers" TypeEmojiCategoryTypeEmojiStatus = "emojiCategoryTypeEmojiStatus" TypeEmojiCategoryTypeChatPhoto = "emojiCategoryTypeChatPhoto" + TypeCurrentWeather = "currentWeather" TypeStoryAreaPosition = "storyAreaPosition" TypeStoryAreaTypeLocation = "storyAreaTypeLocation" TypeStoryAreaTypeVenue = "storyAreaTypeVenue" TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" TypeStoryAreaTypeMessage = "storyAreaTypeMessage" TypeStoryAreaTypeLink = "storyAreaTypeLink" + TypeStoryAreaTypeWeather = "storyAreaTypeWeather" TypeStoryArea = "storyArea" TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" @@ -1281,6 +1330,7 @@ const ( TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage" TypeInputStoryAreaTypeLink = "inputStoryAreaTypeLink" + TypeInputStoryAreaTypeWeather = "inputStoryAreaTypeWeather" TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" @@ -1312,6 +1362,9 @@ const ( TypePublicForwardMessage = "publicForwardMessage" TypePublicForwardStory = "publicForwardStory" TypePublicForwards = "publicForwards" + TypeBotMediaPreview = "botMediaPreview" + TypeBotMediaPreviews = "botMediaPreviews" + TypeBotMediaPreviewInfo = "botMediaPreviewInfo" TypeChatBoostLevelFeatures = "chatBoostLevelFeatures" TypeChatBoostFeatures = "chatBoostFeatures" TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" @@ -1562,9 +1615,11 @@ const ( TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes" TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway" TypeStorePaymentPurposeStars = "storePaymentPurposeStars" + TypeStorePaymentPurposeGiftedStars = "storePaymentPurposeGiftedStars" TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes" TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway" TypeTelegramPaymentPurposeStars = "telegramPaymentPurposeStars" + TypeTelegramPaymentPurposeGiftedStars = "telegramPaymentPurposeGiftedStars" TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" TypeDeviceTokenApplePush = "deviceTokenApplePush" TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" @@ -1588,7 +1643,6 @@ const ( TypeInputBackgroundLocal = "inputBackgroundLocal" TypeInputBackgroundRemote = "inputBackgroundRemote" TypeInputBackgroundPrevious = "inputBackgroundPrevious" - TypeThemeSettings = "themeSettings" TypeChatTheme = "chatTheme" TypeTimeZone = "timeZone" TypeTimeZones = "timeZones" @@ -1763,6 +1817,7 @@ const ( TypeInternalLinkTypeInvoice = "internalLinkTypeInvoice" TypeInternalLinkTypeLanguagePack = "internalLinkTypeLanguagePack" TypeInternalLinkTypeLanguageSettings = "internalLinkTypeLanguageSettings" + TypeInternalLinkTypeMainWebApp = "internalLinkTypeMainWebApp" TypeInternalLinkTypeMessage = "internalLinkTypeMessage" TypeInternalLinkTypeMessageDraft = "internalLinkTypeMessageDraft" TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" @@ -1776,7 +1831,6 @@ const ( TypeInternalLinkTypeQrCodeAuthentication = "internalLinkTypeQrCodeAuthentication" TypeInternalLinkTypeRestorePurchases = "internalLinkTypeRestorePurchases" TypeInternalLinkTypeSettings = "internalLinkTypeSettings" - TypeInternalLinkTypeSideMenuBot = "internalLinkTypeSideMenuBot" TypeInternalLinkTypeStickerSet = "internalLinkTypeStickerSet" TypeInternalLinkTypeStory = "internalLinkTypeStory" TypeInternalLinkTypeTheme = "internalLinkTypeTheme" @@ -1845,6 +1899,7 @@ const ( TypeTopChatCategoryGroups = "topChatCategoryGroups" TypeTopChatCategoryChannels = "topChatCategoryChannels" TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" + TypeTopChatCategoryWebAppBots = "topChatCategoryWebAppBots" TypeTopChatCategoryCalls = "topChatCategoryCalls" TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" TypeFoundPosition = "foundPosition" @@ -2165,12 +2220,12 @@ type InputChatPhoto interface { InputChatPhotoType() string } -// Describes direction of a transaction with Telegram stars +// Describes direction of a transaction with Telegram Stars type StarTransactionDirection interface { StarTransactionDirectionType() string } -// Describes source or recipient of a transaction with Telegram stars +// Describes source or recipient of a transaction with Telegram Stars type StarTransactionPartner interface { StarTransactionPartnerType() string } @@ -2325,7 +2380,7 @@ type SavedMessagesTopicType interface { SavedMessagesTopicTypeType() string } -// Describes a text object inside an instant-view web page +// Describes a formatted text object type RichText interface { RichTextType() string } @@ -2340,11 +2395,21 @@ type PageBlockVerticalAlignment interface { PageBlockVerticalAlignmentType() string } -// Describes a block of an instant view web page +// Describes a block of an instant view for a web page type PageBlock interface { PageBlockType() string } +// Describes a media from a link preview album +type LinkPreviewAlbumMedia interface { + LinkPreviewAlbumMediaType() string +} + +// Describes type of link preview +type LinkPreviewType interface { + LinkPreviewTypeType() string +} + // Describes a collectible item that can be purchased at https://fragment.com type CollectibleItemType interface { CollectibleItemTypeType() string @@ -2460,12 +2525,12 @@ type EmojiCategoryType interface { EmojiCategoryTypeType() string } -// Describes type of clickable rectangle area on a story media +// Describes type of clickable area on a story media type StoryAreaType interface { StoryAreaTypeType() string } -// Describes type of clickable rectangle area on a story media to be added +// Describes type of clickable area on a story media to be added type InputStoryAreaType interface { InputStoryAreaTypeType() string } @@ -5896,6 +5961,8 @@ type UserTypeBot struct { CanJoinGroups bool `json:"can_join_groups"` // True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages CanReadAllGroupMessages bool `json:"can_read_all_group_messages"` + // True, if the bot has the main Web App + HasMainWebApp bool `json:"has_main_web_app"` // True, if the bot supports inline queries IsInline bool `json:"is_inline"` // Placeholder for inline queries (displayed on the application input field) @@ -5906,6 +5973,8 @@ type UserTypeBot struct { CanConnectToBusiness bool `json:"can_connect_to_business"` // True, if the bot can be added to attachment or side menu CanBeAddedToAttachmentMenu bool `json:"can_be_added_to_attachment_menu"` + // The number of recently active users of the bot + ActiveUserCount int32 `json:"active_user_count"` } func (entity *UserTypeBot) MarshalJSON() ([]byte, error) { @@ -6974,8 +7043,8 @@ type ChatPermissions struct { CanSendGames bool `json:"can_send_games"` // True, if the user can use inline bots. Implies can_send_messages permissions CanUseInlineBots bool `json:"can_use_inline_bots"` - // True, if the user may add a web page preview to their messages - CanAddWebPagePreviews bool `json:"can_add_web_page_previews"` + // True, if the user may add a link preview to their messages + CanAddLinkPreviews bool `json:"can_add_link_previews"` // True, if the user can change the chat title, photo, and other settings CanChangeInfo bool `json:"can_change_info"` // True, if the user can invite new users to the chat @@ -7289,14 +7358,14 @@ func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error return nil } -// Describes an option for buying Telegram stars. Use telegramPaymentPurposeStars for out-of-store payments +// Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments type StarPaymentOption struct { meta // ISO 4217 currency code for the payment Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of Telegram stars that will be purchased + // Number of Telegram Stars that will be purchased StarCount int64 `json:"star_count"` // Identifier of the store product associated with the option; may be empty if none StoreProductId string `json:"store_product_id"` @@ -7320,7 +7389,7 @@ func (*StarPaymentOption) GetType() string { return TypeStarPaymentOption } -// Contains a list of options for buying Telegram stars +// Contains a list of options for buying Telegram Stars type StarPaymentOptions struct { meta // The list of options @@ -7343,7 +7412,7 @@ func (*StarPaymentOptions) GetType() string { return TypeStarPaymentOptions } -// The transaction is incoming and increases the number of owned Telegram stars +// The transaction is incoming and increases the number of owned Telegram Stars type StarTransactionDirectionIncoming struct{ meta } @@ -7368,7 +7437,7 @@ func (*StarTransactionDirectionIncoming) StarTransactionDirectionType() string { return TypeStarTransactionDirectionIncoming } -// The transaction is outgoing and decreases the number of owned Telegram stars +// The transaction is outgoing and decreases the number of owned Telegram Stars type StarTransactionDirectionOutgoing struct{ meta } @@ -7539,8 +7608,8 @@ func (*StarTransactionPartnerTelegramAds) StarTransactionPartnerType() string { // The transaction is a transaction with a bot type StarTransactionPartnerBot struct { meta - // Identifier of the bot - BotUserId int64 `json:"bot_user_id"` + // Identifier of the bot for the user, or the user for the bot + UserId int64 `json:"user_id"` // Information about the bought product; may be null if not applicable ProductInfo *ProductInfo `json:"product_info"` // Invoice payload; for bots only @@ -7619,6 +7688,35 @@ func (starTransactionPartnerChannel *StarTransactionPartnerChannel) UnmarshalJSO return nil } +// The transaction is a gift of Telegram Stars from another user +type StarTransactionPartnerUser struct { + meta + // Identifier of the user; 0 if the gift was anonymous + UserId int64 `json:"user_id"` + // A sticker to be shown in the transaction information; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *StarTransactionPartnerUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionPartnerUser + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionPartnerUser) GetClass() string { + return ClassStarTransactionPartner +} + +func (*StarTransactionPartnerUser) GetType() string { + return TypeStarTransactionPartnerUser +} + +func (*StarTransactionPartnerUser) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerUser +} + // The transaction is a transaction with unknown partner type StarTransactionPartnerUnsupported struct{ meta @@ -7644,12 +7742,12 @@ func (*StarTransactionPartnerUnsupported) StarTransactionPartnerType() string { return TypeStarTransactionPartnerUnsupported } -// Represents a transaction changing the amount of owned Telegram stars +// Represents a transaction changing the amount of owned Telegram Stars type StarTransaction struct { meta // Unique identifier of the transaction Id string `json:"id"` - // The amount of added owned Telegram stars; negative for outgoing transactions + // The amount of added owned Telegram Stars; negative for outgoing transactions StarCount int64 `json:"star_count"` // True, if the transaction is a refund of a previous transaction IsRefund bool `json:"is_refund"` @@ -7700,12 +7798,12 @@ func (starTransaction *StarTransaction) UnmarshalJSON(data []byte) error { return nil } -// Represents a list of Telegram star transactions +// Represents a list of Telegram Star transactions type StarTransactions struct { meta - // The amount of owned Telegram stars + // The amount of owned Telegram Stars StarCount int64 `json:"star_count"` - // List of transactions with Telegram stars + // List of transactions with Telegram Stars Transactions []*StarTransaction `json:"transactions"` // The offset for the next request. If empty, then there are no more results NextOffset string `json:"next_offset"` @@ -8284,6 +8382,8 @@ type BotInfo struct { DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` // Default administrator rights for adding the bot to channels; may be null DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + // True, if the bot has media previews + HasMediaPreviews bool `json:"has_media_previews"` // The internal link, which can be used to edit bot commands; may be null EditCommandsLink InternalLinkType `json:"edit_commands_link"` // The internal link, which can be used to edit bot description; may be null @@ -8320,6 +8420,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { Commands []*BotCommand `json:"commands"` DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"` DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"` + HasMediaPreviews bool `json:"has_media_previews"` EditCommandsLink json.RawMessage `json:"edit_commands_link"` EditDescriptionLink json.RawMessage `json:"edit_description_link"` EditDescriptionMediaLink json.RawMessage `json:"edit_description_media_link"` @@ -8339,6 +8440,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error { botInfo.Commands = tmp.Commands botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights + botInfo.HasMediaPreviews = tmp.HasMediaPreviews fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink) botInfo.EditCommandsLink = fieldEditCommandsLink @@ -8496,6 +8598,31 @@ func (*Users) GetType() string { return TypeUsers } +// Represents a list of found users +type FoundUsers struct { + meta + // Identifiers of the found users + UserIds []int64 `json:"user_ids"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundUsers) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundUsers + + return json.Marshal((*stub)(entity)) +} + +func (*FoundUsers) GetClass() string { + return ClassFoundUsers +} + +func (*FoundUsers) GetType() string { + return TypeFoundUsers +} + // Contains information about a chat administrator type ChatAdministrator struct { meta @@ -9712,7 +9839,7 @@ type Supergroup struct { Date int32 `json:"date"` // Status of the current user in the supergroup or channel; custom title will always be empty Status ChatMemberStatus `json:"status"` - // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards + // Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories MemberCount int32 `json:"member_count"` // Approximate boost level for the chat BoostLevel int32 `json:"boost_level"` @@ -9858,6 +9985,8 @@ type SupergroupFullInfo struct { CanGetStatistics bool `json:"can_get_statistics"` // True, if the supergroup or channel revenue statistics are available CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"` + // True, if the supergroup or channel Telegram Star revenue statistics are available + CanGetStarRevenueStatistics bool `json:"can_get_star_revenue_statistics"` // True, if aggressive anti-spam checks can be enabled or disabled in the supergroup CanToggleAggressiveAntiSpam bool `json:"can_toggle_aggressive_anti_spam"` // True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators @@ -11050,7 +11179,7 @@ type MessageSendingStateFailed struct { meta // The cause of the message sending failure Error *Error `json:"error"` - // True, if the message can be re-sent + // True, if the message can be re-sent using resendMessages or readdQuickReplyShortcutMessages CanRetry bool `json:"can_retry"` // True, if the message can be re-sent only on behalf of a different sender NeedAnotherSender bool `json:"need_another_sender"` @@ -11232,7 +11361,7 @@ func (*MessageReplyToStory) MessageReplyToType() string { // Describes a message to be replied in the same chat and forum topic type InputMessageReplyToMessage struct { meta - // The identifier of the message to be replied in the same chat and forum topic + // 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 MessageId int64 `json:"message_id"` // Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats Quote *InputTextQuote `json:"quote"` @@ -11263,7 +11392,7 @@ type InputMessageReplyToExternalMessage struct { meta // The identifier of the chat to which the message to be replied belongs ChatId int64 `json:"chat_id"` - // The identifier of the message to be replied in the specified chat. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat + // 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 MessageId int64 `json:"message_id"` // Quote from the message to be replied; pass null if none Quote *InputTextQuote `json:"quote"` @@ -11362,32 +11491,8 @@ type Message struct { IsPinned bool `json:"is_pinned"` // True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message IsFromOffline bool `json:"is_from_offline"` - // True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application - CanBeEdited bool `json:"can_be_edited"` - // True, if the message can be forwarded - CanBeForwarded bool `json:"can_be_forwarded"` - // True, if the message can be replied in another chat or topic - CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` // True, if content of the message can be saved locally or copied CanBeSaved bool `json:"can_be_saved"` - // True, if the message can be deleted only for the current user while other users will continue to see it - CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` - // True, if the message can be deleted for all users - CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - // True, if the list of added reactions is available through getMessageAddedReactions - CanGetAddedReactions bool `json:"can_get_added_reactions"` - // True, if the message statistics are available through getMessageStatistics - CanGetStatistics bool `json:"can_get_statistics"` - // True, if information about the message thread is available through getMessageThread and getMessageThreadHistory - CanGetMessageThread bool `json:"can_get_message_thread"` - // True, if read date of the message can be received through getMessageReadDate - CanGetReadDate bool `json:"can_get_read_date"` - // True, if chat members already viewed the message can be received through getMessageViewers - CanGetViewers bool `json:"can_get_viewers"` - // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink - CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` - // True, if reactions on the message can be reported through reportMessageReactions - CanReportReactions bool `json:"can_report_reactions"` // True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message HasTimestampedMedia bool `json:"has_timestamped_media"` // True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts @@ -11468,19 +11573,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { IsOutgoing bool `json:"is_outgoing"` IsPinned bool `json:"is_pinned"` IsFromOffline bool `json:"is_from_offline"` - CanBeEdited bool `json:"can_be_edited"` - CanBeForwarded bool `json:"can_be_forwarded"` - CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` CanBeSaved bool `json:"can_be_saved"` - CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` - CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` - CanGetAddedReactions bool `json:"can_get_added_reactions"` - CanGetStatistics bool `json:"can_get_statistics"` - CanGetMessageThread bool `json:"can_get_message_thread"` - CanGetReadDate bool `json:"can_get_read_date"` - CanGetViewers bool `json:"can_get_viewers"` - CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` - CanReportReactions bool `json:"can_report_reactions"` HasTimestampedMedia bool `json:"has_timestamped_media"` IsChannelPost bool `json:"is_channel_post"` IsTopicMessage bool `json:"is_topic_message"` @@ -11519,19 +11612,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.IsOutgoing = tmp.IsOutgoing message.IsPinned = tmp.IsPinned message.IsFromOffline = tmp.IsFromOffline - message.CanBeEdited = tmp.CanBeEdited - message.CanBeForwarded = tmp.CanBeForwarded - message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat message.CanBeSaved = tmp.CanBeSaved - message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf - message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers - message.CanGetAddedReactions = tmp.CanGetAddedReactions - message.CanGetStatistics = tmp.CanGetStatistics - message.CanGetMessageThread = tmp.CanGetMessageThread - message.CanGetReadDate = tmp.CanGetReadDate - message.CanGetViewers = tmp.CanGetViewers - message.CanGetMediaTimestampLinks = tmp.CanGetMediaTimestampLinks - message.CanReportReactions = tmp.CanReportReactions message.HasTimestampedMedia = tmp.HasTimestampedMedia message.IsChannelPost = tmp.IsChannelPost message.IsTopicMessage = tmp.IsTopicMessage @@ -15001,6 +15082,31 @@ func (*WebAppInfo) GetType() string { return TypeWebAppInfo } +// Contains information about the main Web App of a bot +type MainWebApp struct { + meta + // URL of the Web App to open + Url string `json:"url"` + // True, if the Web App must always be opened in the compact mode instead of the full-size mode + IsCompact bool `json:"is_compact"` +} + +func (entity *MainWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MainWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*MainWebApp) GetClass() string { + return ClassMainWebApp +} + +func (*MainWebApp) GetType() string { + return TypeMainWebApp +} + // Contains information about a message thread type MessageThreadInfo struct { meta @@ -15012,7 +15118,7 @@ type MessageThreadInfo struct { ReplyInfo *MessageReplyInfo `json:"reply_info"` // Approximate number of unread messages in the message thread UnreadMessageCount int32 `json:"unread_message_count"` - // The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) + // The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) Messages []*Message `json:"messages"` // A draft of a message in the message thread; may be null if none DraftMessage *DraftMessage `json:"draft_message"` @@ -15431,6 +15537,62 @@ func (*SharedChat) GetType() string { return TypeSharedChat } +// Describes theme settings +type ThemeSettings struct { + meta + // Theme accent color in ARGB format + AccentColor int32 `json:"accent_color"` + // The background to be used in chats; may be null + Background *Background `json:"background"` + // The fill to be used as a background for outgoing messages + OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` + // If true, the freeform gradient fill needs to be animated on every sent message + AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` + // Accent color of outgoing messages in ARGB format + OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` +} + +func (entity *ThemeSettings) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ThemeSettings + + return json.Marshal((*stub)(entity)) +} + +func (*ThemeSettings) GetClass() string { + return ClassThemeSettings +} + +func (*ThemeSettings) GetType() string { + return TypeThemeSettings +} + +func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { + var tmp struct { + AccentColor int32 `json:"accent_color"` + Background *Background `json:"background"` + OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` + AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` + OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + themeSettings.AccentColor = tmp.AccentColor + themeSettings.Background = tmp.Background + themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill + themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor + + fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) + themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill + + return nil +} + // A plain text type RichTextPlain struct { meta @@ -15981,7 +16143,7 @@ func (*RichTextIcon) RichTextType() string { return TypeRichTextIcon } -// A reference to a richTexts object on the same web page +// A reference to a richTexts object on the same page type RichTextReference struct { meta // The text @@ -16060,7 +16222,7 @@ func (*RichTextAnchor) RichTextType() string { return TypeRichTextAnchor } -// A link to an anchor on the same web page +// A link to an anchor on the same page type RichTextAnchorLink struct { meta // The link text @@ -16155,7 +16317,7 @@ func (richTexts *RichTexts) UnmarshalJSON(data []byte) error { return nil } -// Contains a caption of an instant view web page block, consisting of a text and a trailing credit +// Contains a caption of another block type PageBlockCaption struct { meta // Content of the caption @@ -17264,7 +17426,7 @@ func (pageBlockCover *PageBlockCover) UnmarshalJSON(data []byte) error { // An embedded web page type PageBlockEmbedded struct { meta - // Web page URL, if available + // URL of the embedded page, if available Url string `json:"url"` // HTML-markup of the embedded page Html string `json:"html"` @@ -17305,7 +17467,7 @@ func (*PageBlockEmbedded) PageBlockType() string { // An embedded post type PageBlockEmbeddedPost struct { meta - // Web page URL + // URL of the embedded post Url string `json:"url"` // Post author Author string `json:"author"` @@ -17691,7 +17853,7 @@ func (*PageBlockMap) PageBlockType() string { // Describes an instant view page for a web page type WebPageInstantView struct { meta - // Content of the web page + // Content of the instant view page PageBlocks []PageBlock `json:"page_blocks"` // Number of the instant view views; 0 if unknown ViewCount int32 `json:"view_count"` @@ -17699,7 +17861,7 @@ type WebPageInstantView struct { Version int32 `json:"version"` // True, if the instant view must be shown from right to left IsRtl bool `json:"is_rtl"` - // True, if the instant view contains the full page. A network request might be needed to get the full web page instant view + // True, if the instant view contains the full page. A network request might be needed to get the full instant view IsFull bool `json:"is_full"` // An internal link to be opened to leave feedback about the instant view FeedbackLink InternalLinkType `json:"feedback_link"` @@ -17750,81 +17912,1029 @@ func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { return nil } +// The media is a photo +type LinkPreviewAlbumMediaPhoto struct { + meta + // Photo description + Photo *Photo `json:"photo"` +} + +func (entity *LinkPreviewAlbumMediaPhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewAlbumMediaPhoto + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewAlbumMediaPhoto) GetClass() string { + return ClassLinkPreviewAlbumMedia +} + +func (*LinkPreviewAlbumMediaPhoto) GetType() string { + return TypeLinkPreviewAlbumMediaPhoto +} + +func (*LinkPreviewAlbumMediaPhoto) LinkPreviewAlbumMediaType() string { + return TypeLinkPreviewAlbumMediaPhoto +} + +// The media is a video +type LinkPreviewAlbumMediaVideo struct { + meta + // Video description + Video *Video `json:"video"` +} + +func (entity *LinkPreviewAlbumMediaVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewAlbumMediaVideo + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewAlbumMediaVideo) GetClass() string { + return ClassLinkPreviewAlbumMedia +} + +func (*LinkPreviewAlbumMediaVideo) GetType() string { + return TypeLinkPreviewAlbumMediaVideo +} + +func (*LinkPreviewAlbumMediaVideo) LinkPreviewAlbumMediaType() string { + return TypeLinkPreviewAlbumMediaVideo +} + +// The link is a link to a media album consisting of photos and videos +type LinkPreviewTypeAlbum struct { + meta + // The list of album media + Media []LinkPreviewAlbumMedia `json:"media"` + // Album caption + Caption string `json:"caption"` +} + +func (entity *LinkPreviewTypeAlbum) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeAlbum + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeAlbum) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeAlbum) GetType() string { + return TypeLinkPreviewTypeAlbum +} + +func (*LinkPreviewTypeAlbum) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeAlbum +} + +func (linkPreviewTypeAlbum *LinkPreviewTypeAlbum) UnmarshalJSON(data []byte) error { + var tmp struct { + Media []json.RawMessage `json:"media"` + Caption string `json:"caption"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + linkPreviewTypeAlbum.Caption = tmp.Caption + + fieldMedia, _ := UnmarshalListOfLinkPreviewAlbumMedia(tmp.Media) + linkPreviewTypeAlbum.Media = fieldMedia + + return nil +} + +// The link is a link to an animation +type LinkPreviewTypeAnimation struct { + meta + // The animation + Animation *Animation `json:"animation"` + // Author of the animation + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeAnimation) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeAnimation + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeAnimation) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeAnimation) GetType() string { + return TypeLinkPreviewTypeAnimation +} + +func (*LinkPreviewTypeAnimation) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeAnimation +} + +// The link is a link to an app at App Store or Google Play +type LinkPreviewTypeApp struct { + meta + // Photo for the app + Photo *Photo `json:"photo"` + // Author of the app + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeApp + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeApp) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeApp) GetType() string { + return TypeLinkPreviewTypeApp +} + +func (*LinkPreviewTypeApp) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeApp +} + +// The link is a link to a web site +type LinkPreviewTypeArticle struct { + meta + // Article's main photo; may be null + Photo *Photo `json:"photo"` + // Author of the article + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeArticle) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeArticle + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeArticle) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeArticle) GetType() string { + return TypeLinkPreviewTypeArticle +} + +func (*LinkPreviewTypeArticle) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeArticle +} + +// The link is a link to an audio +type LinkPreviewTypeAudio struct { + meta + // URL of the audio; may be empty if none + Url string `json:"url"` + // MIME type of the audio file + MimeType string `json:"mime_type"` + // The audio description; may be null if unknown + Audio *Audio `json:"audio"` + // Duration of the audio, in seconds; 0 if unknown + Duration int32 `json:"duration"` + // Author of the audio + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeAudio) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeAudio + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeAudio) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeAudio) GetType() string { + return TypeLinkPreviewTypeAudio +} + +func (*LinkPreviewTypeAudio) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeAudio +} + +// The link is a link to a background. Link preview title and description are available only for filled backgrounds +type LinkPreviewTypeBackground struct { + meta + // Document with the background; may be null for filled backgrounds + Document *Document `json:"document"` +} + +func (entity *LinkPreviewTypeBackground) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeBackground + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeBackground) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeBackground) GetType() string { + return TypeLinkPreviewTypeBackground +} + +func (*LinkPreviewTypeBackground) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeBackground +} + +// The link is a link to boost a channel chat +type LinkPreviewTypeChannelBoost struct { + meta + // Photo of the chat; may be null + Photo *ChatPhoto `json:"photo"` +} + +func (entity *LinkPreviewTypeChannelBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeChannelBoost + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeChannelBoost) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeChannelBoost) GetType() string { + return TypeLinkPreviewTypeChannelBoost +} + +func (*LinkPreviewTypeChannelBoost) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeChannelBoost +} + +// The link is a link to a chat +type LinkPreviewTypeChat struct { + meta + // Type of the chat + Type InviteLinkChatType `json:"type"` + // Photo of the chat; may be null + Photo *ChatPhoto `json:"photo"` + // True, if the link only creates join request + CreatesJoinRequest bool `json:"creates_join_request"` +} + +func (entity *LinkPreviewTypeChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeChat + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeChat) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeChat) GetType() string { + return TypeLinkPreviewTypeChat +} + +func (*LinkPreviewTypeChat) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeChat +} + +func (linkPreviewTypeChat *LinkPreviewTypeChat) UnmarshalJSON(data []byte) error { + var tmp struct { + Type json.RawMessage `json:"type"` + Photo *ChatPhoto `json:"photo"` + CreatesJoinRequest bool `json:"creates_join_request"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + linkPreviewTypeChat.Photo = tmp.Photo + linkPreviewTypeChat.CreatesJoinRequest = tmp.CreatesJoinRequest + + fieldType, _ := UnmarshalInviteLinkChatType(tmp.Type) + linkPreviewTypeChat.Type = fieldType + + return nil +} + +// The link is a link to a general file +type LinkPreviewTypeDocument struct { + meta + // The document description + Document *Document `json:"document"` + // Author of the document + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeDocument) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeDocument + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeDocument) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeDocument) GetType() string { + return TypeLinkPreviewTypeDocument +} + +func (*LinkPreviewTypeDocument) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeDocument +} + +// The link is a link to an animation player +type LinkPreviewTypeEmbeddedAnimationPlayer struct { + meta + // URL of the external animation player + Url string `json:"url"` + // Thumbnail of the animation; may be null if unknown + Thumbnail *Photo `json:"thumbnail"` + // Duration of the animation, in seconds + Duration int32 `json:"duration"` + // Author of the animation + Author string `json:"author"` + // Expected width of the embedded player + Width int32 `json:"width"` + // Expected height of the embedded player + Height int32 `json:"height"` +} + +func (entity *LinkPreviewTypeEmbeddedAnimationPlayer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeEmbeddedAnimationPlayer + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeEmbeddedAnimationPlayer) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeEmbeddedAnimationPlayer) GetType() string { + return TypeLinkPreviewTypeEmbeddedAnimationPlayer +} + +func (*LinkPreviewTypeEmbeddedAnimationPlayer) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeEmbeddedAnimationPlayer +} + +// The link is a link to an audio player +type LinkPreviewTypeEmbeddedAudioPlayer struct { + meta + // URL of the external audio player + Url string `json:"url"` + // Thumbnail of the audio; may be null if unknown + Thumbnail *Photo `json:"thumbnail"` + // Duration of the audio, in seconds + Duration int32 `json:"duration"` + // Author of the audio + Author string `json:"author"` + // Expected width of the embedded player + Width int32 `json:"width"` + // Expected height of the embedded player + Height int32 `json:"height"` +} + +func (entity *LinkPreviewTypeEmbeddedAudioPlayer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeEmbeddedAudioPlayer + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeEmbeddedAudioPlayer) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeEmbeddedAudioPlayer) GetType() string { + return TypeLinkPreviewTypeEmbeddedAudioPlayer +} + +func (*LinkPreviewTypeEmbeddedAudioPlayer) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeEmbeddedAudioPlayer +} + +// The link is a link to a video player +type LinkPreviewTypeEmbeddedVideoPlayer struct { + meta + // URL of the external video player + Url string `json:"url"` + // Thumbnail of the video; may be null if unknown + Thumbnail *Photo `json:"thumbnail"` + // Duration of the video, in seconds + Duration int32 `json:"duration"` + // Author of the video + Author string `json:"author"` + // Expected width of the embedded player + Width int32 `json:"width"` + // Expected height of the embedded player + Height int32 `json:"height"` +} + +func (entity *LinkPreviewTypeEmbeddedVideoPlayer) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeEmbeddedVideoPlayer + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeEmbeddedVideoPlayer) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeEmbeddedVideoPlayer) GetType() string { + return TypeLinkPreviewTypeEmbeddedVideoPlayer +} + +func (*LinkPreviewTypeEmbeddedVideoPlayer) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeEmbeddedVideoPlayer +} + +// The link is a link to an invoice +type LinkPreviewTypeInvoice struct{ + meta +} + +func (entity *LinkPreviewTypeInvoice) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeInvoice + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeInvoice) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeInvoice) GetType() string { + return TypeLinkPreviewTypeInvoice +} + +func (*LinkPreviewTypeInvoice) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeInvoice +} + +// The link is a link to a text or a poll Telegram message +type LinkPreviewTypeMessage struct{ + meta +} + +func (entity *LinkPreviewTypeMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeMessage + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeMessage) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeMessage) GetType() string { + return TypeLinkPreviewTypeMessage +} + +func (*LinkPreviewTypeMessage) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeMessage +} + +// The link is a link to a photo +type LinkPreviewTypePhoto struct { + meta + // The photo + Photo *Photo `json:"photo"` + // Author of the photo + Author string `json:"author"` +} + +func (entity *LinkPreviewTypePhoto) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypePhoto + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypePhoto) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypePhoto) GetType() string { + return TypeLinkPreviewTypePhoto +} + +func (*LinkPreviewTypePhoto) LinkPreviewTypeType() string { + return TypeLinkPreviewTypePhoto +} + +// The link is a link to a Telegram Premium gift code +type LinkPreviewTypePremiumGiftCode struct{ + meta +} + +func (entity *LinkPreviewTypePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypePremiumGiftCode) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypePremiumGiftCode) GetType() string { + return TypeLinkPreviewTypePremiumGiftCode +} + +func (*LinkPreviewTypePremiumGiftCode) LinkPreviewTypeType() string { + return TypeLinkPreviewTypePremiumGiftCode +} + +// The link is a link to a shareable chat folder +type LinkPreviewTypeShareableChatFolder struct{ + meta +} + +func (entity *LinkPreviewTypeShareableChatFolder) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeShareableChatFolder + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeShareableChatFolder) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeShareableChatFolder) GetType() string { + return TypeLinkPreviewTypeShareableChatFolder +} + +func (*LinkPreviewTypeShareableChatFolder) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeShareableChatFolder +} + +// The link is a link to a sticker message +type LinkPreviewTypeSticker struct { + meta + // The sticker + Sticker *Sticker `json:"sticker"` +} + +func (entity *LinkPreviewTypeSticker) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeSticker + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeSticker) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeSticker) GetType() string { + return TypeLinkPreviewTypeSticker +} + +func (*LinkPreviewTypeSticker) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeSticker +} + +// The link is a link to a sticker set +type LinkPreviewTypeStickerSet struct { + meta + // Up to 4 stickers from the sticker set + Stickers []*Sticker `json:"stickers"` +} + +func (entity *LinkPreviewTypeStickerSet) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeStickerSet + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeStickerSet) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeStickerSet) GetType() string { + return TypeLinkPreviewTypeStickerSet +} + +func (*LinkPreviewTypeStickerSet) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeStickerSet +} + +// The link is a link to a story. Link preview description is unavailable +type LinkPreviewTypeStory struct { + meta + // The identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` + // Story identifier + StoryId int32 `json:"story_id"` +} + +func (entity *LinkPreviewTypeStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeStory + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeStory) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeStory) GetType() string { + return TypeLinkPreviewTypeStory +} + +func (*LinkPreviewTypeStory) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeStory +} + +// The link is a link to boost a supergroup chat +type LinkPreviewTypeSupergroupBoost struct { + meta + // Photo of the chat; may be null + Photo *ChatPhoto `json:"photo"` +} + +func (entity *LinkPreviewTypeSupergroupBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeSupergroupBoost + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeSupergroupBoost) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeSupergroupBoost) GetType() string { + return TypeLinkPreviewTypeSupergroupBoost +} + +func (*LinkPreviewTypeSupergroupBoost) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeSupergroupBoost +} + +// The link is a link to a cloud theme. TDLib has no theme support yet +type LinkPreviewTypeTheme struct { + meta + // The list of files with theme description + Documents []*Document `json:"documents"` + // Settings for the cloud theme + Settings *ThemeSettings `json:"settings"` +} + +func (entity *LinkPreviewTypeTheme) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeTheme + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeTheme) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeTheme) GetType() string { + return TypeLinkPreviewTypeTheme +} + +func (*LinkPreviewTypeTheme) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeTheme +} + +// The link preview type is unsupported yet +type LinkPreviewTypeUnsupported struct{ + meta +} + +func (entity *LinkPreviewTypeUnsupported) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeUnsupported + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeUnsupported) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeUnsupported) GetType() string { + return TypeLinkPreviewTypeUnsupported +} + +func (*LinkPreviewTypeUnsupported) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeUnsupported +} + +// The link is a link to a user +type LinkPreviewTypeUser struct { + meta + // Photo of the user; may be null if none + Photo *ChatPhoto `json:"photo"` + // True, if the user is a bot + IsBot bool `json:"is_bot"` +} + +func (entity *LinkPreviewTypeUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeUser + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeUser) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeUser) GetType() string { + return TypeLinkPreviewTypeUser +} + +func (*LinkPreviewTypeUser) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeUser +} + +// The link is a link to a video +type LinkPreviewTypeVideo struct { + meta + // URL of the video; may be empty if none + Url string `json:"url"` + // MIME type of the video file + MimeType string `json:"mime_type"` + // The video description; may be null if unknown + Video *Video `json:"video"` + // Expected width of the preview + Width int32 `json:"width"` + // Expected height of the preview + Height int32 `json:"height"` + // Duration of the video, in seconds; 0 if unknown + Duration int32 `json:"duration"` + // Author of the video + Author string `json:"author"` +} + +func (entity *LinkPreviewTypeVideo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeVideo + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeVideo) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeVideo) GetType() string { + return TypeLinkPreviewTypeVideo +} + +func (*LinkPreviewTypeVideo) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeVideo +} + +// The link is a link to a video chat +type LinkPreviewTypeVideoChat struct { + meta + // Photo of the chat with the video chat; may be null if none + Photo *ChatPhoto `json:"photo"` + // True, if the video chat is expected to be a live stream in a channel or a broadcast group + IsLiveStream bool `json:"is_live_stream"` +} + +func (entity *LinkPreviewTypeVideoChat) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeVideoChat + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeVideoChat) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeVideoChat) GetType() string { + return TypeLinkPreviewTypeVideoChat +} + +func (*LinkPreviewTypeVideoChat) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeVideoChat +} + +// The link is a link to a video note message +type LinkPreviewTypeVideoNote struct { + meta + // The video note + VideoNote *VideoNote `json:"video_note"` +} + +func (entity *LinkPreviewTypeVideoNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeVideoNote + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeVideoNote) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeVideoNote) GetType() string { + return TypeLinkPreviewTypeVideoNote +} + +func (*LinkPreviewTypeVideoNote) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeVideoNote +} + +// The link is a link to a voice note message +type LinkPreviewTypeVoiceNote struct { + meta + // The voice note + VoiceNote *VoiceNote `json:"voice_note"` +} + +func (entity *LinkPreviewTypeVoiceNote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeVoiceNote + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeVoiceNote) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeVoiceNote) GetType() string { + return TypeLinkPreviewTypeVoiceNote +} + +func (*LinkPreviewTypeVoiceNote) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeVoiceNote +} + +// The link is a link to a Web App +type LinkPreviewTypeWebApp struct { + meta + // Web App photo + Photo *Photo `json:"photo"` +} + +func (entity *LinkPreviewTypeWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewTypeWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewTypeWebApp) GetClass() string { + return ClassLinkPreviewType +} + +func (*LinkPreviewTypeWebApp) GetType() string { + return TypeLinkPreviewTypeWebApp +} + +func (*LinkPreviewTypeWebApp) LinkPreviewTypeType() string { + return TypeLinkPreviewTypeWebApp +} + // Describes a link preview -type WebPage struct { +type LinkPreview struct { meta // Original URL of the link Url string `json:"url"` // URL to display DisplayUrl string `json:"display_url"` - // Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else - Type string `json:"type"` // Short name of the site (e.g., Google Docs, App Store) SiteName string `json:"site_name"` // Title of the content Title string `json:"title"` // Description of the content Description *FormattedText `json:"description"` - // Image representing the content; may be null - Photo *Photo `json:"photo"` - // URL to show in the embedded preview - EmbedUrl string `json:"embed_url"` - // MIME type of the embedded preview, (e.g., text/html or video/mp4) - EmbedType string `json:"embed_type"` - // Width of the embedded preview - EmbedWidth int32 `json:"embed_width"` - // Height of the embedded preview - EmbedHeight int32 `json:"embed_height"` - // Duration of the content, in seconds - Duration int32 `json:"duration"` - // Author of the content - Author string `json:"author"` + // Type of the link preview + Type LinkPreviewType `json:"type"` // True, if size of media in the preview can be changed HasLargeMedia bool `json:"has_large_media"` // True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos ShowLargeMedia bool `json:"show_large_media"` + // True, if media must be shown above link preview description; otherwise, the media must be shown below the description + ShowMediaAboveDescription bool `json:"show_media_above_description"` // True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear SkipConfirmation bool `json:"skip_confirmation"` // True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text ShowAboveText bool `json:"show_above_text"` - // Preview of the content as an animation, if available; may be null - Animation *Animation `json:"animation"` - // Preview of the content as an audio file, if available; may be null - Audio *Audio `json:"audio"` - // Preview of the content as a document, if available; may be null - Document *Document `json:"document"` - // Preview of the content as a sticker for small WEBP files, if available; may be null - Sticker *Sticker `json:"sticker"` - // Preview of the content as a video, if available; may be null - Video *Video `json:"video"` - // Preview of the content as a video note, if available; may be null - VideoNote *VideoNote `json:"video_note"` - // Preview of the content as a voice note, if available; may be null - VoiceNote *VoiceNote `json:"voice_note"` - // The identifier of the sender of the previewed story; 0 if none - StorySenderChatId int64 `json:"story_sender_chat_id"` - // The identifier of the previewed story; 0 if none - StoryId int32 `json:"story_id"` - // Up to 4 stickers from the sticker set available via the link - Stickers []*Sticker `json:"stickers"` - // Version of web page instant view (currently, can be 1 or 2); 0 if none + // Version of instant view (currently, can be 1 or 2) for the web page; 0 if none InstantViewVersion int32 `json:"instant_view_version"` } -func (entity *WebPage) MarshalJSON() ([]byte, error) { +func (entity *LinkPreview) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub WebPage + type stub LinkPreview return json.Marshal((*stub)(entity)) } -func (*WebPage) GetClass() string { - return ClassWebPage +func (*LinkPreview) GetClass() string { + return ClassLinkPreview } -func (*WebPage) GetType() string { - return TypeWebPage +func (*LinkPreview) GetType() string { + return TypeLinkPreview +} + +func (linkPreview *LinkPreview) UnmarshalJSON(data []byte) error { + var tmp struct { + Url string `json:"url"` + DisplayUrl string `json:"display_url"` + SiteName string `json:"site_name"` + Title string `json:"title"` + Description *FormattedText `json:"description"` + Type json.RawMessage `json:"type"` + HasLargeMedia bool `json:"has_large_media"` + ShowLargeMedia bool `json:"show_large_media"` + ShowMediaAboveDescription bool `json:"show_media_above_description"` + SkipConfirmation bool `json:"skip_confirmation"` + ShowAboveText bool `json:"show_above_text"` + InstantViewVersion int32 `json:"instant_view_version"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + linkPreview.Url = tmp.Url + linkPreview.DisplayUrl = tmp.DisplayUrl + linkPreview.SiteName = tmp.SiteName + linkPreview.Title = tmp.Title + linkPreview.Description = tmp.Description + linkPreview.HasLargeMedia = tmp.HasLargeMedia + linkPreview.ShowLargeMedia = tmp.ShowLargeMedia + linkPreview.ShowMediaAboveDescription = tmp.ShowMediaAboveDescription + linkPreview.SkipConfirmation = tmp.SkipConfirmation + linkPreview.ShowAboveText = tmp.ShowAboveText + linkPreview.InstantViewVersion = tmp.InstantViewVersion + + fieldType, _ := UnmarshalLinkPreviewType(tmp.Type) + linkPreview.Type = fieldType + + return nil } // Contains information about a country @@ -18609,10 +19719,10 @@ func (paymentFormTypeRegular *PaymentFormTypeRegular) UnmarshalJSON(data []byte) return nil } -// The payment form is for a payment in Telegram stars +// The payment form is for a payment in Telegram Stars type PaymentFormTypeStars struct { meta - // Number of Telegram stars that will be paid + // Number of Telegram Stars that will be paid StarCount int64 `json:"star_count"` } @@ -18775,10 +19885,10 @@ func (*PaymentReceiptTypeRegular) PaymentReceiptTypeType() string { return TypePaymentReceiptTypeRegular } -// The payment was done using Telegram stars +// The payment was done using Telegram Stars type PaymentReceiptTypeStars struct { meta - // Number of Telegram stars that were paid + // Number of Telegram Stars that were paid StarCount int64 `json:"star_count"` // Unique identifier of the transaction that can be used to dispute it TransactionId string `json:"transaction_id"` @@ -21257,7 +22367,7 @@ type MessageText struct { // Text of the message Text *FormattedText `json:"text"` // A link preview attached to the message; may be null - WebPage *WebPage `json:"web_page"` + LinkPreview *LinkPreview `json:"link_preview"` // Options which were used for generation of the link preview; may be null if default options were used LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } @@ -21378,7 +22488,7 @@ func (*MessageDocument) MessageContentType() string { // A message with paid media type MessagePaidMedia struct { meta - // Number of stars needed to buy access to the media in the message + // Number of Telegram Stars needed to buy access to the media in the message StarCount int64 `json:"star_count"` // Information about the media Media []PaidMedia `json:"media"` @@ -22939,11 +24049,77 @@ func (*MessagePaymentSuccessfulBot) MessageContentType() string { return TypeMessagePaymentSuccessfulBot } -// Telegram Premium was gifted to the user +// A payment has been refunded +type MessagePaymentRefunded struct { + meta + // Identifier of the previous owner of the Telegram Stars that refunds them + OwnerId MessageSender `json:"owner_id"` + // Currency for the price of the product + Currency string `json:"currency"` + // Total price for the product, in the smallest units of the currency + TotalAmount int64 `json:"total_amount"` + // Invoice payload; only for bots + InvoicePayload []byte `json:"invoice_payload"` + // Telegram payment identifier + TelegramPaymentChargeId string `json:"telegram_payment_charge_id"` + // Provider payment identifier + ProviderPaymentChargeId string `json:"provider_payment_charge_id"` +} + +func (entity *MessagePaymentRefunded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePaymentRefunded + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePaymentRefunded) GetClass() string { + return ClassMessageContent +} + +func (*MessagePaymentRefunded) GetType() string { + return TypeMessagePaymentRefunded +} + +func (*MessagePaymentRefunded) MessageContentType() string { + return TypeMessagePaymentRefunded +} + +func (messagePaymentRefunded *MessagePaymentRefunded) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Currency string `json:"currency"` + TotalAmount int64 `json:"total_amount"` + InvoicePayload []byte `json:"invoice_payload"` + TelegramPaymentChargeId string `json:"telegram_payment_charge_id"` + ProviderPaymentChargeId string `json:"provider_payment_charge_id"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messagePaymentRefunded.Currency = tmp.Currency + messagePaymentRefunded.TotalAmount = tmp.TotalAmount + messagePaymentRefunded.InvoicePayload = tmp.InvoicePayload + messagePaymentRefunded.TelegramPaymentChargeId = tmp.TelegramPaymentChargeId + messagePaymentRefunded.ProviderPaymentChargeId = tmp.ProviderPaymentChargeId + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + messagePaymentRefunded.OwnerId = fieldOwnerId + + return nil +} + +// Telegram Premium was gifted to a user type MessageGiftedPremium struct { meta - // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + // The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing GifterUserId int64 `json:"gifter_user_id"` + // The identifier of a user that received Telegram Premium; 0 if the gift is incoming + ReceiverUserId int64 `json:"receiver_user_id"` // Currency for the paid amount Currency string `json:"currency"` // The paid amount, in the smallest units of the currency @@ -23194,6 +24370,49 @@ func (*MessagePremiumGiveawayWinners) MessageContentType() string { return TypeMessagePremiumGiveawayWinners } +// Telegram Stars were gifted to a user +type MessageGiftedStars struct { + meta + // The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing + GifterUserId int64 `json:"gifter_user_id"` + // The identifier of a user that received Telegram Stars; 0 if the gift is incoming + ReceiverUserId int64 `json:"receiver_user_id"` + // Currency for the paid amount + Currency string `json:"currency"` + // The paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Cryptocurrency used to pay for the gift; may be empty if none + Cryptocurrency string `json:"cryptocurrency"` + // The paid amount, in the smallest units of the cryptocurrency; 0 if none + CryptocurrencyAmount JsonInt64 `json:"cryptocurrency_amount"` + // Number of Telegram Stars that were gifted + StarCount int64 `json:"star_count"` + // Identifier of the transaction for Telegram Stars purchase; for receiver only + TransactionId string `json:"transaction_id"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessageGiftedStars) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageGiftedStars + + return json.Marshal((*stub)(entity)) +} + +func (*MessageGiftedStars) GetClass() string { + return ClassMessageContent +} + +func (*MessageGiftedStars) GetType() string { + return TypeMessageGiftedStars +} + +func (*MessageGiftedStars) MessageContentType() string { + return TypeMessageGiftedStars +} + // A contact has registered with Telegram type MessageContactRegistered struct{ meta @@ -24063,7 +25282,7 @@ func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { // A media timestamp type TextEntityTypeMediaTimestamp struct { meta - // 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 web page preview of the current message, or in the same places in the replied message + // 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 MediaTimestamp int32 `json:"media_timestamp"` } @@ -24682,7 +25901,7 @@ func (inputMessageDocument *InputMessageDocument) UnmarshalJSON(data []byte) err // A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed type InputMessagePaidMedia struct { meta - // The number of stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max") + // The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max") StarCount int64 `json:"star_count"` // The content of the paid media PaidMedia []*InputPaidMedia `json:"paid_media"` @@ -25358,7 +26577,7 @@ type InputMessageForwarded struct { meta // Identifier for the chat this forwarded message came from FromChatId int64 `json:"from_chat_id"` - // Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded + // Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded MessageId int64 `json:"message_id"` // True, if a game message is being shared from a launched game; applies only to game messages InGameShare bool `json:"in_game_share"` @@ -25386,6 +26605,77 @@ func (*InputMessageForwarded) InputMessageContentType() string { return TypeInputMessageForwarded } +// Contains properties of a message and describes actions that can be done with the message right now +type MessageProperties struct { + meta + // True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false + CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"` + // True, if the message can be deleted for all users using the method deleteMessages with revoke == true + CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"` + // True, if the message can be edited using the methods editMessageText, editMessageMedia, editMessageCaption, or editMessageReplyMarkup. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message + CanBeEdited bool `json:"can_be_edited"` + // True, if the message can be forwarded using inputMessageForwarded or forwardMessages + CanBeForwarded bool `json:"can_be_forwarded"` + // True, if the message can be paid using inputInvoiceMessage + CanBePaid bool `json:"can_be_paid"` + // True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage + CanBePinned bool `json:"can_be_pinned"` + // True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage + CanBeReplied bool `json:"can_be_replied"` + // True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage + CanBeRepliedInAnotherChat bool `json:"can_be_replied_in_another_chat"` + // True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options + CanBeSaved bool `json:"can_be_saved"` + // True, if the message can be shared in a story using inputStoryAreaTypeMessage + CanBeSharedInStory bool `json:"can_be_shared_in_story"` + // True, if scheduling state of the message can be edited + CanEditSchedulingState bool `json:"can_edit_scheduling_state"` + // True, if the list of added reactions is available using getMessageAddedReactions + CanGetAddedReactions bool `json:"can_get_added_reactions"` + // True, if code for message embedding can be received using getMessageEmbeddingCode + CanGetEmbeddingCode bool `json:"can_get_embedding_code"` + // True, if a link can be generated for the message using getMessageLink + CanGetLink bool `json:"can_get_link"` + // True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink + CanGetMediaTimestampLinks bool `json:"can_get_media_timestamp_links"` + // True, if information about the message thread is available through getMessageThread and getMessageThreadHistory + CanGetMessageThread bool `json:"can_get_message_thread"` + // True, if read date of the message can be received through getMessageReadDate + CanGetReadDate bool `json:"can_get_read_date"` + // True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards + CanGetStatistics bool `json:"can_get_statistics"` + // True, if chat members already viewed the message can be received through getMessageViewers + CanGetViewers bool `json:"can_get_viewers"` + // True, if speech can be recognized for the message through recognizeSpeech + CanRecognizeSpeech bool `json:"can_recognize_speech"` + // True, if the message can be reported using reportChat + CanReportChat bool `json:"can_report_chat"` + // True, if reactions on the message can be reported through reportMessageReactions + CanReportReactions bool `json:"can_report_reactions"` + // True, if the message can be reported using reportSupergroupSpam + CanReportSupergroupSpam bool `json:"can_report_supergroup_spam"` + // True, if fact check for the message can be changed through setMessageFactCheck + CanSetFactCheck bool `json:"can_set_fact_check"` + // True, if message statistics must be available from context menu of the message + NeedShowStatistics bool `json:"need_show_statistics"` +} + +func (entity *MessageProperties) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageProperties + + return json.Marshal((*stub)(entity)) +} + +func (*MessageProperties) GetClass() string { + return ClassMessageProperties +} + +func (*MessageProperties) GetType() string { + return TypeMessageProperties +} + // Returns all found messages, no filter is applied type SearchMessagesFilterEmpty struct{ meta @@ -26923,6 +28213,31 @@ func (*EmojiCategoryTypeChatPhoto) EmojiCategoryTypeType() string { return TypeEmojiCategoryTypeChatPhoto } +// Describes the current weather +type CurrentWeather struct { + meta + // Temperature, in degree Celsius + Temperature float64 `json:"temperature"` + // Emoji representing the weather + Emoji string `json:"emoji"` +} + +func (entity *CurrentWeather) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CurrentWeather + + return json.Marshal((*stub)(entity)) +} + +func (*CurrentWeather) GetClass() string { + return ClassCurrentWeather +} + +func (*CurrentWeather) GetType() string { + return TypeCurrentWeather +} + // Describes position of a clickable rectangle area on a story media type StoryAreaPosition struct { meta @@ -27124,6 +28439,37 @@ func (*StoryAreaTypeLink) StoryAreaTypeType() string { return TypeStoryAreaTypeLink } +// An area with information about weather +type StoryAreaTypeWeather struct { + meta + // Temperature, in degree Celsius + Temperature float64 `json:"temperature"` + // Emoji representing the weather + Emoji string `json:"emoji"` + // A color of the area background in the ARGB format + BackgroundColor int32 `json:"background_color"` +} + +func (entity *StoryAreaTypeWeather) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeWeather + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeWeather) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeWeather) GetType() string { + return TypeStoryAreaTypeWeather +} + +func (*StoryAreaTypeWeather) StoryAreaTypeType() string { + return TypeStoryAreaTypeWeather +} + // Describes a clickable rectangle area on a story media type StoryArea struct { meta @@ -27312,7 +28658,7 @@ type InputStoryAreaTypeMessage struct { meta // Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat ChatId int64 `json:"chat_id"` - // Identifier of the message. Only successfully sent non-scheduled messages can be specified + // Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable MessageId int64 `json:"message_id"` } @@ -27363,6 +28709,37 @@ func (*InputStoryAreaTypeLink) InputStoryAreaTypeType() string { return TypeInputStoryAreaTypeLink } +// An area with information about weather +type InputStoryAreaTypeWeather struct { + meta + // Temperature, in degree Celsius + Temperature float64 `json:"temperature"` + // Emoji representing the weather + Emoji string `json:"emoji"` + // A color of the area background in the ARGB format + BackgroundColor int32 `json:"background_color"` +} + +func (entity *InputStoryAreaTypeWeather) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeWeather + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeWeather) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeWeather) GetType() string { + return TypeInputStoryAreaTypeWeather +} + +func (*InputStoryAreaTypeWeather) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeWeather +} + // Describes a clickable rectangle area on a story media to be added type InputStoryArea struct { meta @@ -27410,7 +28787,7 @@ func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { // Contains a list of story areas to be added type InputStoryAreas struct { meta - // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, and up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user + // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, and up to 3 inputStoryAreaTypeWeather areas Areas []*InputStoryArea `json:"areas"` } @@ -27449,6 +28826,8 @@ type StoryVideo struct { Thumbnail *Thumbnail `json:"thumbnail"` // Size of file prefix, which is supposed to be preloaded, in bytes PreloadPrefixSize int32 `json:"preload_prefix_size"` + // Timestamp of the frame used as video thumbnail + CoverFrameTimestamp float64 `json:"cover_frame_timestamp"` // File containing the video Video *File `json:"video"` } @@ -27607,6 +28986,8 @@ type InputStoryContentVideo struct { AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` // Precise duration of the video, in seconds; 0-60 Duration float64 `json:"duration"` + // Timestamp of the frame, which will be used as video thumbnail + CoverFrameTimestamp float64 `json:"cover_frame_timestamp"` // True, if the video has no sound IsAnimation bool `json:"is_animation"` } @@ -27636,6 +29017,7 @@ func (inputStoryContentVideo *InputStoryContentVideo) UnmarshalJSON(data []byte) Video json.RawMessage `json:"video"` AddedStickerFileIds []int32 `json:"added_sticker_file_ids"` Duration float64 `json:"duration"` + CoverFrameTimestamp float64 `json:"cover_frame_timestamp"` IsAnimation bool `json:"is_animation"` } @@ -27646,6 +29028,7 @@ func (inputStoryContentVideo *InputStoryContentVideo) UnmarshalJSON(data []byte) inputStoryContentVideo.AddedStickerFileIds = tmp.AddedStickerFileIds inputStoryContentVideo.Duration = tmp.Duration + inputStoryContentVideo.CoverFrameTimestamp = tmp.CoverFrameTimestamp inputStoryContentVideo.IsAnimation = tmp.IsAnimation fieldVideo, _ := UnmarshalInputFile(tmp.Video) @@ -28088,7 +29471,7 @@ type ChatActiveStories struct { Order int64 `json:"order"` // Identifier of the last read active story MaxReadStoryId int32 `json:"max_read_story_id"` - // Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) + // Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers) Stories []*StoryInfo `json:"stories"` } @@ -28543,6 +29926,98 @@ func (publicForwards *PublicForwards) UnmarshalJSON(data []byte) error { return nil } +// Describes media previews of a bot +type BotMediaPreview struct { + meta + // Point in time (Unix timestamp) when the preview was added or changed last time + Date int32 `json:"date"` + // Content of the preview + Content StoryContent `json:"content"` +} + +func (entity *BotMediaPreview) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMediaPreview + + return json.Marshal((*stub)(entity)) +} + +func (*BotMediaPreview) GetClass() string { + return ClassBotMediaPreview +} + +func (*BotMediaPreview) GetType() string { + return TypeBotMediaPreview +} + +func (botMediaPreview *BotMediaPreview) UnmarshalJSON(data []byte) error { + var tmp struct { + Date int32 `json:"date"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + botMediaPreview.Date = tmp.Date + + fieldContent, _ := UnmarshalStoryContent(tmp.Content) + botMediaPreview.Content = fieldContent + + return nil +} + +// Contains a list of media previews of a bot +type BotMediaPreviews struct { + meta + // List of media previews + Previews []*BotMediaPreview `json:"previews"` +} + +func (entity *BotMediaPreviews) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMediaPreviews + + return json.Marshal((*stub)(entity)) +} + +func (*BotMediaPreviews) GetClass() string { + return ClassBotMediaPreviews +} + +func (*BotMediaPreviews) GetType() string { + return TypeBotMediaPreviews +} + +// Contains a list of media previews of a bot for the given language and the list of languages for which the bot has dedicated previews +type BotMediaPreviewInfo struct { + meta + // List of media previews + Previews []*BotMediaPreview `json:"previews"` + // List of language codes for which the bot has dedicated previews + LanguageCodes []string `json:"language_codes"` +} + +func (entity *BotMediaPreviewInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotMediaPreviewInfo + + return json.Marshal((*stub)(entity)) +} + +func (*BotMediaPreviewInfo) GetClass() string { + return ClassBotMediaPreviewInfo +} + +func (*BotMediaPreviewInfo) GetType() string { + return TypeBotMediaPreviewInfo +} + // Contains a list of features available on a specific chat boost level type ChatBoostLevelFeatures struct { meta @@ -36584,7 +38059,7 @@ func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string // The user gifting Telegram Premium to another user type StorePaymentPurposeGiftedPremium struct { meta - // Identifier of the user to which Premium was gifted + // Identifier of the user to which Telegram Premium is gifted UserId int64 `json:"user_id"` // ISO 4217 currency code of the payment currency Currency string `json:"currency"` @@ -36676,14 +38151,14 @@ func (*StorePaymentPurposePremiumGiveaway) StorePaymentPurposeType() string { return TypeStorePaymentPurposePremiumGiveaway } -// The user buying Telegram stars +// The user buying Telegram Stars type StorePaymentPurposeStars struct { meta // ISO 4217 currency code of the payment currency Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of bought stars + // Number of bought Telegram Stars StarCount int64 `json:"star_count"` } @@ -36707,6 +38182,39 @@ func (*StorePaymentPurposeStars) StorePaymentPurposeType() string { return TypeStorePaymentPurposeStars } +// The user buying Telegram Stars for other users +type StorePaymentPurposeGiftedStars struct { + meta + // Identifier of the user to which Telegram Stars are gifted + UserId int64 `json:"user_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of bought Telegram Stars + StarCount int64 `json:"star_count"` +} + +func (entity *StorePaymentPurposeGiftedStars) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposeGiftedStars + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposeGiftedStars) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposeGiftedStars) GetType() string { + return TypeStorePaymentPurposeGiftedStars +} + +func (*StorePaymentPurposeGiftedStars) StorePaymentPurposeType() string { + return TypeStorePaymentPurposeGiftedStars +} + // The user creating Telegram Premium gift codes for other users type TelegramPaymentPurposePremiumGiftCodes struct { meta @@ -36777,14 +38285,14 @@ func (*TelegramPaymentPurposePremiumGiveaway) TelegramPaymentPurposeType() strin return TypeTelegramPaymentPurposePremiumGiveaway } -// The user buying Telegram stars +// The user buying Telegram Stars type TelegramPaymentPurposeStars struct { meta // ISO 4217 currency code of the payment currency Currency string `json:"currency"` // Paid amount, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of bought stars + // Number of bought Telegram Stars StarCount int64 `json:"star_count"` } @@ -36808,6 +38316,39 @@ func (*TelegramPaymentPurposeStars) TelegramPaymentPurposeType() string { return TypeTelegramPaymentPurposeStars } +// The user buying Telegram Stars for other users +type TelegramPaymentPurposeGiftedStars struct { + meta + // Identifier of the user to which Telegram Stars are gifted + UserId int64 `json:"user_id"` + // ISO 4217 currency code of the payment currency + Currency string `json:"currency"` + // Paid amount, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of bought Telegram Stars + StarCount int64 `json:"star_count"` +} + +func (entity *TelegramPaymentPurposeGiftedStars) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposeGiftedStars + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposeGiftedStars) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposeGiftedStars) GetType() string { + return TypeTelegramPaymentPurposeGiftedStars +} + +func (*TelegramPaymentPurposeGiftedStars) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposeGiftedStars +} + // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta @@ -37506,62 +39047,6 @@ func (*InputBackgroundPrevious) InputBackgroundType() string { return TypeInputBackgroundPrevious } -// Describes theme settings -type ThemeSettings struct { - meta - // Theme accent color in ARGB format - AccentColor int32 `json:"accent_color"` - // The background to be used in chats; may be null - Background *Background `json:"background"` - // The fill to be used as a background for outgoing messages - OutgoingMessageFill BackgroundFill `json:"outgoing_message_fill"` - // If true, the freeform gradient fill needs to be animated on every sent message - AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` - // Accent color of outgoing messages in ARGB format - OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` -} - -func (entity *ThemeSettings) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub ThemeSettings - - return json.Marshal((*stub)(entity)) -} - -func (*ThemeSettings) GetClass() string { - return ClassThemeSettings -} - -func (*ThemeSettings) GetType() string { - return TypeThemeSettings -} - -func (themeSettings *ThemeSettings) UnmarshalJSON(data []byte) error { - var tmp struct { - AccentColor int32 `json:"accent_color"` - Background *Background `json:"background"` - OutgoingMessageFill json.RawMessage `json:"outgoing_message_fill"` - AnimateOutgoingMessageFill bool `json:"animate_outgoing_message_fill"` - OutgoingMessageAccentColor int32 `json:"outgoing_message_accent_color"` - } - - err := json.Unmarshal(data, &tmp) - if err != nil { - return err - } - - themeSettings.AccentColor = tmp.AccentColor - themeSettings.Background = tmp.Background - themeSettings.AnimateOutgoingMessageFill = tmp.AnimateOutgoingMessageFill - themeSettings.OutgoingMessageAccentColor = tmp.OutgoingMessageAccentColor - - fieldOutgoingMessageFill, _ := UnmarshalBackgroundFill(tmp.OutgoingMessageFill) - themeSettings.OutgoingMessageFill = fieldOutgoingMessageFill - - return nil -} - // Describes a chat theme type ChatTheme struct { meta @@ -38594,7 +40079,7 @@ func (*PushMessageContentLocation) PushMessageContentType() string { // A message with paid media type PushMessageContentPaidMedia struct { meta - // Number of stars needed to buy access to the media in the message; 0 for pinned message + // Number of Telegram Stars needed to buy access to the media in the message; 0 for pinned message StarCount int64 `json:"star_count"` // True, if the message is a pinned message with the specified content IsPinned bool `json:"is_pinned"` @@ -41880,7 +43365,7 @@ func (*InternalLinkTypeActiveSessions) InternalLinkTypeType() string { return TypeInternalLinkTypeActiveSessions } -// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL +// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL type InternalLinkTypeAttachmentMenuBot struct { meta // Target chat to be opened @@ -42422,6 +43907,37 @@ func (*InternalLinkTypeLanguageSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeLanguageSettings } +// The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and open the returned URL as a Web App +type InternalLinkTypeMainWebApp struct { + meta + // Username of the bot + BotUsername string `json:"bot_username"` + // Start parameter to be passed to getMainWebApp + StartParameter string `json:"start_parameter"` + // True, if the Web App must be opened in the compact mode instead of the full-size mode + IsCompact bool `json:"is_compact"` +} + +func (entity *InternalLinkTypeMainWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeMainWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeMainWebApp) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeMainWebApp) GetType() string { + return TypeInternalLinkTypeMainWebApp +} + +func (*InternalLinkTypeMainWebApp) InternalLinkTypeType() string { + return TypeInternalLinkTypeMainWebApp +} + // The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there type InternalLinkTypeMessage struct { meta @@ -42707,6 +44223,8 @@ type InternalLinkTypePublicChat struct { ChatUsername string `json:"chat_username"` // Draft text for message to send in the chat DraftText string `json:"draft_text"` + // True, if chat profile information screen must be opened; otherwise, the chat itself must be opened + OpenProfile bool `json:"open_profile"` } func (entity *InternalLinkTypePublicChat) MarshalJSON() ([]byte, error) { @@ -42804,37 +44322,6 @@ func (*InternalLinkTypeSettings) InternalLinkTypeType() string { return TypeInternalLinkTypeSettings } -// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App -type InternalLinkTypeSideMenuBot struct { - meta - // Username of the bot - BotUsername string `json:"bot_username"` - // URL to be passed to getWebAppUrl - Url string `json:"url"` - // True, if the Web App must be opened in a compact mode instead of a full-size mode - IsCompact bool `json:"is_compact"` -} - -func (entity *InternalLinkTypeSideMenuBot) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub InternalLinkTypeSideMenuBot - - return json.Marshal((*stub)(entity)) -} - -func (*InternalLinkTypeSideMenuBot) GetClass() string { - return ClassInternalLinkType -} - -func (*InternalLinkTypeSideMenuBot) GetType() string { - return TypeInternalLinkTypeSideMenuBot -} - -func (*InternalLinkTypeSideMenuBot) InternalLinkTypeType() string { - return TypeInternalLinkTypeSideMenuBot -} - // The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet type InternalLinkTypeStickerSet struct { meta @@ -42893,7 +44380,7 @@ func (*InternalLinkTypeStory) InternalLinkTypeType() string { return TypeInternalLinkTypeStory } -// The link is a link to a theme. TDLib has no theme support yet +// The link is a link to a cloud theme. TDLib has no theme support yet type InternalLinkTypeTheme struct { meta // Name of the theme @@ -42997,13 +44484,15 @@ func (*InternalLinkTypeUnsupportedProxy) InternalLinkTypeType() string { return TypeInternalLinkTypeUnsupportedProxy } -// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open the chat. If draft text isn't empty, then put the draft text in the input field +// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field type InternalLinkTypeUserPhoneNumber struct { meta // Phone number of the user PhoneNumber string `json:"phone_number"` // Draft text for message to send in the chat DraftText string `json:"draft_text"` + // True, if user's profile information screen must be opened; otherwise, the chat itself must be opened + OpenProfile bool `json:"open_profile"` } func (entity *InternalLinkTypeUserPhoneNumber) MarshalJSON() ([]byte, error) { @@ -43084,7 +44573,7 @@ func (*InternalLinkTypeVideoChat) InternalLinkTypeType() string { return TypeInternalLinkTypeVideoChat } -// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App +// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party apps instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App type InternalLinkTypeWebApp struct { meta // Username of the bot that owns the Web App @@ -43093,7 +44582,7 @@ type InternalLinkTypeWebApp struct { WebAppShortName string `json:"web_app_short_name"` // Start parameter to be passed to getWebAppLinkUrl StartParameter string `json:"start_parameter"` - // True, if the Web App must be opened in a compact mode instead of a full-size mode + // True, if the Web App must be opened in the compact mode instead of the full-size mode IsCompact bool `json:"is_compact"` } @@ -43153,7 +44642,7 @@ type MessageLinkInfo struct { MessageThreadId int64 `json:"message_thread_id"` // If found, the linked message; may be null Message *Message `json:"message"` - // Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview + // 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"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` @@ -44713,6 +46202,31 @@ func (*TopChatCategoryInlineBots) TopChatCategoryType() string { return TypeTopChatCategoryInlineBots } +// A category containing frequently used chats with bots, which Web Apps were opened +type TopChatCategoryWebAppBots struct{ + meta +} + +func (entity *TopChatCategoryWebAppBots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TopChatCategoryWebAppBots + + return json.Marshal((*stub)(entity)) +} + +func (*TopChatCategoryWebAppBots) GetClass() string { + return ClassTopChatCategory +} + +func (*TopChatCategoryWebAppBots) GetType() string { + return TypeTopChatCategoryWebAppBots +} + +func (*TopChatCategoryWebAppBots) TopChatCategoryType() string { + return TypeTopChatCategoryWebAppBots +} + // A category containing frequently used chats used for calls type TopChatCategoryCalls struct{ meta @@ -46714,16 +48228,16 @@ func (*ChatRevenueTransactions) GetType() string { return TypeChatRevenueTransactions } -// Contains information about Telegram stars earned by a bot or a chat +// Contains information about Telegram Stars earned by a bot or a chat type StarRevenueStatus struct { meta - // Total number of the stars earned + // Total number of Telegram Stars earned TotalCount int64 `json:"total_count"` - // The number of Telegram stars that aren't withdrawn yet + // The number of Telegram Stars that aren't withdrawn yet CurrentCount int64 `json:"current_count"` - // The number of Telegram stars that are available for withdrawal + // The number of Telegram Stars that are available for withdrawal AvailableCount int64 `json:"available_count"` - // True, if Telegram stars can be withdrawn now or later + // True, if Telegram Stars can be withdrawn now or later WithdrawalEnabled bool `json:"withdrawal_enabled"` // Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now NextWithdrawalIn int32 `json:"next_withdrawal_in"` @@ -46745,14 +48259,14 @@ func (*StarRevenueStatus) GetType() string { return TypeStarRevenueStatus } -// A detailed statistics about Telegram stars earned by a bot or a chat +// A detailed statistics about Telegram Stars earned by a bot or a chat type StarRevenueStatistics struct { meta // A graph containing amount of revenue in a given day RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` - // Telegram star revenue status + // Telegram Star revenue status Status *StarRevenueStatus `json:"status"` - // Current conversion rate of a Telegram star to USD + // Current conversion rate of a Telegram Star to USD UsdRate float64 `json:"usd_rate"` } @@ -51057,10 +52571,10 @@ func (*UpdateSavedMessagesTags) UpdateType() string { return TypeUpdateSavedMessagesTags } -// The number of Telegram stars owned by the current user has changed +// The number of Telegram Stars owned by the current user has changed type UpdateOwnedStarCount struct { meta - // The new number of Telegram stars owned + // The new number of Telegram Stars owned StarCount int64 `json:"star_count"` } @@ -51113,12 +52627,12 @@ func (*UpdateChatRevenueAmount) UpdateType() string { return TypeUpdateChatRevenueAmount } -// The Telegram star revenue earned by a bot or a chat has changed. If star transactions screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +// The Telegram Star revenue earned by a bot or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions type UpdateStarRevenueStatus struct { meta - // Identifier of the owner of the Telegram stars + // Identifier of the owner of the Telegram Stars OwnerId MessageSender `json:"owner_id"` - // New Telegram star revenue status + // New Telegram Star revenue status Status *StarRevenueStatus `json:"status"` } diff --git a/client/unmarshaler.go b/client/unmarshaler.go index cf266e8..87e7ed3 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -723,6 +723,9 @@ func UnmarshalStarTransactionPartner(data json.RawMessage) (StarTransactionPartn case TypeStarTransactionPartnerChannel: return UnmarshalStarTransactionPartnerChannel(data) + case TypeStarTransactionPartnerUser: + return UnmarshalStarTransactionPartnerUser(data) + case TypeStarTransactionPartnerUnsupported: return UnmarshalStarTransactionPartnerUnsupported(data) @@ -2219,6 +2222,155 @@ func UnmarshalListOfPageBlock(dataList []json.RawMessage) ([]PageBlock, error) { return list, nil } +func UnmarshalLinkPreviewAlbumMedia(data json.RawMessage) (LinkPreviewAlbumMedia, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeLinkPreviewAlbumMediaPhoto: + return UnmarshalLinkPreviewAlbumMediaPhoto(data) + + case TypeLinkPreviewAlbumMediaVideo: + return UnmarshalLinkPreviewAlbumMediaVideo(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfLinkPreviewAlbumMedia(dataList []json.RawMessage) ([]LinkPreviewAlbumMedia, error) { + list := []LinkPreviewAlbumMedia{} + + for _, data := range dataList { + entity, err := UnmarshalLinkPreviewAlbumMedia(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeLinkPreviewTypeAlbum: + return UnmarshalLinkPreviewTypeAlbum(data) + + case TypeLinkPreviewTypeAnimation: + return UnmarshalLinkPreviewTypeAnimation(data) + + case TypeLinkPreviewTypeApp: + return UnmarshalLinkPreviewTypeApp(data) + + case TypeLinkPreviewTypeArticle: + return UnmarshalLinkPreviewTypeArticle(data) + + case TypeLinkPreviewTypeAudio: + return UnmarshalLinkPreviewTypeAudio(data) + + case TypeLinkPreviewTypeBackground: + return UnmarshalLinkPreviewTypeBackground(data) + + case TypeLinkPreviewTypeChannelBoost: + return UnmarshalLinkPreviewTypeChannelBoost(data) + + case TypeLinkPreviewTypeChat: + return UnmarshalLinkPreviewTypeChat(data) + + case TypeLinkPreviewTypeDocument: + return UnmarshalLinkPreviewTypeDocument(data) + + case TypeLinkPreviewTypeEmbeddedAnimationPlayer: + return UnmarshalLinkPreviewTypeEmbeddedAnimationPlayer(data) + + case TypeLinkPreviewTypeEmbeddedAudioPlayer: + return UnmarshalLinkPreviewTypeEmbeddedAudioPlayer(data) + + case TypeLinkPreviewTypeEmbeddedVideoPlayer: + return UnmarshalLinkPreviewTypeEmbeddedVideoPlayer(data) + + case TypeLinkPreviewTypeInvoice: + return UnmarshalLinkPreviewTypeInvoice(data) + + case TypeLinkPreviewTypeMessage: + return UnmarshalLinkPreviewTypeMessage(data) + + case TypeLinkPreviewTypePhoto: + return UnmarshalLinkPreviewTypePhoto(data) + + case TypeLinkPreviewTypePremiumGiftCode: + return UnmarshalLinkPreviewTypePremiumGiftCode(data) + + case TypeLinkPreviewTypeShareableChatFolder: + return UnmarshalLinkPreviewTypeShareableChatFolder(data) + + case TypeLinkPreviewTypeSticker: + return UnmarshalLinkPreviewTypeSticker(data) + + case TypeLinkPreviewTypeStickerSet: + return UnmarshalLinkPreviewTypeStickerSet(data) + + case TypeLinkPreviewTypeStory: + return UnmarshalLinkPreviewTypeStory(data) + + case TypeLinkPreviewTypeSupergroupBoost: + return UnmarshalLinkPreviewTypeSupergroupBoost(data) + + case TypeLinkPreviewTypeTheme: + return UnmarshalLinkPreviewTypeTheme(data) + + case TypeLinkPreviewTypeUnsupported: + return UnmarshalLinkPreviewTypeUnsupported(data) + + case TypeLinkPreviewTypeUser: + return UnmarshalLinkPreviewTypeUser(data) + + case TypeLinkPreviewTypeVideo: + return UnmarshalLinkPreviewTypeVideo(data) + + case TypeLinkPreviewTypeVideoChat: + return UnmarshalLinkPreviewTypeVideoChat(data) + + case TypeLinkPreviewTypeVideoNote: + return UnmarshalLinkPreviewTypeVideoNote(data) + + case TypeLinkPreviewTypeVoiceNote: + return UnmarshalLinkPreviewTypeVoiceNote(data) + + case TypeLinkPreviewTypeWebApp: + return UnmarshalLinkPreviewTypeWebApp(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfLinkPreviewType(dataList []json.RawMessage) ([]LinkPreviewType, error) { + list := []LinkPreviewType{} + + for _, data := range dataList { + entity, err := UnmarshalLinkPreviewType(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCollectibleItemType(data json.RawMessage) (CollectibleItemType, error) { var meta meta @@ -2957,6 +3109,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessagePaymentRefunded: + return UnmarshalMessagePaymentRefunded(data) + case TypeMessageGiftedPremium: return UnmarshalMessageGiftedPremium(data) @@ -2975,6 +3130,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessagePremiumGiveawayWinners: return UnmarshalMessagePremiumGiveawayWinners(data) + case TypeMessageGiftedStars: + return UnmarshalMessageGiftedStars(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -3601,6 +3759,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { case TypeStoryAreaTypeLink: return UnmarshalStoryAreaTypeLink(data) + case TypeStoryAreaTypeWeather: + return UnmarshalStoryAreaTypeWeather(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3647,6 +3808,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro case TypeInputStoryAreaTypeLink: return UnmarshalInputStoryAreaTypeLink(data) + case TypeInputStoryAreaTypeWeather: + return UnmarshalInputStoryAreaTypeWeather(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -5117,6 +5281,9 @@ func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, er case TypeStorePaymentPurposeStars: return UnmarshalStorePaymentPurposeStars(data) + case TypeStorePaymentPurposeGiftedStars: + return UnmarshalStorePaymentPurposeGiftedStars(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -5154,6 +5321,9 @@ func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpo case TypeTelegramPaymentPurposeStars: return UnmarshalTelegramPaymentPurposeStars(data) + case TypeTelegramPaymentPurposeGiftedStars: + return UnmarshalTelegramPaymentPurposeGiftedStars(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6329,6 +6499,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMainWebApp: + return UnmarshalInternalLinkTypeMainWebApp(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -6368,9 +6541,6 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) - case TypeInternalLinkTypeSideMenuBot: - return UnmarshalInternalLinkTypeSideMenuBot(data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) @@ -6723,6 +6893,9 @@ func UnmarshalTopChatCategory(data json.RawMessage) (TopChatCategory, error) { case TypeTopChatCategoryInlineBots: return UnmarshalTopChatCategoryInlineBots(data) + case TypeTopChatCategoryWebAppBots: + return UnmarshalTopChatCategoryWebAppBots(data) + case TypeTopChatCategoryCalls: return UnmarshalTopChatCategoryCalls(data) @@ -8942,6 +9115,14 @@ func UnmarshalStarTransactionPartnerChannel(data json.RawMessage) (*StarTransact return &resp, err } +func UnmarshalStarTransactionPartnerUser(data json.RawMessage) (*StarTransactionPartnerUser, error) { + var resp StarTransactionPartnerUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStarTransactionPartnerUnsupported(data json.RawMessage) (*StarTransactionPartnerUnsupported, error) { var resp StarTransactionPartnerUnsupported @@ -9102,6 +9283,14 @@ func UnmarshalUsers(data json.RawMessage) (*Users, error) { return &resp, err } +func UnmarshalFoundUsers(data json.RawMessage) (*FoundUsers, error) { + var resp FoundUsers + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatAdministrator(data json.RawMessage) (*ChatAdministrator, error) { var resp ChatAdministrator @@ -10662,6 +10851,14 @@ func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) { return &resp, err } +func UnmarshalMainWebApp(data json.RawMessage) (*MainWebApp, error) { + var resp MainWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) { var resp MessageThreadInfo @@ -10758,6 +10955,14 @@ func UnmarshalSharedChat(data json.RawMessage) (*SharedChat, error) { return &resp, err } +func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { + var resp ThemeSettings + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -11214,8 +11419,256 @@ func UnmarshalWebPageInstantView(data json.RawMessage) (*WebPageInstantView, err return &resp, err } -func UnmarshalWebPage(data json.RawMessage) (*WebPage, error) { - var resp WebPage +func UnmarshalLinkPreviewAlbumMediaPhoto(data json.RawMessage) (*LinkPreviewAlbumMediaPhoto, error) { + var resp LinkPreviewAlbumMediaPhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewAlbumMediaVideo(data json.RawMessage) (*LinkPreviewAlbumMediaVideo, error) { + var resp LinkPreviewAlbumMediaVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeAlbum(data json.RawMessage) (*LinkPreviewTypeAlbum, error) { + var resp LinkPreviewTypeAlbum + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeAnimation(data json.RawMessage) (*LinkPreviewTypeAnimation, error) { + var resp LinkPreviewTypeAnimation + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeApp(data json.RawMessage) (*LinkPreviewTypeApp, error) { + var resp LinkPreviewTypeApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeArticle(data json.RawMessage) (*LinkPreviewTypeArticle, error) { + var resp LinkPreviewTypeArticle + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeAudio(data json.RawMessage) (*LinkPreviewTypeAudio, error) { + var resp LinkPreviewTypeAudio + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeBackground(data json.RawMessage) (*LinkPreviewTypeBackground, error) { + var resp LinkPreviewTypeBackground + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeChannelBoost(data json.RawMessage) (*LinkPreviewTypeChannelBoost, error) { + var resp LinkPreviewTypeChannelBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeChat(data json.RawMessage) (*LinkPreviewTypeChat, error) { + var resp LinkPreviewTypeChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeDocument(data json.RawMessage) (*LinkPreviewTypeDocument, error) { + var resp LinkPreviewTypeDocument + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeEmbeddedAnimationPlayer(data json.RawMessage) (*LinkPreviewTypeEmbeddedAnimationPlayer, error) { + var resp LinkPreviewTypeEmbeddedAnimationPlayer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeEmbeddedAudioPlayer(data json.RawMessage) (*LinkPreviewTypeEmbeddedAudioPlayer, error) { + var resp LinkPreviewTypeEmbeddedAudioPlayer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeEmbeddedVideoPlayer(data json.RawMessage) (*LinkPreviewTypeEmbeddedVideoPlayer, error) { + var resp LinkPreviewTypeEmbeddedVideoPlayer + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeInvoice(data json.RawMessage) (*LinkPreviewTypeInvoice, error) { + var resp LinkPreviewTypeInvoice + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeMessage(data json.RawMessage) (*LinkPreviewTypeMessage, error) { + var resp LinkPreviewTypeMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypePhoto(data json.RawMessage) (*LinkPreviewTypePhoto, error) { + var resp LinkPreviewTypePhoto + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypePremiumGiftCode(data json.RawMessage) (*LinkPreviewTypePremiumGiftCode, error) { + var resp LinkPreviewTypePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeShareableChatFolder(data json.RawMessage) (*LinkPreviewTypeShareableChatFolder, error) { + var resp LinkPreviewTypeShareableChatFolder + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeSticker(data json.RawMessage) (*LinkPreviewTypeSticker, error) { + var resp LinkPreviewTypeSticker + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeStickerSet(data json.RawMessage) (*LinkPreviewTypeStickerSet, error) { + var resp LinkPreviewTypeStickerSet + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeStory(data json.RawMessage) (*LinkPreviewTypeStory, error) { + var resp LinkPreviewTypeStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeSupergroupBoost(data json.RawMessage) (*LinkPreviewTypeSupergroupBoost, error) { + var resp LinkPreviewTypeSupergroupBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeTheme(data json.RawMessage) (*LinkPreviewTypeTheme, error) { + var resp LinkPreviewTypeTheme + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeUnsupported(data json.RawMessage) (*LinkPreviewTypeUnsupported, error) { + var resp LinkPreviewTypeUnsupported + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeUser(data json.RawMessage) (*LinkPreviewTypeUser, error) { + var resp LinkPreviewTypeUser + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeVideo(data json.RawMessage) (*LinkPreviewTypeVideo, error) { + var resp LinkPreviewTypeVideo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeVideoChat(data json.RawMessage) (*LinkPreviewTypeVideoChat, error) { + var resp LinkPreviewTypeVideoChat + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeVideoNote(data json.RawMessage) (*LinkPreviewTypeVideoNote, error) { + var resp LinkPreviewTypeVideoNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeVoiceNote(data json.RawMessage) (*LinkPreviewTypeVoiceNote, error) { + var resp LinkPreviewTypeVoiceNote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreviewTypeWebApp(data json.RawMessage) (*LinkPreviewTypeWebApp, error) { + var resp LinkPreviewTypeWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalLinkPreview(data json.RawMessage) (*LinkPreview, error) { + var resp LinkPreview err := json.Unmarshal(data, &resp) @@ -12558,6 +13011,14 @@ func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePayment return &resp, err } +func UnmarshalMessagePaymentRefunded(data json.RawMessage) (*MessagePaymentRefunded, error) { + var resp MessagePaymentRefunded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) { var resp MessageGiftedPremium @@ -12606,6 +13067,14 @@ func UnmarshalMessagePremiumGiveawayWinners(data json.RawMessage) (*MessagePremi return &resp, err } +func UnmarshalMessageGiftedStars(data json.RawMessage) (*MessageGiftedStars, error) { + var resp MessageGiftedStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -13094,6 +13563,14 @@ func UnmarshalInputMessageForwarded(data json.RawMessage) (*InputMessageForwarde return &resp, err } +func UnmarshalMessageProperties(data json.RawMessage) (*MessageProperties, error) { + var resp MessageProperties + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalSearchMessagesFilterEmpty(data json.RawMessage) (*SearchMessagesFilterEmpty, error) { var resp SearchMessagesFilterEmpty @@ -13526,6 +14003,14 @@ func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTy return &resp, err } +func UnmarshalCurrentWeather(data json.RawMessage) (*CurrentWeather, error) { + var resp CurrentWeather + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) { var resp StoryAreaPosition @@ -13574,6 +14059,14 @@ func UnmarshalStoryAreaTypeLink(data json.RawMessage) (*StoryAreaTypeLink, error return &resp, err } +func UnmarshalStoryAreaTypeWeather(data json.RawMessage) (*StoryAreaTypeWeather, error) { + var resp StoryAreaTypeWeather + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { var resp StoryArea @@ -13630,6 +14123,14 @@ func UnmarshalInputStoryAreaTypeLink(data json.RawMessage) (*InputStoryAreaTypeL return &resp, err } +func UnmarshalInputStoryAreaTypeWeather(data json.RawMessage) (*InputStoryAreaTypeWeather, error) { + var resp InputStoryAreaTypeWeather + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { var resp InputStoryArea @@ -13878,6 +14379,30 @@ func UnmarshalPublicForwards(data json.RawMessage) (*PublicForwards, error) { return &resp, err } +func UnmarshalBotMediaPreview(data json.RawMessage) (*BotMediaPreview, error) { + var resp BotMediaPreview + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotMediaPreviews(data json.RawMessage) (*BotMediaPreviews, error) { + var resp BotMediaPreviews + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotMediaPreviewInfo(data json.RawMessage) (*BotMediaPreviewInfo, error) { + var resp BotMediaPreviewInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatBoostLevelFeatures(data json.RawMessage) (*ChatBoostLevelFeatures, error) { var resp ChatBoostLevelFeatures @@ -15878,6 +16403,14 @@ func UnmarshalStorePaymentPurposeStars(data json.RawMessage) (*StorePaymentPurpo return &resp, err } +func UnmarshalStorePaymentPurposeGiftedStars(data json.RawMessage) (*StorePaymentPurposeGiftedStars, error) { + var resp StorePaymentPurposeGiftedStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTelegramPaymentPurposePremiumGiftCodes(data json.RawMessage) (*TelegramPaymentPurposePremiumGiftCodes, error) { var resp TelegramPaymentPurposePremiumGiftCodes @@ -15902,6 +16435,14 @@ func UnmarshalTelegramPaymentPurposeStars(data json.RawMessage) (*TelegramPaymen return &resp, err } +func UnmarshalTelegramPaymentPurposeGiftedStars(data json.RawMessage) (*TelegramPaymentPurposeGiftedStars, error) { + var resp TelegramPaymentPurposeGiftedStars + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { var resp DeviceTokenFirebaseCloudMessaging @@ -16086,14 +16627,6 @@ func UnmarshalInputBackgroundPrevious(data json.RawMessage) (*InputBackgroundPre return &resp, err } -func UnmarshalThemeSettings(data json.RawMessage) (*ThemeSettings, error) { - var resp ThemeSettings - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalChatTheme(data json.RawMessage) (*ChatTheme, error) { var resp ChatTheme @@ -17486,6 +18019,14 @@ func UnmarshalInternalLinkTypeLanguageSettings(data json.RawMessage) (*InternalL return &resp, err } +func UnmarshalInternalLinkTypeMainWebApp(data json.RawMessage) (*InternalLinkTypeMainWebApp, error) { + var resp InternalLinkTypeMainWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeMessage(data json.RawMessage) (*InternalLinkTypeMessage, error) { var resp InternalLinkTypeMessage @@ -17590,14 +18131,6 @@ func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeS return &resp, err } -func UnmarshalInternalLinkTypeSideMenuBot(data json.RawMessage) (*InternalLinkTypeSideMenuBot, error) { - var resp InternalLinkTypeSideMenuBot - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalInternalLinkTypeStickerSet(data json.RawMessage) (*InternalLinkTypeStickerSet, error) { var resp InternalLinkTypeStickerSet @@ -18142,6 +18675,14 @@ func UnmarshalTopChatCategoryInlineBots(data json.RawMessage) (*TopChatCategoryI return &resp, err } +func UnmarshalTopChatCategoryWebAppBots(data json.RawMessage) (*TopChatCategoryWebAppBots, error) { + var resp TopChatCategoryWebAppBots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTopChatCategoryCalls(data json.RawMessage) (*TopChatCategoryCalls, error) { var resp TopChatCategoryCalls @@ -20508,6 +21049,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionPartnerChannel: return UnmarshalStarTransactionPartnerChannel(data) + case TypeStarTransactionPartnerUser: + return UnmarshalStarTransactionPartnerUser(data) + case TypeStarTransactionPartnerUnsupported: return UnmarshalStarTransactionPartnerUnsupported(data) @@ -20568,6 +21112,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUsers: return UnmarshalUsers(data) + case TypeFoundUsers: + return UnmarshalFoundUsers(data) + case TypeChatAdministrator: return UnmarshalChatAdministrator(data) @@ -21153,6 +21700,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeWebAppInfo: return UnmarshalWebAppInfo(data) + case TypeMainWebApp: + return UnmarshalMainWebApp(data) + case TypeMessageThreadInfo: return UnmarshalMessageThreadInfo(data) @@ -21189,6 +21739,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSharedChat: return UnmarshalSharedChat(data) + case TypeThemeSettings: + return UnmarshalThemeSettings(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -21360,8 +21913,101 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeWebPageInstantView: return UnmarshalWebPageInstantView(data) - case TypeWebPage: - return UnmarshalWebPage(data) + case TypeLinkPreviewAlbumMediaPhoto: + return UnmarshalLinkPreviewAlbumMediaPhoto(data) + + case TypeLinkPreviewAlbumMediaVideo: + return UnmarshalLinkPreviewAlbumMediaVideo(data) + + case TypeLinkPreviewTypeAlbum: + return UnmarshalLinkPreviewTypeAlbum(data) + + case TypeLinkPreviewTypeAnimation: + return UnmarshalLinkPreviewTypeAnimation(data) + + case TypeLinkPreviewTypeApp: + return UnmarshalLinkPreviewTypeApp(data) + + case TypeLinkPreviewTypeArticle: + return UnmarshalLinkPreviewTypeArticle(data) + + case TypeLinkPreviewTypeAudio: + return UnmarshalLinkPreviewTypeAudio(data) + + case TypeLinkPreviewTypeBackground: + return UnmarshalLinkPreviewTypeBackground(data) + + case TypeLinkPreviewTypeChannelBoost: + return UnmarshalLinkPreviewTypeChannelBoost(data) + + case TypeLinkPreviewTypeChat: + return UnmarshalLinkPreviewTypeChat(data) + + case TypeLinkPreviewTypeDocument: + return UnmarshalLinkPreviewTypeDocument(data) + + case TypeLinkPreviewTypeEmbeddedAnimationPlayer: + return UnmarshalLinkPreviewTypeEmbeddedAnimationPlayer(data) + + case TypeLinkPreviewTypeEmbeddedAudioPlayer: + return UnmarshalLinkPreviewTypeEmbeddedAudioPlayer(data) + + case TypeLinkPreviewTypeEmbeddedVideoPlayer: + return UnmarshalLinkPreviewTypeEmbeddedVideoPlayer(data) + + case TypeLinkPreviewTypeInvoice: + return UnmarshalLinkPreviewTypeInvoice(data) + + case TypeLinkPreviewTypeMessage: + return UnmarshalLinkPreviewTypeMessage(data) + + case TypeLinkPreviewTypePhoto: + return UnmarshalLinkPreviewTypePhoto(data) + + case TypeLinkPreviewTypePremiumGiftCode: + return UnmarshalLinkPreviewTypePremiumGiftCode(data) + + case TypeLinkPreviewTypeShareableChatFolder: + return UnmarshalLinkPreviewTypeShareableChatFolder(data) + + case TypeLinkPreviewTypeSticker: + return UnmarshalLinkPreviewTypeSticker(data) + + case TypeLinkPreviewTypeStickerSet: + return UnmarshalLinkPreviewTypeStickerSet(data) + + case TypeLinkPreviewTypeStory: + return UnmarshalLinkPreviewTypeStory(data) + + case TypeLinkPreviewTypeSupergroupBoost: + return UnmarshalLinkPreviewTypeSupergroupBoost(data) + + case TypeLinkPreviewTypeTheme: + return UnmarshalLinkPreviewTypeTheme(data) + + case TypeLinkPreviewTypeUnsupported: + return UnmarshalLinkPreviewTypeUnsupported(data) + + case TypeLinkPreviewTypeUser: + return UnmarshalLinkPreviewTypeUser(data) + + case TypeLinkPreviewTypeVideo: + return UnmarshalLinkPreviewTypeVideo(data) + + case TypeLinkPreviewTypeVideoChat: + return UnmarshalLinkPreviewTypeVideoChat(data) + + case TypeLinkPreviewTypeVideoNote: + return UnmarshalLinkPreviewTypeVideoNote(data) + + case TypeLinkPreviewTypeVoiceNote: + return UnmarshalLinkPreviewTypeVoiceNote(data) + + case TypeLinkPreviewTypeWebApp: + return UnmarshalLinkPreviewTypeWebApp(data) + + case TypeLinkPreview: + return UnmarshalLinkPreview(data) case TypeCountryInfo: return UnmarshalCountryInfo(data) @@ -21864,6 +22510,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePaymentSuccessfulBot: return UnmarshalMessagePaymentSuccessfulBot(data) + case TypeMessagePaymentRefunded: + return UnmarshalMessagePaymentRefunded(data) + case TypeMessageGiftedPremium: return UnmarshalMessageGiftedPremium(data) @@ -21882,6 +22531,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessagePremiumGiveawayWinners: return UnmarshalMessagePremiumGiveawayWinners(data) + case TypeMessageGiftedStars: + return UnmarshalMessageGiftedStars(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -22065,6 +22717,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageForwarded: return UnmarshalInputMessageForwarded(data) + case TypeMessageProperties: + return UnmarshalMessageProperties(data) + case TypeSearchMessagesFilterEmpty: return UnmarshalSearchMessagesFilterEmpty(data) @@ -22227,6 +22882,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeEmojiCategoryTypeChatPhoto: return UnmarshalEmojiCategoryTypeChatPhoto(data) + case TypeCurrentWeather: + return UnmarshalCurrentWeather(data) + case TypeStoryAreaPosition: return UnmarshalStoryAreaPosition(data) @@ -22245,6 +22903,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryAreaTypeLink: return UnmarshalStoryAreaTypeLink(data) + case TypeStoryAreaTypeWeather: + return UnmarshalStoryAreaTypeWeather(data) + case TypeStoryArea: return UnmarshalStoryArea(data) @@ -22266,6 +22927,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputStoryAreaTypeLink: return UnmarshalInputStoryAreaTypeLink(data) + case TypeInputStoryAreaTypeWeather: + return UnmarshalInputStoryAreaTypeWeather(data) + case TypeInputStoryArea: return UnmarshalInputStoryArea(data) @@ -22359,6 +23023,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePublicForwards: return UnmarshalPublicForwards(data) + case TypeBotMediaPreview: + return UnmarshalBotMediaPreview(data) + + case TypeBotMediaPreviews: + return UnmarshalBotMediaPreviews(data) + + case TypeBotMediaPreviewInfo: + return UnmarshalBotMediaPreviewInfo(data) + case TypeChatBoostLevelFeatures: return UnmarshalChatBoostLevelFeatures(data) @@ -23109,6 +23782,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStorePaymentPurposeStars: return UnmarshalStorePaymentPurposeStars(data) + case TypeStorePaymentPurposeGiftedStars: + return UnmarshalStorePaymentPurposeGiftedStars(data) + case TypeTelegramPaymentPurposePremiumGiftCodes: return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) @@ -23118,6 +23794,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTelegramPaymentPurposeStars: return UnmarshalTelegramPaymentPurposeStars(data) + case TypeTelegramPaymentPurposeGiftedStars: + return UnmarshalTelegramPaymentPurposeGiftedStars(data) + case TypeDeviceTokenFirebaseCloudMessaging: return UnmarshalDeviceTokenFirebaseCloudMessaging(data) @@ -23187,9 +23866,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputBackgroundPrevious: return UnmarshalInputBackgroundPrevious(data) - case TypeThemeSettings: - return UnmarshalThemeSettings(data) - case TypeChatTheme: return UnmarshalChatTheme(data) @@ -23712,6 +24388,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeLanguageSettings: return UnmarshalInternalLinkTypeLanguageSettings(data) + case TypeInternalLinkTypeMainWebApp: + return UnmarshalInternalLinkTypeMainWebApp(data) + case TypeInternalLinkTypeMessage: return UnmarshalInternalLinkTypeMessage(data) @@ -23751,9 +24430,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeSettings: return UnmarshalInternalLinkTypeSettings(data) - case TypeInternalLinkTypeSideMenuBot: - return UnmarshalInternalLinkTypeSideMenuBot(data) - case TypeInternalLinkTypeStickerSet: return UnmarshalInternalLinkTypeStickerSet(data) @@ -23958,6 +24634,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTopChatCategoryInlineBots: return UnmarshalTopChatCategoryInlineBots(data) + case TypeTopChatCategoryWebAppBots: + return UnmarshalTopChatCategoryWebAppBots(data) + case TypeTopChatCategoryCalls: return UnmarshalTopChatCategoryCalls(data) diff --git a/data/td_api.tl b/data/td_api.tl index 2a28b78..b6cdc87 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -572,12 +572,14 @@ userTypeDeleted = UserType; //@can_be_edited True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription //@can_join_groups True, if the bot can be invited to basic group and supergroup chats //@can_read_all_group_messages True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages +//@has_main_web_app True, if the bot has the main Web App //@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 -userTypeBot can_be_edited:Bool can_join_groups:Bool can_read_all_group_messages:Bool is_inline:Bool inline_query_placeholder:string need_location:Bool can_connect_to_business:Bool can_be_added_to_attachment_menu:Bool = UserType; +//@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 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; @@ -774,12 +776,12 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; //@can_send_animations True, if the user can send animations. Implies can_send_messages permissions //@can_send_games True, if the user can send games. Implies can_send_messages permissions //@can_use_inline_bots True, if the user can use inline bots. Implies can_send_messages permissions -//@can_add_web_page_previews True, if the user may add a web page preview to their messages +//@can_add_link_previews True, if the user may add a link preview to their messages //@can_change_info True, if the user can change the chat title, photo, and other settings //@can_invite_users True, if the user can invite new users to the chat //@can_pin_messages True, if the user can pin messages //@can_create_topics True, if the user can create topics -chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_stickers:Bool can_send_animations:Bool can_send_games:Bool can_use_inline_bots:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_create_topics:Bool = ChatPermissions; +chatPermissions can_send_basic_messages:Bool can_send_audios:Bool can_send_documents:Bool can_send_photos:Bool can_send_videos:Bool can_send_video_notes:Bool can_send_voice_notes:Bool can_send_polls:Bool can_send_stickers:Bool can_send_animations:Bool can_send_games:Bool can_use_inline_bots:Bool can_add_link_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_create_topics:Bool = ChatPermissions; //@description Describes rights of the administrator //@can_manage_chat True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only @@ -845,28 +847,28 @@ premiumGiftCodePaymentOptions options:vector = Pre //@use_date Point in time (Unix timestamp) when the code was activated; 0 if none premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveaway:Bool giveaway_message_id:int53 month_count:int32 user_id:int53 use_date:int32 = PremiumGiftCodeInfo; -//@description Describes an option for buying Telegram stars. Use telegramPaymentPurposeStars for out-of-store payments +//@description Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments //@currency ISO 4217 currency code for the payment //@amount The amount to pay, in the smallest units of the currency -//@star_count Number of Telegram stars that will be purchased +//@star_count Number of Telegram Stars that will be purchased //@store_product_id Identifier of the store product associated with the option; may be empty if none //@is_additional True, if the option must be shown only in the full list of payment options starPaymentOption currency:string amount:int53 star_count:int53 store_product_id:string is_additional:Bool = StarPaymentOption; -//@description Contains a list of options for buying Telegram stars @options The list of options +//@description Contains a list of options for buying Telegram Stars @options The list of options starPaymentOptions options:vector = StarPaymentOptions; -//@class StarTransactionDirection @description Describes direction of a transaction with Telegram stars +//@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars -//@description The transaction is incoming and increases the number of owned Telegram stars +//@description The transaction is incoming and increases the number of owned Telegram Stars starTransactionDirectionIncoming = StarTransactionDirection; -//@description The transaction is outgoing and decreases the number of owned Telegram stars +//@description The transaction is outgoing and decreases the number of owned Telegram Stars starTransactionDirectionOutgoing = StarTransactionDirection; -//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram stars +//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram Stars //@description The transaction is a transaction with Telegram through a bot starTransactionPartnerTelegram = StarTransactionPartner; @@ -884,10 +886,10 @@ starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTra starTransactionPartnerTelegramAds = StarTransactionPartner; //@description The transaction is a transaction with a bot -//@bot_user_id Identifier of the bot +//@user_id Identifier of the bot for the user, or the user for the bot //@product_info Information about the bought product; may be null if not applicable //@invoice_payload Invoice payload; for bots only -starTransactionPartnerBot bot_user_id:int53 product_info:productInfo invoice_payload:bytes = StarTransactionPartner; +starTransactionPartnerBot user_id:int53 product_info:productInfo invoice_payload:bytes = StarTransactionPartner; //@description The transaction is a transaction with a channel chat //@chat_id Identifier of the chat @@ -895,21 +897,26 @@ starTransactionPartnerBot bot_user_id:int53 product_info:productInfo invoice_pay //@media Information about the bought media starTransactionPartnerChannel chat_id:int53 paid_media_message_id:int53 media:vector = StarTransactionPartner; +//@description The transaction is a gift of Telegram Stars from another user +//@user_id Identifier of the user; 0 if the gift was anonymous +//@sticker A sticker to be shown in the transaction information; may be null if unknown +starTransactionPartnerUser user_id:int53 sticker:sticker = StarTransactionPartner; + //@description The transaction is a transaction with unknown partner starTransactionPartnerUnsupported = StarTransactionPartner; -//@description Represents a transaction changing the amount of owned Telegram stars +//@description Represents a transaction changing the amount of owned Telegram Stars //@id Unique identifier of the transaction -//@star_count The amount of added owned Telegram stars; negative for outgoing transactions +//@star_count The amount of added owned Telegram Stars; negative for outgoing transactions //@is_refund True, if the transaction is a refund of a previous transaction //@date Point in time (Unix timestamp) when the transaction was completed //@partner Source of the incoming transaction, or its recipient for outgoing transactions starTransaction id:string star_count:int53 is_refund:Bool date:int32 partner:StarTransactionPartner = StarTransaction; -//@description Represents a list of Telegram star transactions -//@star_count The amount of owned Telegram stars -//@transactions List of transactions with Telegram stars +//@description Represents a list of Telegram Star transactions +//@star_count The amount of owned Telegram Stars +//@transactions List of transactions with Telegram Stars //@next_offset The offset for the next request. If empty, then there are no more results starTransactions star_count:int53 transactions:vector next_offset:string = StarTransactions; @@ -1031,11 +1038,12 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use //@commands List of the bot commands //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null +//@has_media_previews True, if the bot has media previews //@edit_commands_link The internal link, which can be used to edit bot commands; may be null //@edit_description_link The internal link, which can be used to edit bot description; may be null //@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null //@edit_settings_link The internal link, which can be used to edit bot settings; may be null -botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; +botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights 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. @@ -1066,6 +1074,9 @@ userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto blo //@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; +//@description Represents a list of found users @user_ids Identifiers of the found users @next_offset The offset for the next request. If empty, then there are no more results +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; @@ -1278,7 +1289,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through //-getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, //-getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, -//-or for chats with messages or stories from publicForwards +//-or for chats with messages or stories from publicForwards and foundStories //@boost_level Approximate boost level for the chat //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup @@ -1314,6 +1325,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available //@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available +//@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators @@ -1330,7 +1342,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1512,7 +1524,7 @@ messageSendingStatePending sending_id:int32 = MessageSendingState; //@description The message failed to be sent //@error The cause of the message sending failure -//@can_retry True, if the message can be re-sent +//@can_retry True, if the message can be re-sent using resendMessages or readdQuickReplyShortcutMessages //@need_another_sender True, if the message can be re-sent only on behalf of a different sender //@need_another_reply_quote True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message //@need_drop_reply True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages @@ -1553,13 +1565,13 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@class InputMessageReplyTo @description Contains information about the message or the story to be replied //@description Describes a message to be replied in the same chat and forum topic -//@message_id The identifier of the message to be replied in the same chat and forum topic +//@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 inputMessageReplyToMessage message_id:int53 quote:inputTextQuote = 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 topic only if message.can_be_replied_in_another_chat +//@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 inputMessageReplyToExternalMessage chat_id:int53 message_id:int53 quote:inputTextQuote = InputMessageReplyTo; @@ -1584,19 +1596,7 @@ factCheck text:formattedText country_code:string = FactCheck; //@is_outgoing True, if the message is outgoing //@is_pinned True, if the message is pinned //@is_from_offline True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message -//@can_be_edited True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application -//@can_be_forwarded True, if the message can be forwarded -//@can_be_replied_in_another_chat True, if the message can be replied in another chat or topic //@can_be_saved True, if content of the message can be saved locally or copied -//@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it -//@can_be_deleted_for_all_users True, if the message can be deleted for all users -//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions -//@can_get_statistics True, if the message statistics are available through getMessageStatistics -//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory -//@can_get_read_date True, if read date of the message can be received through getMessageReadDate -//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers -//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink -//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts //@is_topic_message True, if the message is a forum topic message @@ -1623,7 +1623,8 @@ factCheck text:formattedText country_code:string = FactCheck; //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null if none -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied_in_another_chat:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_read_date:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 author_signature:string media_album_id:int64 effect_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool is_from_offline:Bool can_be_saved:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo import_info:messageImportInfo interaction_info:messageInteractionInfo unread_reactions:vector fact_check:factCheck reply_to:MessageReplyTo message_thread_id:int53 saved_messages_topic_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 sender_business_bot_user_id:int53 sender_boost_count:int32 author_signature:string media_album_id:int64 effect_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; + //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -2204,13 +2205,16 @@ foundWebApp web_app:webApp request_write_access:Bool skip_confirmation:Bool = Fo //@description Contains information about a Web App @launch_id Unique identifier for the Web App launch @url A Web App URL to open in a web view webAppInfo launch_id:int64 url:string = WebAppInfo; +//@description Contains information about the main Web App of a bot @url URL of the Web App to open @is_compact True, if the Web App must always be opened in the compact mode instead of the full-size mode +mainWebApp url:string is_compact:Bool = MainWebApp; + //@description Contains information about a message thread //@chat_id Identifier of the chat to which the message thread belongs //@message_thread_id Message thread identifier, unique within the chat //@reply_info Information about the message thread; may be null for forum topic threads //@unread_message_count Approximate number of unread messages in the message thread -//@messages The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +//@messages The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) //@draft_message A draft of a message in the message thread; may be null if none messageThreadInfo chat_id:int53 message_thread_id:int53 reply_info:messageReplyInfo unread_message_count:int32 messages:vector draft_message:draftMessage = MessageThreadInfo; @@ -2299,7 +2303,16 @@ 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 RichText @description Describes a text object inside an instant-view web page +//@description Describes theme settings +//@accent_color Theme accent color in ARGB format +//@background The background to be used in chats; may be null +//@outgoing_message_fill The fill to be used as a background for outgoing messages +//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message +//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format +themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings; + + +//@class RichText @description Describes a formatted text object //@description A plain text @text Text richTextPlain text:string = RichText; @@ -2343,20 +2356,20 @@ richTextPhoneNumber text:RichText phone_number:string = RichText; //@height Height of a bounding box in which the image must be shown; 0 if unknown richTextIcon document:document width:int32 height:int32 = RichText; -//@description A reference to a richTexts object on the same web page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference +//@description A reference to a richTexts object on the same page @text The text @anchor_name The name of a richTextAnchor object, which is the first element of the target richTexts object @url An HTTP URL, opening the reference richTextReference text:RichText anchor_name:string url:string = RichText; //@description An anchor @name Anchor name richTextAnchor name:string = RichText; -//@description A link to an anchor on the same web page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL, opening the anchor +//@description A link to an anchor on the same page @text The link text @anchor_name The anchor name. If the name is empty, the link must bring back to top @url An HTTP URL, opening the anchor richTextAnchorLink text:RichText anchor_name:string url:string = RichText; //@description A concatenation of rich texts @texts Texts richTexts texts:vector = RichText; -//@description Contains a caption of an instant view web page block, consisting of a text and a trailing credit @text Content of the caption @credit Block credit (like HTML tag ) +//@description Contains a caption of another block @text Content of the caption @credit Block credit (like HTML tag ) pageBlockCaption text:RichText credit:RichText = PageBlockCaption; //@description Describes an item of a list page block @label Item label @page_blocks Item blocks @@ -2403,7 +2416,7 @@ pageBlockTableCell text:RichText is_header:Bool colspan:int32 rowspan:int32 alig pageBlockRelatedArticle url:string title:string description:string photo:photo author:string publish_date:int32 = PageBlockRelatedArticle; -//@class PageBlock @description Describes a block of an instant view web page +//@class PageBlock @description Describes a block of an instant view for a web page //@description The title of a page @title Title pageBlockTitle title:RichText = PageBlock; @@ -2485,7 +2498,7 @@ pageBlockVoiceNote voice_note:voiceNote caption:pageBlockCaption = PageBlock; pageBlockCover cover:PageBlock = PageBlock; //@description An embedded web page -//@url Web page URL, if available +//@url URL of the embedded page, if available //@html HTML-markup of the embedded page //@poster_photo Poster photo, if available; may be null //@width Block width; 0 if unknown @@ -2496,7 +2509,7 @@ pageBlockCover cover:PageBlock = PageBlock; pageBlockEmbedded url:string html:string poster_photo:photo width:int32 height:int32 caption:pageBlockCaption is_full_width:Bool allow_scrolling:Bool = PageBlock; //@description An embedded post -//@url Web page URL +//@url URL of the embedded post //@author Post author //@author_photo Post author photo; may be null //@date Point in time (Unix timestamp) when the post was created; 0 if unknown @@ -2549,45 +2562,163 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB //@description Describes an instant view page for a web page -//@page_blocks Content of the web page +//@page_blocks Content of the instant view page //@view_count Number of the instant view views; 0 if unknown //@version Version of the instant view; currently, can be 1 or 2 //@is_rtl True, if the instant view must be shown from right to left -//@is_full True, if the instant view contains the full page. A network request might be needed to get the full web page instant view +//@is_full True, if the instant view contains the full page. A network request might be needed to get the full instant view //@feedback_link An internal link to be opened to leave feedback about the instant view webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; +//@class LinkPreviewAlbumMedia @description Describes a media from a link preview album + +//@description The media is a photo @photo Photo description +linkPreviewAlbumMediaPhoto photo:photo = LinkPreviewAlbumMedia; + +//@description The media is a video @video Video description +linkPreviewAlbumMediaVideo video:video = LinkPreviewAlbumMedia; + + +//@class LinkPreviewType @description Describes type of link preview + +//@description The link is a link to a media album consisting of photos and videos @media The list of album media @caption Album caption +linkPreviewTypeAlbum media:vector caption:string = LinkPreviewType; + +//@description The link is a link to an animation @animation The animation @author Author of the animation +linkPreviewTypeAnimation animation:animation author:string = LinkPreviewType; + +//@description The link is a link to an app at App Store or Google Play @photo Photo for the app @author Author of the app +linkPreviewTypeApp photo:photo author:string = LinkPreviewType; + +//@description The link is a link to a web site @photo Article's main photo; may be null @author Author of the article +linkPreviewTypeArticle photo:photo author:string = LinkPreviewType; + +//@description The link is a link to an audio +//@url URL of the audio; may be empty if none +//@mime_type MIME type of the audio file +//@audio The audio description; may be null if unknown +//@duration Duration of the audio, in seconds; 0 if unknown +//@author Author of the audio +linkPreviewTypeAudio url:string mime_type:string audio:audio duration:int32 author:string = LinkPreviewType; + +//@description The link is a link to a background. Link preview title and description are available only for filled backgrounds @document Document with the background; may be null for filled backgrounds +linkPreviewTypeBackground document:document = LinkPreviewType; + +//@description The link is a link to boost a channel chat @photo Photo of the chat; may be null +linkPreviewTypeChannelBoost photo:chatPhoto = LinkPreviewType; + +//@description The link is a link to a chat +//@type Type of the chat +//@photo Photo of the chat; may be null +//@creates_join_request True, if the link only creates join request +linkPreviewTypeChat type:InviteLinkChatType photo:chatPhoto creates_join_request:Bool = LinkPreviewType; + +//@description The link is a link to a general file @document The document description @author Author of the document +linkPreviewTypeDocument document:document author:string = LinkPreviewType; + +//@description The link is a link to an animation player +//@url URL of the external animation player +//@thumbnail Thumbnail of the animation; may be null if unknown +//@duration Duration of the animation, in seconds +//@author Author of the animation +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedAnimationPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to an audio player +//@url URL of the external audio player +//@thumbnail Thumbnail of the audio; may be null if unknown +//@duration Duration of the audio, in seconds +//@author Author of the audio +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedAudioPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to a video player +//@url URL of the external video player +//@thumbnail Thumbnail of the video; may be null if unknown +//@duration Duration of the video, in seconds +//@author Author of the video +//@width Expected width of the embedded player +//@height Expected height of the embedded player +linkPreviewTypeEmbeddedVideoPlayer url:string thumbnail:photo duration:int32 author:string width:int32 height:int32 = LinkPreviewType; + +//@description The link is a link to an invoice +linkPreviewTypeInvoice = LinkPreviewType; + +//@description The link is a link to a text or a poll Telegram message +linkPreviewTypeMessage = LinkPreviewType; + +//@description The link is a link to a photo @photo The photo @author Author of the photo +linkPreviewTypePhoto photo:photo author:string = LinkPreviewType; + +//@description The link is a link to a Telegram Premium gift code +linkPreviewTypePremiumGiftCode = LinkPreviewType; + +//@description The link is a link to a shareable chat folder +linkPreviewTypeShareableChatFolder = LinkPreviewType; + +//@description The link is a link to a sticker message @sticker The sticker +linkPreviewTypeSticker sticker:sticker = LinkPreviewType; + +//@description The link is a link to a sticker set @stickers Up to 4 stickers from the sticker set +linkPreviewTypeStickerSet stickers:vector = LinkPreviewType; + +//@description The link is a link to a story. Link preview description is unavailable @story_sender_chat_id The identifier of the chat that posted the story @story_id Story identifier +linkPreviewTypeStory story_sender_chat_id:int53 story_id:int32 = LinkPreviewType; + +//@description The link is a link to boost a supergroup chat @photo Photo of the chat; may be null +linkPreviewTypeSupergroupBoost photo:chatPhoto = LinkPreviewType; + +//@description The link is a link to a cloud theme. TDLib has no theme support yet @documents The list of files with theme description @settings Settings for the cloud theme +linkPreviewTypeTheme documents:vector settings:themeSettings = LinkPreviewType; + +//@description The link preview type is unsupported yet +linkPreviewTypeUnsupported = LinkPreviewType; + +//@description The link is a link to a user @photo Photo of the user; may be null if none @is_bot True, if the user is a bot +linkPreviewTypeUser photo:chatPhoto is_bot:Bool = LinkPreviewType; + +//@description The link is a link to a video +//@url URL of the video; may be empty if none +//@mime_type MIME type of the video file +//@video The video description; may be null if unknown +//@width Expected width of the preview +//@height Expected height of the preview +//@duration Duration of the video, in seconds; 0 if unknown +//@author Author of the video +linkPreviewTypeVideo url:string mime_type:string video:video width:int32 height:int32 duration:int32 author:string = LinkPreviewType; + +//@description The link is a link to a video chat +//@photo Photo of the chat with the video chat; may be null if none +//@is_live_stream True, if the video chat is expected to be a live stream in a channel or a broadcast group +linkPreviewTypeVideoChat photo:chatPhoto is_live_stream:Bool = LinkPreviewType; + +//@description The link is a link to a video note message @video_note The video note +linkPreviewTypeVideoNote video_note:videoNote = LinkPreviewType; + +//@description The link is a link to a voice note message @voice_note The voice note +linkPreviewTypeVoiceNote voice_note:voiceNote = LinkPreviewType; + +//@description The link is a link to a Web App @photo Web App photo +linkPreviewTypeWebApp photo:photo = LinkPreviewType; + + //@description Describes a link preview //@url Original URL of the link //@display_url URL to display -//@type Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else //@site_name Short name of the site (e.g., Google Docs, App Store) //@title Title of the content //@param_description Description of the content -//@photo Image representing the content; may be null -//@embed_url URL to show in the embedded preview -//@embed_type MIME type of the embedded preview, (e.g., text/html or video/mp4) -//@embed_width Width of the embedded preview -//@embed_height Height of the embedded preview -//@duration Duration of the content, in seconds -//@author Author of the content +//@type Type of the link preview //@has_large_media True, if size of media in the preview can be changed //@show_large_media True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos +//@show_media_above_description True, if media must be shown above link preview description; otherwise, the media must be shown below the description //@skip_confirmation True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear //@show_above_text True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text -//@animation Preview of the content as an animation, if available; may be null -//@audio Preview of the content as an audio file, if available; may be null -//@document Preview of the content as a document, if available; may be null -//@sticker Preview of the content as a sticker for small WEBP files, if available; may be null -//@video Preview of the content as a video, if available; may be null -//@video_note Preview of the content as a video note, if available; may be null -//@voice_note Preview of the content as a voice note, if available; may be null -//@story_sender_chat_id The identifier of the sender of the previewed story; 0 if none -//@story_id The identifier of the previewed story; 0 if none -//@stickers Up to 4 stickers from the sticker set available via the link -//@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string has_large_media:Bool show_large_media:Bool skip_confirmation:Bool show_above_text:Bool animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 stickers:vector instant_view_version:int32 = WebPage; +//@instant_view_version Version of instant view (currently, can be 1 or 2) for the web page; 0 if none +linkPreview url:string display_url:string site_name:string title:string description:formattedText type:LinkPreviewType has_large_media:Bool show_large_media:Bool show_media_above_description:Bool skip_confirmation:Bool show_above_text:Bool instant_view_version:int32 = LinkPreview; //@description Contains information about a country @@ -2755,7 +2886,7 @@ paymentOption title:string url:string = PaymentOption; //@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password paymentFormTypeRegular invoice:invoice payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector saved_order_info:orderInfo saved_credentials:vector can_save_credentials:Bool need_password:Bool = PaymentFormType; -//@description The payment form is for a payment in Telegram stars @star_count Number of Telegram stars that will be paid +//@description The payment form is for a payment in Telegram Stars @star_count Number of Telegram Stars that will be paid paymentFormTypeStars star_count:int53 = PaymentFormType; @@ -2784,8 +2915,8 @@ paymentResult success:Bool verification_url:string = PaymentResult; //@tip_amount The amount of tip chosen by the buyer in the smallest units of the currency paymentReceiptTypeRegular payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceiptType; -//@description The payment was done using Telegram stars -//@star_count Number of Telegram stars that were paid +//@description The payment was done using Telegram Stars +//@star_count Number of Telegram Stars that were paid //@transaction_id Unique identifier of the transaction that can be used to dispute it paymentReceiptTypeStars star_count:int53 transaction_id:string = PaymentReceiptType; @@ -2800,7 +2931,9 @@ paymentReceipt product_info:productInfo date:int32 seller_bot_user_id:int53 type //@class InputInvoice @description Describes an invoice to process -//@description An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia @chat_id Chat identifier of the message @message_id Message identifier +//@description An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia +//@chat_id Chat identifier of the message +//@message_id Message identifier inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; //@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice @@ -3126,9 +3259,9 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@description A text message //@text Text of the message -//@web_page A link preview attached to the message; may be null +//@link_preview A link preview attached to the message; may be null //@link_preview_options Options which were used for generation of the link preview; may be null if default options were used -messageText text:formattedText web_page:webPage link_preview_options:linkPreviewOptions = MessageContent; +messageText text:formattedText link_preview:linkPreview link_preview_options:linkPreviewOptions = MessageContent; //@description An animation message (GIF-style). //@animation The animation description @@ -3145,7 +3278,7 @@ messageAudio audio:audio caption:formattedText = MessageContent; messageDocument document:document caption:formattedText = MessageContent; //@description A message with paid media -//@star_count Number of stars needed to buy access to the media in the message +//@star_count Number of Telegram Stars needed to buy access to the media in the message //@media Information about the media //@caption Media caption //@show_caption_above_media True, if the caption must be shown above the media; otherwise, the caption must be shown below the media @@ -3352,15 +3485,25 @@ messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency //@provider_payment_charge_id Provider payment identifier messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; -//@description Telegram Premium was gifted to the user -//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous +//@description A payment has been refunded +//@owner_id Identifier of the previous owner of the Telegram Stars that refunds them +//@currency Currency for the price of the product +//@total_amount Total price for the product, in the smallest units of the currency +//@invoice_payload Invoice payload; only for bots +//@telegram_payment_charge_id Telegram payment identifier +//@provider_payment_charge_id Provider payment identifier +messagePaymentRefunded owner_id:MessageSender currency:string total_amount:int53 invoice_payload:bytes telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; + +//@description Telegram Premium was gifted to a user +//@gifter_user_id The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user that received Telegram Premium; 0 if the gift is incoming //@currency Currency for the paid amount //@amount The paid amount, in the smallest units of the currency //@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none //@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none //@month_count Number of months the Telegram Premium subscription will be active //@sticker A sticker to be shown in the message; may be null if unknown -messageGiftedPremium gifter_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; +messageGiftedPremium gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker = MessageContent; //@description A Telegram Premium gift code was created for the user //@creator_id Identifier of a chat or a user that created the gift code; may be null if unknown @@ -3405,6 +3548,18 @@ messagePremiumGiveawayCompleted giveaway_message_id:int53 winner_count:int32 unc //@unclaimed_prize_count Number of undistributed prizes messagePremiumGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additional_chat_count:int32 actual_winners_selection_date:int32 only_new_members:Bool was_refunded:Bool month_count:int32 prize_description:string winner_count:int32 winner_user_ids:vector unclaimed_prize_count:int32 = MessageContent; +//@description Telegram Stars were gifted to a user +//@gifter_user_id The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing +//@receiver_user_id The identifier of a user that received Telegram Stars; 0 if the gift is incoming +//@currency Currency for the paid amount +//@amount The paid amount, in the smallest units of the currency +//@cryptocurrency Cryptocurrency used to pay for the gift; may be empty if none +//@cryptocurrency_amount The paid amount, in the smallest units of the cryptocurrency; 0 if none +//@star_count Number of Telegram Stars that were gifted +//@transaction_id Identifier of the transaction for Telegram Stars purchase; for receiver only +//@sticker A sticker to be shown in the message; may be null if unknown +messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 star_count:int53 transaction_id:string sticker:sticker = MessageContent; + //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -3501,7 +3656,7 @@ textEntityTypeMentionName user_id:int53 = TextEntityType; //@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji 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 web page preview of the current message, or in the same places in the replied message +//@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; @@ -3608,7 +3763,7 @@ inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration: inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; //@description A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed -//@star_count The number of stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max") +//@star_count The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max") //@paid_media The content of the paid media //@caption Message caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters //@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats @@ -3716,12 +3871,42 @@ inputMessageStory story_sender_chat_id:int53 story_id:int32 = InputMessageConten //@description A forwarded message //@from_chat_id Identifier for the chat this forwarded message came from -//@message_id Identifier of the message to forward. A message can be forwarded only if message.can_be_forwarded +//@message_id Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded //@in_game_share True, if a game message is being shared from a launched game; applies only to game messages //@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; +//@description Contains properties of a message and describes actions that can be done with the message right now +//@can_be_deleted_only_for_self True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false +//@can_be_deleted_for_all_users True, if the message can be deleted for all users using the method deleteMessages with revoke == true +//@can_be_edited True, if the message can be edited using the methods editMessageText, editMessageMedia, editMessageCaption, or editMessageReplyMarkup. +//-For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message +//@can_be_forwarded True, if the message can be forwarded using inputMessageForwarded or forwardMessages +//@can_be_paid True, if the message can be paid using inputInvoiceMessage +//@can_be_pinned True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage +//@can_be_replied True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage +//@can_be_replied_in_another_chat True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage +//@can_be_saved True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options +//@can_be_shared_in_story True, if the message can be shared in a story using inputStoryAreaTypeMessage +//@can_edit_scheduling_state True, if scheduling state of the message can be edited +//@can_get_added_reactions True, if the list of added reactions is available using getMessageAddedReactions +//@can_get_embedding_code True, if code for message embedding can be received using getMessageEmbeddingCode +//@can_get_link True, if a link can be generated for the message using getMessageLink +//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink +//@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory +//@can_get_read_date True, if read date of the message can be received through getMessageReadDate +//@can_get_statistics True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards +//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers +//@can_recognize_speech True, if speech can be recognized for the message through recognizeSpeech +//@can_report_chat True, if the message can be reported using reportChat +//@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions +//@can_report_supergroup_spam True, if the message can be reported using reportSupergroupSpam +//@can_set_fact_check True, if fact check for the message can be changed through setMessageFactCheck +//@need_show_statistics True, if message statistics must be available from context menu of the message +messageProperties 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_scheduling_state:Bool can_get_added_reactions: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_viewers:Bool can_recognize_speech:Bool can_report_chat:Bool can_report_reactions:Bool can_report_supergroup_spam:Bool can_set_fact_check:Bool need_show_statistics:Bool = MessageProperties; + + //@class SearchMessagesFilter @description Represents a filter for message search results //@description Returns all found messages, no filter is applied @@ -3937,6 +4122,12 @@ emojiCategoryTypeEmojiStatus = EmojiCategoryType; emojiCategoryTypeChatPhoto = EmojiCategoryType; +//@description Describes the current weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +currentWeather temperature:double emoji:string = CurrentWeather; + + //@description Describes position of a clickable rectangle area on a story media //@x_percentage The abscissa of the rectangle's center, as a percentage of the media width //@y_percentage The ordinate of the rectangle's center, as a percentage of the media height @@ -3947,7 +4138,7 @@ emojiCategoryTypeChatPhoto = EmojiCategoryType; storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double corner_radius_percentage:double = StoryAreaPosition; -//@class StoryAreaType @description Describes type of clickable rectangle area on a story media +//@class StoryAreaType @description Describes type of clickable area on a story media //@description An area pointing to a location @location The location @address Address of the location; may be null if unknown storyAreaTypeLocation location:location address:locationAddress = StoryAreaType; @@ -3968,12 +4159,18 @@ storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; //@description An area pointing to a HTTP or tg:// link @url HTTP or tg:// URL to be opened when the area is clicked storyAreaTypeLink url:string = StoryAreaType; +//@description An area with information about weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +//@background_color A color of the area background in the ARGB format +storyAreaTypeWeather temperature:double emoji:string background_color:int32 = StoryAreaType; + //@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; -//@class InputStoryAreaType @description Describes type of clickable rectangle area on a story media to be added +//@class InputStoryAreaType @description Describes type of clickable area on a story media to be added //@description An area pointing to a location @location The location @address Address of the location; pass null if unknown inputStoryAreaTypeLocation location:location address:locationAddress = InputStoryAreaType; @@ -3996,13 +4193,19 @@ inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_f //@description An area pointing to a message //@chat_id Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat -//@message_id Identifier of the message. Only successfully sent non-scheduled messages can be specified +//@message_id Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable inputStoryAreaTypeMessage chat_id:int53 message_id:int53 = InputStoryAreaType; //@description An area pointing to a HTTP or tg:// link //@url HTTP or tg:// URL to be opened when the area is clicked inputStoryAreaTypeLink url:string = InputStoryAreaType; +//@description An area with information about weather +//@temperature Temperature, in degree Celsius +//@emoji Emoji representing the weather +//@background_color A color of the area background in the ARGB format +inputStoryAreaTypeWeather temperature:double emoji:string background_color:int32 = InputStoryAreaType; + //@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; @@ -4010,8 +4213,9 @@ inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryAr //@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have //-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, //-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, -//-up to 1 inputStoryAreaTypeMessage area, and -//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user +//-up to 1 inputStoryAreaTypeMessage area, +//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, and +//-up to 3 inputStoryAreaTypeWeather areas inputStoryAreas areas:vector = InputStoryAreas; @@ -4024,8 +4228,9 @@ inputStoryAreas areas:vector = InputStoryAreas; //@minithumbnail Video minithumbnail; may be null //@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null //@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes +//@cover_frame_timestamp Timestamp of the frame used as video thumbnail //@video File containing the video -storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 video:file = StoryVideo; +storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 cover_frame_timestamp:double video:file = StoryVideo; //@class StoryContent @description Contains the content of a story @@ -4051,8 +4256,9 @@ inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector = In //@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second //@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable //@duration Precise duration of the video, in seconds; 0-60 +//@cover_frame_timestamp Timestamp of the frame, which will be used as video thumbnail //@is_animation True, if the video has no sound -inputStoryContentVideo video:InputFile added_sticker_file_ids:vector duration:double is_animation:Bool = InputStoryContent; +inputStoryContentVideo video:InputFile added_sticker_file_ids:vector duration:double cover_frame_timestamp:double is_animation:Bool = InputStoryContent; //@class StoryList @description Describes a list of stories @@ -4137,7 +4343,7 @@ storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; //@list Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list //@order A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order //@max_read_story_id Identifier of the last read active story -//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers) +//@stories Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers) chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector = ChatActiveStories; @@ -4207,6 +4413,20 @@ publicForwardStory story:story = PublicForward; publicForwards total_count:int32 forwards:vector next_offset:string = PublicForwards; +//@description Describes media previews of a bot +//@date Point in time (Unix timestamp) when the preview was added or changed last time +//@content Content of the preview +botMediaPreview date:int32 content:StoryContent = BotMediaPreview; + +//@description Contains a list of media previews of a bot @previews List of media previews +botMediaPreviews previews:vector = BotMediaPreviews; + +//@description Contains a list of media previews of a bot for the given language and the list of languages for which the bot has dedicated previews +//@previews List of media previews +//@language_codes List of language codes for which the bot has dedicated previews +botMediaPreviewInfo previews:vector language_codes:vector = BotMediaPreviewInfo; + + //@description Contains a list of features available on a specific chat boost level //@level Target chat boost level //@story_per_day_count Number of stories that the chat can publish daily @@ -5429,7 +5649,10 @@ premiumState state:formattedText payment_options:vector Devices > Scan QR and scan the code" needs to be shown @@ -6367,15 +6606,6 @@ internalLinkTypeRestorePurchases = InternalLinkType; //@description The link is a link to application settings internalLinkTypeSettings = InternalLinkType; -//@description The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. -//-Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps, -//-ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. -//-If the bot is added to side menu, then use getWebAppUrl with the given URL and open the returned URL as a Web App -//@bot_username Username of the bot -//@url URL to be passed to getWebAppUrl -//@is_compact True, if the Web App must be opened in a compact mode instead of a full-size mode -internalLinkTypeSideMenuBot bot_username:string url:string is_compact:Bool = InternalLinkType; - //@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. //-If the sticker set is found and the user wants to add it, then call changeStickerSet //@sticker_set_name Name of the sticker set @@ -6387,7 +6617,7 @@ internalLinkTypeStickerSet sticker_set_name:string expect_custom_emoji:Bool = In //@story_id Story identifier internalLinkTypeStory story_sender_username:string story_id:int32 = InternalLinkType; -//@description The link is a link to a theme. TDLib has no theme support yet @theme_name Name of the theme +//@description The link is a link to a cloud theme. TDLib has no theme support yet @theme_name Name of the theme internalLinkTypeTheme theme_name:string = InternalLinkType; //@description The link is a link to the theme section of the app settings @@ -6400,10 +6630,11 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType; internalLinkTypeUnsupportedProxy = InternalLinkType; //@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. -//-If the user is found, then call createPrivateChat and open the chat. If draft text isn't empty, then put the draft text in the input field +//-If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field //@phone_number Phone number of the user //@draft_text Draft text for message to send in the chat -internalLinkTypeUserPhoneNumber phone_number:string draft_text:string = InternalLinkType; +//@open_profile True, if user's profile information screen must be opened; otherwise, the chat itself must be opened +internalLinkTypeUserPhoneNumber phone_number:string draft_text:string open_profile:Bool = InternalLinkType; //@description The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. //-If the user is found, then call createPrivateChat and open the chat @@ -6417,13 +6648,13 @@ internalLinkTypeUserToken token:string = InternalLinkType; internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream:Bool = InternalLinkType; //@description The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name. -//-Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps +//-Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being third-party apps //-instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. //-Then, call getWebAppLinkUrl and open the returned URL as a Web App //@bot_username Username of the bot that owns the Web App //@web_app_short_name Short name of the Web App //@start_parameter Start parameter to be passed to getWebAppLinkUrl -//@is_compact True, if the Web App must be opened in a compact mode instead of a full-size mode +//@is_compact True, if the Web App must be opened in the compact mode instead of the full-size mode internalLinkTypeWebApp bot_username:string web_app_short_name:string start_parameter:string is_compact:Bool = InternalLinkType; @@ -6435,7 +6666,7 @@ messageLink link:string is_public:Bool = MessageLink; //@chat_id If found, identifier of the chat to which the link points, 0 otherwise //@message_thread_id If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing //@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 web page preview +//@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 //@for_album True, if the whole media album to which the message belongs is linked messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; @@ -6680,6 +6911,9 @@ topChatCategoryChannels = TopChatCategory; //@description A category containing frequently used chats with inline bots sorted by their usage in inline mode topChatCategoryInlineBots = TopChatCategory; +//@description A category containing frequently used chats with bots, which Web Apps were opened +topChatCategoryWebAppBots = TopChatCategory; + //@description A category containing frequently used chats used for calls topChatCategoryCalls = TopChatCategory; @@ -6986,18 +7220,18 @@ chatRevenueTransaction cryptocurrency:string cryptocurrency_amount:int64 type:Ch chatRevenueTransactions total_count:int32 transactions:vector = ChatRevenueTransactions; -//@description Contains information about Telegram stars earned by a bot or a chat -//@total_count Total number of the stars earned -//@current_count The number of Telegram stars that aren't withdrawn yet -//@available_count The number of Telegram stars that are available for withdrawal -//@withdrawal_enabled True, if Telegram stars can be withdrawn now or later +//@description Contains information about Telegram Stars earned by a bot or a chat +//@total_count Total number of Telegram Stars earned +//@current_count The number of Telegram Stars that aren't withdrawn yet +//@available_count The number of Telegram Stars that are available for withdrawal +//@withdrawal_enabled True, if Telegram Stars can be withdrawn now or later //@next_withdrawal_in Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now starRevenueStatus total_count:int53 current_count:int53 available_count:int53 withdrawal_enabled:Bool next_withdrawal_in:int32 = StarRevenueStatus; -//@description A detailed statistics about Telegram stars earned by a bot or a chat +//@description A detailed statistics about Telegram Stars earned by a bot or a chat //@revenue_by_day_graph A graph containing amount of revenue in a given day -//@status Telegram star revenue status -//@usd_rate Current conversion rate of a Telegram star to USD +//@status Telegram Star revenue status +//@usd_rate Current conversion rate of a Telegram Star to USD starRevenueStatistics revenue_by_day_graph:StatisticalGraph status:starRevenueStatus usd_rate:double = StarRevenueStatistics; @@ -7515,7 +7749,7 @@ updateDefaultReactionType reaction_type:ReactionType = Update; //@tags The new tags updateSavedMessagesTags saved_messages_topic_id:int53 tags:savedMessagesTags = Update; -//@description The number of Telegram stars owned by the current user has changed @star_count The new number of Telegram stars owned +//@description The number of Telegram Stars owned by the current user has changed @star_count The new number of Telegram Stars owned updateOwnedStarCount star_count:int53 = Update; //@description The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions @@ -7523,9 +7757,9 @@ updateOwnedStarCount star_count:int53 = Update; //@revenue_amount New amount of earned revenue updateChatRevenueAmount chat_id:int53 revenue_amount:chatRevenueAmount = Update; -//@description The Telegram star revenue earned by a bot or a chat has changed. If star transactions screen of the chat is opened, then getStarTransactions may be called to fetch new transactions -//@owner_id Identifier of the owner of the Telegram stars -//@status New Telegram star revenue status +//@description The Telegram Star revenue earned by a bot or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +//@owner_id Identifier of the owner of the Telegram Stars +//@status New Telegram Star revenue status updateStarRevenueStatus owner_id:MessageSender status:starRevenueStatus = Update; //@description The parameters of speech recognition without Telegram Premium subscription has changed @@ -7956,15 +8190,18 @@ getCallbackQueryMessage chat_id:int53 message_id:int53 callback_query_id:int64 = //@description Returns information about messages. If a message is not found, returns null on the corresponding position of the result @chat_id Identifier of the chat the messages belong to @message_ids Identifiers of the messages to get getMessages chat_id:int53 message_ids:vector = Messages; -//@description Returns information about a message thread. Can be used only if message.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message +//@description Returns properties of a message; this is an offline request @chat_id Chat identifier @message_id Identifier of the message +getMessageProperties chat_id:int53 message_id:int53 = MessageProperties; + +//@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; -//@description Returns read date of a recent outgoing message in a private chat. The method can be called if message.can_get_read_date == true and the message is read +//@description Returns read date of a recent outgoing message in a private chat. The method can be called if messageProperties.can_get_read_date == true //@chat_id Chat identifier //@message_id Identifier of the message getMessageReadDate chat_id:int53 message_id:int53 = MessageReadDate; -//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true +//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers == true //@chat_id Chat identifier //@message_id Identifier of the message getMessageViewers chat_id:int53 message_id:int53 = MessageViewers; @@ -8072,7 +8309,7 @@ getSuitablePersonalChats = Chats; //@limit The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached loadSavedMessagesTopics limit:int32 = Ok; -//@description Returns messages in a Saved Messages topic. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) +//@description Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) //@saved_messages_topic_id Identifier of Saved Messages topic which messages will be fetched //@from_message_id Identifier of the message starting from which messages must be fetched; use 0 to get results from the last message //@offset Specify 0 to get results from exactly the message from_message_id or a negative offset up to 99 to get additionally some newer messages @@ -8110,7 +8347,7 @@ setPinnedSavedMessagesTopics saved_messages_topic_ids:vector = Ok; getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; -//@description Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). +//@description Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). //-For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true //@chat_id Chat identifier //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message @@ -8120,8 +8357,8 @@ getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats; //@only_local Pass true to get only messages that are available without sending network requests getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only_local:Bool = Messages; -//@description Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. -//-The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib +//@description Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup. +//-The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib //@chat_id Chat identifier //@message_id Message identifier, which thread history needs to be returned //@from_message_id Identifier of the message starting from which history must be fetched; use 0 to get results from the last message @@ -8276,7 +8513,7 @@ getChatMessageCount chat_id:int53 filter:SearchMessagesFilter saved_messages_top //@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 saved_messages_topic_id:int53 = Count; -//@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier +//@description Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier getChatScheduledMessages chat_id:int53 = Messages; //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat @@ -8301,15 +8538,15 @@ removeNotification notification_group_id:int32 notification_id:int32 = Ok; removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = Ok; -//@description Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request +//@description Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request //@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 web page preview +//@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 //@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; -//@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username +//@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 //@message_id Identifier of the message //@for_album Pass true to return an HTML code for embedding of the whole media album @@ -8338,9 +8575,9 @@ translateText text:formattedText to_language_code:string = FormattedText; //-"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" translateMessageText chat_id:int53 message_id:int53 to_language_code:string = FormattedText; -//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent, must not be scheduled, and must be from a non-secret chat +//@description Recognizes speech in a video note or a voice note message //@chat_id Identifier of the chat to which the message belongs -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_recognize_speech to check whether the message is suitable recognizeSpeech chat_id:int53 message_id:int53 = Ok; //@description Rates recognized speech in a video note or a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good @@ -8392,7 +8629,7 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:Inpu //@chat_id Identifier of the chat to which to forward messages //@message_thread_id If not 0, the message thread identifier in which the message will be sent; for forum threads only //@from_chat_id Identifier of the chat from which to forward messages -//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if message.can_be_forwarded +//@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously. A message can be forwarded only if messageProperties.can_be_forwarded //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false @@ -8422,7 +8659,10 @@ sendChatScreenshotTakenNotification chat_id:int53 = Ok; //@input_message_content The content of the message to be added addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:InputMessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; -//@description Deletes messages @chat_id Chat identifier @message_ids Identifiers of the messages to be deleted @revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats +//@description Deletes messages +//@chat_id Chat identifier +//@message_ids Identifiers of the messages to be deleted. Use messageProperties.can_be_deleted_only_for_self and messageProperties.can_be_deleted_for_all_users to get suitable messages +//@revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; //@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete @@ -8436,18 +8676,17 @@ deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok; deleteChatMessagesByDate chat_id:int53 min_date:int32 max_date:int32 revoke:Bool = Ok; -//@description Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side. -//-Can be used only if message.can_be_edited == true +//@description Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@input_message_content New text content of the message. Must be of type inputMessageText editMessageText chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. -//-Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +//-Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@location New location content of the message; pass null to stop sharing the live location //@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. @@ -8458,26 +8697,24 @@ editMessageLiveLocation chat_id:int53 message_id:int53 reply_markup:ReplyMarkup //@description Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. //-The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. -//-Returns the edited message after the edit is completed on the server side. Can be used only if message.can_be_edited == true +//-Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo editMessageMedia chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; -//@description Edits the message content caption. Returns the edited message after the edit is completed on the server side. -//-Can be used only if message.can_be_edited == true +//@description Edits the message content caption. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none; for bots only //@caption New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption //@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Message; -//@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side. -//-Can be used only if message.can_be_edited == true +//@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited //@reply_markup The new message reply markup; pass null if none editMessageReplyMarkup chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Message; @@ -8517,13 +8754,13 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = //@description Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed //@chat_id The chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable //@scheduling_state The new message scheduling state; pass null to send the message immediately editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; -//@description Changes the fact-check of a message. Can be only used if getOption("can_edit_fact_check") == true +//@description Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true //@chat_id The channel chat the message belongs to -//@message_id Identifier of the message. The message must be one of the following types: messageAnimation, messageAudio, messageDocument, messagePhoto, messageText, messageVideo +//@message_id Identifier of the message //@text New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported setMessageFactCheck chat_id:int53 message_id:int53 text:formattedText = Ok; @@ -8601,6 +8838,13 @@ editBusinessMessageReplyMarkup business_connection_id:string chat_id:int53 messa //@reply_markup The new message reply markup; pass null if none stopBusinessPoll business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = BusinessMessage; +//@description Pins or unpins a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@is_pinned Pass true to pin the message, pass false to unpin it +setBusinessMessageIsPinned business_connection_id:string chat_id:int53 message_id:int53 is_pinned:Bool = Ok; + //@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters checkQuickReplyShortcutName name:string = Ok; @@ -8765,7 +9009,7 @@ setMessageReactions chat_id:int53 message_id:int53 reaction_types:vector = Ok; //@limit The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached getPollVoters chat_id:int53 message_id:int53 option_id:int32 offset:int32 limit:int32 = MessageSenders; -//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set +//@description Stops a poll //@chat_id Identifier of the chat to which the poll belongs -//@message_id Identifier of the message containing the poll +//@message_id Identifier of the message containing the poll. Use messageProperties.can_be_edited to check whether the poll can be stopped //@reply_markup The new message reply markup; pass null if none; for bots only stopPoll chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = Ok; @@ -8870,7 +9114,7 @@ getBusinessConnection connection_id:string = BusinessConnection; //@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button //@chat_id Chat identifier of the message with the button -//@message_id Message identifier of the message with the button +//@message_id Message identifier of the message with the button. The message must not be scheduled //@button_id Button identifier getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo; @@ -8920,6 +9164,11 @@ getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location que answerInlineQuery inline_query_id:int64 is_personal:Bool button:inlineQueryResultsButton results:vector cache_time:int32 next_offset:string = Ok; +//@description Returns popular 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 +//@limit The maximum number of bots to be returned; up to 100 +getPopularWebAppBots offset:string limit:int32 = FoundUsers; + //@description Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found //@bot_user_id Identifier of the target bot //@web_app_short_name Short name of the Web App @@ -8931,15 +9180,23 @@ searchWebApp bot_user_id:int53 web_app_short_name:string = FoundWebApp; //@web_app_short_name Short name of the Web App //@start_parameter Start parameter from internalLinkTypeWebApp //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores //@allow_write_access Pass true if the current user allowed the bot to send them messages getWebAppLinkUrl chat_id:int53 bot_user_id:int53 web_app_short_name:string start_parameter:string theme:themeParameters application_name:string allow_write_access:Bool = HttpUrl; -//@description Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link +//@description Returns information needed to open the main Web App of a bot +//@chat_id Identifier of the chat in which the Web App is opened; pass 0 if none //@bot_user_id Identifier of the target bot -//@url The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu +//@start_parameter Start parameter from internalLinkTypeMainWebApp //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores +getMainWebApp chat_id:int53 bot_user_id:int53 start_parameter:string theme:themeParameters application_name:string = MainWebApp; + +//@description Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button +//@bot_user_id Identifier of the target bot +//@url The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, or an empty string when the bot is opened from the side menu +//@theme Preferred Web App theme; pass null to use the default theme +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores getWebAppUrl bot_user_id:int53 url:string theme:themeParameters application_name:string = HttpUrl; //@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot @@ -8954,7 +9211,7 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@bot_user_id Identifier of the bot, providing the Web App //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, the message thread identifier in which the message will be sent //@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:InputMessageReplyTo = WebAppInfo; @@ -8970,7 +9227,7 @@ answerWebAppQuery web_app_query_id:string result:InputInlineQueryResult = SentWe //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires //@chat_id Identifier of the chat with the message -//@message_id Identifier of the message from which the query originated +//@message_id Identifier of the message from which the query originated. The message must not be scheduled //@payload Query payload getCallbackQueryAnswer chat_id:int53 message_id:int53 payload:CallbackQueryPayload = CallbackQueryAnswer; @@ -9057,7 +9314,7 @@ getInternalLink type:InternalLinkType is_http:Bool = HttpUrl; //@description Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link getInternalLinkType link:string = InternalLinkType; -//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats @link The link +//@description Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if link preview is disabled in secret chats @link The link getExternalLinkInfo link:string = LoginUrlInfo; //@description Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed @@ -9303,7 +9560,7 @@ setChatLocation chat_id:int53 location:chatLocation = Ok; //@description Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right @chat_id Chat identifier @slow_mode_delay New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600 setChatSlowModeDelay chat_id:int53 slow_mode_delay:int32 = Ok; -//@description Pins a message in a chat; requires can_pin_messages member right if the chat is a basic group or supergroup, or can_edit_messages administrator right if the chat is a channel +//@description Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned //@chat_id Identifier of the chat //@message_id Identifier of the new pinned message //@disable_notification Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats @@ -9426,6 +9683,10 @@ setPinnedChats chat_list:ChatList chat_ids:vector = Ok; readChatList chat_list:ChatList = Ok; +//@description Returns the current weather in the given location @location The location +getCurrentWeather location:location = CurrentWeather; + + //@description Returns a story //@story_sender_chat_id Identifier of the chat that posted the story //@story_id Story identifier @@ -9435,17 +9696,18 @@ getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; //@description Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there getChatsToSendStories = Chats; -//@description Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats @chat_id Chat identifier +//@description Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for supergroup and channel chats +//@chat_id Chat identifier. Pass Saved Messages chat identifier when posting a story on behalf of the current user canSendStory chat_id:int53 = CanSendStoryResult; //@description Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. Returns a temporary story -//@chat_id Identifier of the chat that will post the story +//@chat_id Identifier of the chat that will post the story. Pass Saved Messages chat identifier when posting a story on behalf of the current user //@content Content of the story //@areas Clickable rectangle areas to be shown on the story media; pass null if none //@caption Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters; can have entities only if getOption("can_use_text_entities_in_story_caption") //@privacy_settings The privacy settings for the story; ignored for stories sent to supergroup and channel chats //@active_period Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise -//@from_story_full_id Full identifier of the original story, which content was used to create the story +//@from_story_full_id Full identifier of the original story, which content was used to create the story; pass null if the story isn't repost of another story //@is_posted_to_chat_page Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 from_story_full_id:storyFullId is_posted_to_chat_page:Bool protect_content:Bool = Story; @@ -9458,6 +9720,12 @@ sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption: //@caption New story caption; pass null to keep the current caption editStory story_sender_chat_id:int53 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; +//@description Changes cover of a video story. Can be called only if story.can_be_edited == true and the story isn't being edited now +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to edit +//@cover_frame_timestamp New timestamp of the frame, which will be used as video thumbnail +editStoryCover story_sender_chat_id:int53 story_id:int32 cover_frame_timestamp:double = Ok; + //@description Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true //@story_id Identifier of the story //@privacy_settings The new privacy settigs for the story @@ -9489,7 +9757,7 @@ setChatActiveStoriesList chat_id:int53 story_list:StoryList = Ok; getChatActiveStories chat_id:int53 = ChatActiveStories; //@description Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories are returned first. -//-Then, stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//-Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib //@chat_id Chat identifier //@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from pinned and the newest story //@limit The maximum number of stories to be returned @@ -9497,7 +9765,7 @@ getChatActiveStories chat_id:int53 = ChatActiveStories; getChatPostedToChatPageStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; //@description Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. -//-The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//-The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib //@chat_id Chat identifier //@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story //@limit The maximum number of stories to be returned @@ -10230,7 +10498,7 @@ removeRecentHashtag hashtag:string = Ok; //@description Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text has no link preview //@text Message text with formatting //@link_preview_options Options to be used for generation of the link preview; pass null to use default link preview options -getWebPagePreview text:formattedText link_preview_options:linkPreviewOptions = WebPage; +getLinkPreview text:formattedText link_preview_options:linkPreviewOptions = LinkPreview; //@description Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page @url The web page URL @force_full Pass true to get full instant view for the web page getWebPageInstantView url:string force_full:Bool = WebPageInstantView; @@ -10412,6 +10680,41 @@ allowBotToSendMessages bot_user_id:int53 = Ok; sendWebAppCustomRequest bot_user_id:int53 method:string parameters:string = CustomRequestResult; +//@description Returns the list of media previews of a bot @bot_user_id Identifier of the target bot. The bot must have the main Web App +getBotMediaPreviews bot_user_id:int53 = BotMediaPreviews; + +//@description Returns the list of media previews for the given language and the list of languages for which the bot has dedicated previews +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code A two-letter ISO 639-1 language code for which to get previews. If empty, then default previews are returned +getBotMediaPreviewInfo bot_user_id:int53 language_code:string = BotMediaPreviewInfo; + +//@description Adds a new media preview to the beginning of the list of media previews of a bot. Returns the added preview after addition is completed server-side. The total number of previews must not exceed getOption("bot_media_preview_count_max") for the given language +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code A two-letter ISO 639-1 language code for which preview is added. If empty, then the preview will be shown to all users for whose languages there are no dedicated previews. +//-If non-empty, then there must be an official language pack of the same name, which is returned by getLocalizationTargetInfo +//@content Content of the added preview +addBotMediaPreview bot_user_id:int53 language_code:string content:InputStoryContent = BotMediaPreview; + +//@description Replaces media preview in the list of media previews of a bot. Returns the new preview after edit is completed server-side +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media preview to edit +//@file_id File identifier of the media to replace +//@content Content of the new preview +editBotMediaPreview bot_user_id:int53 language_code:string file_id:int32 content:InputStoryContent = BotMediaPreview; + +//@description Changes order of media previews in the list of media previews of a bot +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media previews to reorder +//@file_ids File identifiers of the media in the new order +reorderBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector = Ok; + +//@description Delete media previews from the list of media previews of a bot +//@bot_user_id Identifier of the target bot. The bot must be owned and must have the main Web App +//@language_code Language code of the media previews to delete +//@file_ids File identifiers of the media to delete +deleteBotMediaPreviews bot_user_id:int53 language_code:string file_ids:vector = Ok; + + //@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 @@ -10560,12 +10863,14 @@ toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok; //@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; -//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @message_ids Identifiers of messages to report +//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup +//@supergroup_id Supergroup identifier +//@message_ids Identifiers of messages to report. Use messageProperties.can_be_reported to check whether the message can be reported reportSupergroupSpam supergroup_id:int53 message_ids:vector = Ok; //@description Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true //@supergroup_id Supergroup identifier -//@message_id Identifier of the erroneously deleted message +//@message_id Identifier of the erroneously deleted message from chatEventMessageDeleted reportSupergroupAntiSpamFalsePositive supergroup_id:int53 message_id:int53 = Ok; //@description Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters @@ -10610,7 +10915,7 @@ validateOrderInfo input_invoice:InputInvoice order_info:orderInfo allow_save:Boo //@payment_form_id Payment form identifier returned by getPaymentForm //@order_info_id Identifier returned by validateOrderInfo, or an empty string //@shipping_option_id Identifier of a chosen shipping option, if applicable -//@credentials The credentials chosen by user for payment; pass null for a payment in Telegram stars +//@credentials The credentials chosen by user for payment; pass null for a payment in Telegram Stars //@tip_amount Chosen by the user amount of tip in the smallest units of the currency sendPaymentForm input_invoice:InputInvoice payment_form_id:int64 order_info_id:string shipping_option_id:string credentials:InputCredentials tip_amount:int53 = PaymentResult; @@ -10776,7 +11081,7 @@ removeChatActionBar chat_id:int53 = Ok; //@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported //@chat_id Chat identifier -//@message_ids Identifiers of reported messages; may be empty to report the whole chat +//@message_ids Identifiers of reported messages; may be empty to report the whole chat. Use messageProperties.can_be_reported to check whether the message can be reported //@reason The reason for reporting the chat //@text Additional report details; 0-1024 characters reportChat chat_id:int53 message_ids:vector reason:ReportReason text:string = Ok; @@ -10788,7 +11093,7 @@ reportChat chat_id:int53 message_ids:vector reason:ReportReason text:stri //@text Additional report details; 0-1024 characters reportChatPhoto chat_id:int53 file_id:int32 reason:ReportReason text:string = Ok; -//@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions +//@description Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if messageProperties.can_report_reactions //@chat_id Chat identifier //@message_id Message identifier //@sender_id Identifier of the sender, which added the reaction @@ -10810,29 +11115,29 @@ getChatRevenueWithdrawalUrl chat_id:int53 password:string = HttpUrl; getChatRevenueTransactions chat_id:int53 offset:int32 limit:int32 = ChatRevenueTransactions; -//@description Returns detailed Telegram star revenue statistics -//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat +//@description Returns detailed Telegram Star revenue statistics +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true //@is_dark Pass true if a dark theme is used by the application getStarRevenueStatistics owner_id:MessageSender is_dark:Bool = StarRevenueStatistics; -//@description Returns a URL for Telegram star withdrawal -//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat -//@star_count The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") +//@description Returns a URL for Telegram Star withdrawal +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat +//@star_count The number of Telegram Stars to withdraw. Must be at least getOption("star_withdrawal_count_min") //@password The 2-step verification password of the current user getStarWithdrawalUrl owner_id:MessageSender star_count:int53 password:string = HttpUrl; -//@description Returns a URL for a Telegram Ad platform account that can be used to set up advertisments for the chat paid in the owned Telegram stars -//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat +//@description Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the owned Telegram Stars +//@owner_id Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat getStarAdAccountUrl owner_id:MessageSender = HttpUrl; //@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; -//@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application +//@description Returns detailed statistics about a message. Can be used only if messageProperties.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; -//@description Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib +//@description Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if messageProperties.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib //@chat_id Chat identifier of the message //@message_id Message identifier //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results @@ -11089,12 +11394,15 @@ launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParamet //@message_id Identifier of the giveaway or a giveaway winners message in the chat getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; -//@description Returns available options for Telegram stars purchase +//@description Returns available options for Telegram Stars purchase getStarPaymentOptions = StarPaymentOptions; -//@description Returns the list of Telegram star transactions for the specified owner -//@owner_id Identifier of the owner of the Telegram stars; can be the identifier of the current user, identifier of an owned bot, -//-or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true +//@description Returns available options for Telegram Stars gifting @user_id Identifier of the user that will receive Telegram Stars; pass 0 to get options for an unspecified user +getStarGiftPaymentOptions user_id:int53 = StarPaymentOptions; + +//@description Returns the list of Telegram Star transactions for the specified owner +//@owner_id Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, +//-or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true //@direction Direction of the transactions to receive; pass null to get all transactions //@offset Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of transactions to return