diff --git a/client/function.go b/client/function.go index 883efd3..52c8bcb 100755 --- a/client/function.go +++ b/client/function.go @@ -2672,41 +2672,6 @@ func (client *Client) GetChatScheduledMessages(req *GetChatScheduledMessagesRequ return UnmarshalMessages(result.Data) } -type GetMessagePublicForwardsRequest struct { - // Chat identifier of the message - ChatId int64 `json:"chat_id"` - // Message identifier - MessageId int64 `json:"message_id"` - // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` - // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit - Limit int32 `json:"limit"` -} - -// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib -func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { - result, err := client.Send(Request{ - meta: meta{ - Type: "getMessagePublicForwards", - }, - Data: map[string]interface{}{ - "chat_id": req.ChatId, - "message_id": req.MessageId, - "offset": req.Offset, - "limit": req.Limit, - }, - }) - if err != nil { - return nil, err - } - - if result.Type == "error" { - return nil, buildResponseError(result.Data) - } - - return UnmarshalFoundMessages(result.Data) -} - type GetChatSponsoredMessagesRequest struct { // Identifier of the chat ChatId int64 `json:"chat_id"` @@ -2825,7 +2790,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 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 web page preview MediaTimestamp int32 `json:"media_timestamp"` // Pass true to create a link for the whole media album ForAlbum bool `json:"for_album"` @@ -3098,8 +3063,8 @@ type SendMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyTo `json:"reply_to"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Markup for replying to the message; pass null if none; for bots only @@ -3139,14 +3104,12 @@ type SendMessageAlbumRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the messages will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyTo `json:"reply_to"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` // Contents of messages to be sent. At most 10 messages can be added to an album InputMessageContents []InputMessageContent `json:"input_message_contents"` - // Pass true to get fake messages instead of actually sending them - OnlyPreview bool `json:"only_preview"` } // Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages @@ -3161,7 +3124,6 @@ func (client *Client) SendMessageAlbum(req *SendMessageAlbumRequest) (*Messages, "reply_to": req.ReplyTo, "options": req.Options, "input_message_contents": req.InputMessageContents, - "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -3212,8 +3174,8 @@ type SendInlineQueryResultMessageRequest struct { ChatId int64 `json:"chat_id"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyTo `json:"reply_to"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Options to be used to send the message; pass null to use default options Options *MessageSendOptions `json:"options"` // Identifier of the inline query @@ -3258,7 +3220,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 + // 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 MessageIds []int64 `json:"message_ids"` // Options to be used to send the messages; pass null to use default options Options *MessageSendOptions `json:"options"` @@ -3266,8 +3228,6 @@ type ForwardMessagesRequest struct { SendCopy bool `json:"send_copy"` // Pass true to remove media captions of message copies. Ignored if send_copy is false RemoveCaption bool `json:"remove_caption"` - // Pass true to get fake messages instead of actually forwarding them - OnlyPreview bool `json:"only_preview"` } // Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message @@ -3284,7 +3244,6 @@ func (client *Client) ForwardMessages(req *ForwardMessagesRequest) (*Messages, e "options": req.Options, "send_copy": req.SendCopy, "remove_caption": req.RemoveCaption, - "only_preview": req.OnlyPreview, }, }) if err != nil { @@ -3303,6 +3262,8 @@ type ResendMessagesRequest struct { ChatId int64 `json:"chat_id"` // Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order MessageIds []int64 `json:"message_ids"` + // New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false + Quote *FormattedText `json:"quote"` } // Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -3314,6 +3275,7 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err Data: map[string]interface{}{ "chat_id": req.ChatId, "message_ids": req.MessageIds, + "quote": req.Quote, }, }) if err != nil { @@ -3358,8 +3320,8 @@ type AddLocalMessageRequest struct { ChatId int64 `json:"chat_id"` // Identifier of the sender of the message SenderId MessageSender `json:"sender_id"` - // Identifier of the replied message or story; pass null if none - ReplyTo MessageReplyTo `json:"reply_to"` + // Information about the message or story to be replied; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Pass true to disable notification for the message DisableNotification bool `json:"disable_notification"` // The content of the message to be added @@ -4461,6 +4423,43 @@ func (client *Client) SetDefaultReactionType(req *SetDefaultReactionTypeRequest) return UnmarshalOk(result.Data) } +type SearchQuoteRequest struct { + // Text in which to search for the quote + Text *FormattedText `json:"text"` + // Quote to search for + Quote *FormattedText `json:"quote"` + // Approximate quote position in UTF-16 code units + QuotePosition int32 `json:"quote_position"` +} + +// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +func SearchQuote(req *SearchQuoteRequest) (*FoundPosition, error) { + result, err := Execute(Request{ + meta: meta{ + Type: "searchQuote", + }, + Data: map[string]interface{}{ + "text": req.Text, + "quote": req.Quote, + "quote_position": req.QuotePosition, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundPosition(result.Data) +} + +// deprecated +// Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +func (client *Client) SearchQuote(req *SearchQuoteRequest) (*FoundPosition, error) { + return SearchQuote(req)} + type GetTextEntitiesRequest struct { // The text in which to look for entities Text string `json:"text"` @@ -4499,7 +4498,7 @@ type ParseTextEntitiesRequest struct { ParseMode TextParseMode `json:"parse_mode"` } -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { result, err := Execute(Request{ meta: meta{ @@ -4522,7 +4521,7 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { } // deprecated -// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously +// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { return ParseTextEntities(req)} @@ -4926,7 +4925,7 @@ type StopPollRequest struct { ReplyMarkup ReplyMarkup `json:"reply_markup"` } -// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set +// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set func (client *Client) StopPoll(req *StopPollRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -5359,8 +5358,8 @@ type OpenWebAppRequest struct { ApplicationName string `json:"application_name"` // If not 0, a message thread identifier in which the message will be sent MessageThreadId int64 `json:"message_thread_id"` - // Identifier of the replied message or story for the message sent by the Web App; pass null if none - ReplyTo MessageReplyTo `json:"reply_to"` + // Information about the message or story to be replied in the message sent by the Web App; pass null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` } // Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once @@ -5999,6 +5998,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(result.Data) + case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(result.Data) @@ -6044,6 +6046,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(result.Data) + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(result.Data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(result.Data) @@ -6432,7 +6437,7 @@ type CreateNewSupergroupChatRequest struct { Location *ChatLocation `json:"location"` // Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically MessageAutoDeleteTime int32 `json:"message_auto_delete_time"` - // Pass true to create a supergroup for importing messages using importMessage + // Pass true to create a supergroup for importing messages using importMessages ForImport bool `json:"for_import"` } @@ -7172,6 +7177,38 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) { return UnmarshalOk(result.Data) } +type SetChatAccentColorRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` + // Identifier of the accent color to use + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setChatAccentColor", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetChatMessageAutoDeleteTimeRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -8445,13 +8482,39 @@ func (client *Client) GetStory(req *GetStoryRequest) (*Story, error) { return UnmarshalStory(result.Data) } -// Checks whether the current user can send a story -func (client *Client) CanSendStory() (CanSendStoryResult, error) { +// Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there +func (client *Client) GetChatsToSendStories() (*Chats, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatsToSendStories", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChats(result.Data) +} + +type CanSendStoryRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` +} + +// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats +func (client *Client) CanSendStory(req *CanSendStoryRequest) (CanSendStoryResult, error) { result, err := client.Send(Request{ meta: meta{ Type: "canSendStory", }, - Data: map[string]interface{}{}, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, }) if err != nil { return nil, err @@ -8468,6 +8531,9 @@ func (client *Client) CanSendStory() (CanSendStoryResult, error) { case TypeCanSendStoryResultPremiumNeeded: return UnmarshalCanSendStoryResultPremiumNeeded(result.Data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(result.Data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(result.Data) @@ -8483,6 +8549,8 @@ func (client *Client) CanSendStory() (CanSendStoryResult, error) { } type SendStoryRequest struct { + // Identifier of the chat that will post the story + ChatId int64 `json:"chat_id"` // Content of the story Content InputStoryContent `json:"content"` // Clickable rectangle areas to be shown on the story media; pass null if none @@ -8499,13 +8567,14 @@ type SendStoryRequest struct { ProtectContent bool `json:"protect_content"` } -// Sends a new story. Returns a temporary story +// Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { result, err := client.Send(Request{ meta: meta{ Type: "sendStory", }, Data: map[string]interface{}{ + "chat_id": req.ChatId, "content": req.Content, "areas": req.Areas, "caption": req.Caption, @@ -8527,6 +8596,8 @@ func (client *Client) SendStory(req *SendStoryRequest) (*Story, error) { } type EditStoryRequest 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 content of the story; pass null to keep the current content @@ -8537,13 +8608,14 @@ type EditStoryRequest struct { Caption *FormattedText `json:"caption"` } -// Changes content and caption of a previously sent story +// Changes content and caption of a story. Can be called only if story.can_be_edited == true func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "editStory", }, Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "content": req.Content, "areas": req.Areas, @@ -8562,19 +8634,22 @@ func (client *Client) EditStory(req *EditStoryRequest) (*Ok, error) { } type SetStoryPrivacySettingsRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story StoryId int32 `json:"story_id"` // The new privacy settigs for the story PrivacySettings StoryPrivacySettings `json:"privacy_settings"` } -// Changes privacy settings of a previously sent story +// Changes privacy settings of a story. Can be called only if story.can_be_edited == true func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "setStoryPrivacySettings", }, Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "privacy_settings": req.PrivacySettings, }, @@ -8591,19 +8666,22 @@ func (client *Client) SetStoryPrivacySettings(req *SetStoryPrivacySettingsReques } type ToggleStoryIsPinnedRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story StoryId int32 `json:"story_id"` // Pass true to make the story accessible after expiration; pass false to make it private IsPinned bool `json:"is_pinned"` } -// Toggles whether a story is accessible after expiration +// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true func (client *Client) ToggleStoryIsPinned(req *ToggleStoryIsPinnedRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "toggleStoryIsPinned", }, Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, "is_pinned": req.IsPinned, }, @@ -8620,17 +8698,20 @@ func (client *Client) ToggleStoryIsPinned(req *ToggleStoryIsPinnedRequest) (*Ok, } type DeleteStoryRequest struct { + // Identifier of the chat that posted the story + StorySenderChatId int64 `json:"story_sender_chat_id"` // Identifier of the story to delete StoryId int32 `json:"story_id"` } -// Deletes a previously sent story +// Deletes a previously sent story. Can be called only if story.can_be_deleted == true func (client *Client) DeleteStory(req *DeleteStoryRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ Type: "deleteStory", }, Data: map[string]interface{}{ + "story_sender_chat_id": req.StorySenderChatId, "story_id": req.StoryId, }, }) @@ -8777,20 +8858,23 @@ func (client *Client) GetChatPinnedStories(req *GetChatPinnedStoriesRequest) (*S return UnmarshalStories(result.Data) } -type GetArchivedStoriesRequest struct { +type GetChatArchivedStoriesRequest struct { + // Chat identifier + ChatId int64 `json:"chat_id"` // Identifier of the story starting from which stories must be returned; use 0 to get results from the last story FromStoryId int32 `json:"from_story_id"` // The maximum number of stories to be returned For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Returns the list of all stories of the current user. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib -func (client *Client) GetArchivedStories(req *GetArchivedStoriesRequest) (*Stories, error) { +// Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +func (client *Client) GetChatArchivedStories(req *GetChatArchivedStoriesRequest) (*Stories, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getArchivedStories", + Type: "getChatArchivedStories", }, Data: map[string]interface{}{ + "chat_id": req.ChatId, "from_story_id": req.FromStoryId, "limit": req.Limit, }, @@ -8940,7 +9024,7 @@ type GetStoryViewersRequest struct { Limit int32 `json:"limit"` } -// Returns viewers of a story. The method can be called if story.can_get_viewers == true +// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewers, error) { result, err := client.Send(Request{ meta: meta{ @@ -9020,6 +9104,196 @@ func (client *Client) ActivateStoryStealthMode() (*Ok, error) { return UnmarshalOk(result.Data) } +// Returns the list of available chat boost slots for the current user +func (client *Client) GetAvailableChatBoostSlots() (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getAvailableChatBoostSlots", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostStatusRequest struct { + // Identifier of the channel chat + ChatId int64 `json:"chat_id"` +} + +// Returns the current boost status for a channel chat +func (client *Client) GetChatBoostStatus(req *GetChatBoostStatusRequest) (*ChatBoostStatus, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostStatus", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostStatus(result.Data) +} + +type BoostChatRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifiers of boost slots of the current user from which to apply boosts to the chat + SlotIds []int32 `json:"slot_ids"` +} + +// Boosts a chat and returns the list of available chat boost slots for the current user after the boost +func (client *Client) BoostChat(req *BoostChatRequest) (*ChatBoostSlots, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "boostChat", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "slot_ids": req.SlotIds, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostSlots(result.Data) +} + +type GetChatBoostLinkRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +// Returns an HTTPS link to boost the specified channel chat +func (client *Client) GetChatBoostLink(req *GetChatBoostLinkRequest) (*ChatBoostLink, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLink", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLink(result.Data) +} + +type GetChatBoostLinkInfoRequest struct { + // The link to boost a chat + Url string `json:"url"` +} + +// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost +func (client *Client) GetChatBoostLinkInfo(req *GetChatBoostLinkInfoRequest) (*ChatBoostLinkInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoostLinkInfo", + }, + Data: map[string]interface{}{ + "url": req.Url, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalChatBoostLinkInfo(result.Data) +} + +type GetChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Pass true to receive only boosts received from gift codes and giveaways created by the chat + OnlyGiftCodes bool `json:"only_gift_codes"` + // 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 boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns list of boosts applied to a chat; requires administrator rights in the channel chat +func (client *Client) GetChatBoosts(req *GetChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "only_gift_codes": req.OnlyGiftCodes, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + +type GetUserChatBoostsRequest struct { + // Identifier of the chat + ChatId int64 `json:"chat_id"` + // Identifier of the user + UserId int64 `json:"user_id"` +} + +// Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only +func (client *Client) GetUserChatBoosts(req *GetUserChatBoostsRequest) (*FoundChatBoosts, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getUserChatBoosts", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "user_id": req.UserId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundChatBoosts(result.Data) +} + type GetAttachmentMenuBotRequest struct { // Bot's user identifier BotUserId int64 `json:"bot_user_id"` @@ -10890,7 +11164,7 @@ type InviteGroupCallParticipantsRequest struct { UserIds []int64 `json:"user_ids"` } -// Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats func (client *Client) InviteGroupCallParticipants(req *InviteGroupCallParticipantsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -12657,6 +12931,25 @@ func (client *Client) GetDefaultProfilePhotoCustomEmojiStickers() (*Stickers, er return UnmarshalStickers(result.Data) } +// Returns default list of custom emoji stickers for reply background +func (client *Client) GetDefaultBackgroundCustomEmojiStickers() (*Stickers, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getDefaultBackgroundCustomEmojiStickers", + }, + Data: map[string]interface{}{}, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStickers(result.Data) +} + // Returns saved animations func (client *Client) GetSavedAnimations() (*Animations, error) { result, err := client.Send(Request{ @@ -12805,9 +13098,11 @@ func (client *Client) RemoveRecentHashtag(req *RemoveRecentHashtagRequest) (*Ok, type GetWebPagePreviewRequest 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 + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } -// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview +// 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) { result, err := client.Send(Request{ meta: meta{ @@ -12815,6 +13110,7 @@ func (client *Client) GetWebPagePreview(req *GetWebPagePreviewRequest) (*WebPage }, Data: map[string]interface{}{ "text": req.Text, + "link_preview_options": req.LinkPreviewOptions, }, }) if err != nil { @@ -12912,6 +13208,35 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e return UnmarshalOk(result.Data) } +type SetAccentColorRequest struct { + // Identifier of the accent color to use + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +// Changes accent color and background custom emoji for the current user; for Telegram Premium users only +func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "setAccentColor", + }, + Data: map[string]interface{}{ + "accent_color_id": req.AccentColorId, + "background_custom_emoji_id": req.BackgroundCustomEmojiId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + type SetNameRequest struct { // The new value of the first name for the current user; 1-64 characters FirstName string `json:"first_name"` @@ -14552,7 +14877,7 @@ type GetPaymentFormRequest struct { Theme *ThemeParameters `json:"theme"` } -// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy func (client *Client) GetPaymentForm(req *GetPaymentFormRequest) (*PaymentForm, error) { result, err := client.Send(Request{ meta: meta{ @@ -15738,6 +16063,41 @@ func (client *Client) GetMessageStatistics(req *GetMessageStatisticsRequest) (*M return UnmarshalMessageStatistics(result.Data) } +type GetMessagePublicForwardsRequest struct { + // Chat identifier of the message + ChatId int64 `json:"chat_id"` + // Message identifier + MessageId int64 `json:"message_id"` + // Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results + Offset string `json:"offset"` + // The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib +func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getMessagePublicForwards", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundMessages(result.Data) +} + type GetStatisticalGraphRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -17336,6 +17696,151 @@ func (client *Client) GetPremiumState() (*PremiumState, error) { return UnmarshalPremiumState(result.Data) } +type GetPremiumGiftCodePaymentOptionsRequest struct { + // Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_id"` +} + +// Returns available options for Telegram Premium gift code or giveaway creation +func (client *Client) GetPremiumGiftCodePaymentOptions(req *GetPremiumGiftCodePaymentOptionsRequest) (*PremiumGiftCodePaymentOptions, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiftCodePaymentOptions", + }, + Data: map[string]interface{}{ + "boosted_chat_id": req.BoostedChatId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodePaymentOptions(result.Data) +} + +type CheckPremiumGiftCodeRequest struct { + // The code to check + Code string `json:"code"` +} + +// Return information about a Telegram Premium gift code +func (client *Client) CheckPremiumGiftCode(req *CheckPremiumGiftCodeRequest) (*PremiumGiftCodeInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "checkPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalPremiumGiftCodeInfo(result.Data) +} + +type ApplyPremiumGiftCodeRequest struct { + // The code to apply + Code string `json:"code"` +} + +// Applies a Telegram Premium gift code +func (client *Client) ApplyPremiumGiftCode(req *ApplyPremiumGiftCodeRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "applyPremiumGiftCode", + }, + Data: map[string]interface{}{ + "code": req.Code, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type LaunchPrepaidPremiumGiveawayRequest struct { + // Unique identifier of the prepaid giveaway + GiveawayId JsonInt64 `json:"giveaway_id"` + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` +} + +// Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +func (client *Client) LaunchPrepaidPremiumGiveaway(req *LaunchPrepaidPremiumGiveawayRequest) (*Ok, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "launchPrepaidPremiumGiveaway", + }, + Data: map[string]interface{}{ + "giveaway_id": req.GiveawayId, + "parameters": req.Parameters, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalOk(result.Data) +} + +type GetPremiumGiveawayInfoRequest struct { + // Identifier of the channel chat which started the giveaway + ChatId int64 `json:"chat_id"` + // Identifier of the giveaway message in the chat + MessageId int64 `json:"message_id"` +} + +// Returns information about a Telegram Premium giveaway +func (client *Client) GetPremiumGiveawayInfo(req *GetPremiumGiveawayInfoRequest) (PremiumGiveawayInfo, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getPremiumGiveawayInfo", + }, + Data: map[string]interface{}{ + "chat_id": req.ChatId, + "message_id": req.MessageId, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + switch result.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(result.Data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(result.Data) + + default: + return nil, errors.New("invalid type") + } +} + type CanPurchasePremiumRequest struct { // Transaction purpose Purpose StorePaymentPurpose `json:"purpose"` @@ -18693,6 +19198,12 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(result.Data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(result.Data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(result.Data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(result.Data) @@ -18915,6 +19426,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(result.Data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(result.Data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(result.Data) @@ -18996,6 +19510,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(result.Data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(result.Data) + default: return nil, errors.New("invalid type") } diff --git a/client/type.go b/client/type.go index eba7be1..1c74660 100755 --- a/client/type.go +++ b/client/type.go @@ -21,16 +21,19 @@ const ( ClassUserType = "UserType" ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" + ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus" + ClassPremiumGiveawayInfo = "PremiumGiveawayInfo" ClassChatMemberStatus = "ChatMemberStatus" ClassChatMembersFilter = "ChatMembersFilter" ClassSupergroupMembersFilter = "SupergroupMembersFilter" ClassInviteLinkChatType = "InviteLinkChatType" ClassSecretChatState = "SecretChatState" ClassMessageSender = "MessageSender" - ClassMessageForwardOrigin = "MessageForwardOrigin" + ClassMessageOrigin = "MessageOrigin" ClassReactionType = "ReactionType" ClassMessageSendingState = "MessageSendingState" ClassMessageReplyTo = "MessageReplyTo" + ClassInputMessageReplyTo = "InputMessageReplyTo" ClassMessageSource = "MessageSource" ClassMessageSponsorType = "MessageSponsorType" ClassNotificationSettingsScope = "NotificationSettingsScope" @@ -71,6 +74,7 @@ const ( ClassStoryContent = "StoryContent" ClassInputStoryContent = "InputStoryContent" ClassStoryList = "StoryList" + ClassChatBoostSource = "ChatBoostSource" ClassCallDiscardReason = "CallDiscardReason" ClassCallServerType = "CallServerType" ClassCallState = "CallState" @@ -79,6 +83,7 @@ const ( ClassFirebaseAuthenticationSettings = "FirebaseAuthenticationSettings" ClassDiceStickers = "DiceStickers" ClassSpeechRecognitionResult = "SpeechRecognitionResult" + ClassBotWriteAccessAllowReason = "BotWriteAccessAllowReason" ClassInputInlineQueryResult = "InputInlineQueryResult" ClassInlineQueryResult = "InlineQueryResult" ClassInlineQueryResultsButtonType = "InlineQueryResultsButtonType" @@ -90,6 +95,7 @@ const ( ClassPremiumStoryFeature = "PremiumStoryFeature" ClassPremiumSource = "PremiumSource" ClassStorePaymentPurpose = "StorePaymentPurpose" + ClassTelegramPaymentPurpose = "TelegramPaymentPurpose" ClassDeviceToken = "DeviceToken" ClassBackgroundFill = "BackgroundFill" ClassBackgroundType = "BackgroundType" @@ -181,6 +187,10 @@ const ( ClassChatAdministratorRights = "ChatAdministratorRights" ClassPremiumPaymentOption = "PremiumPaymentOption" ClassPremiumStatePaymentOption = "PremiumStatePaymentOption" + ClassPremiumGiftCodePaymentOption = "PremiumGiftCodePaymentOption" + ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions" + ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo" + ClassAccentColor = "AccentColor" ClassEmojiStatus = "EmojiStatus" ClassEmojiStatuses = "EmojiStatuses" ClassUsernames = "Usernames" @@ -213,6 +223,7 @@ const ( ClassMessageViewer = "MessageViewer" ClassMessageViewers = "MessageViewers" ClassMessageForwardInfo = "MessageForwardInfo" + ClassMessageImportInfo = "MessageImportInfo" ClassMessageReplyInfo = "MessageReplyInfo" ClassMessageReaction = "MessageReaction" ClassMessageInteractionInfo = "MessageInteractionInfo" @@ -259,6 +270,7 @@ const ( ClassForumTopicInfo = "ForumTopicInfo" ClassForumTopic = "ForumTopic" ClassForumTopics = "ForumTopics" + ClassLinkPreviewOptions = "LinkPreviewOptions" ClassPageBlockCaption = "PageBlockCaption" ClassPageBlockListItem = "PageBlockListItem" ClassPageBlockTableCell = "PageBlockTableCell" @@ -282,6 +294,7 @@ const ( ClassValidatedOrderInfo = "ValidatedOrderInfo" ClassPaymentResult = "PaymentResult" ClassPaymentReceipt = "PaymentReceipt" + ClassPremiumGiveawayParameters = "PremiumGiveawayParameters" ClassDatedFile = "DatedFile" ClassDate = "Date" ClassPersonalDetails = "PersonalDetails" @@ -321,6 +334,12 @@ const ( ClassStories = "Stories" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" + ClassPrepaidPremiumGiveaway = "PrepaidPremiumGiveaway" + ClassChatBoostStatus = "ChatBoostStatus" + ClassChatBoost = "ChatBoost" + ClassFoundChatBoosts = "FoundChatBoosts" + ClassChatBoostSlot = "ChatBoostSlot" + ClassChatBoostSlots = "ChatBoostSlots" ClassCallProtocol = "CallProtocol" ClassCallServer = "CallServer" ClassCallId = "CallId" @@ -383,6 +402,8 @@ const ( ClassConnectedWebsites = "ConnectedWebsites" ClassMessageLink = "MessageLink" ClassMessageLinkInfo = "MessageLinkInfo" + ClassChatBoostLink = "ChatBoostLink" + ClassChatBoostLinkInfo = "ChatBoostLinkInfo" ClassFilePart = "FilePart" ClassStorageStatisticsByFileType = "StorageStatisticsByFileType" ClassStorageStatisticsByChat = "StorageStatisticsByChat" @@ -395,6 +416,7 @@ const ( ClassScopeAutosaveSettings = "ScopeAutosaveSettings" ClassAutosaveSettingsException = "AutosaveSettingsException" ClassAutosaveSettings = "AutosaveSettings" + ClassFoundPosition = "FoundPosition" ClassFoundPositions = "FoundPositions" ClassTMeUrl = "TMeUrl" ClassTMeUrls = "TMeUrls" @@ -541,6 +563,17 @@ const ( TypeChatAdministratorRights = "chatAdministratorRights" TypePremiumPaymentOption = "premiumPaymentOption" TypePremiumStatePaymentOption = "premiumStatePaymentOption" + TypePremiumGiftCodePaymentOption = "premiumGiftCodePaymentOption" + TypePremiumGiftCodePaymentOptions = "premiumGiftCodePaymentOptions" + TypePremiumGiftCodeInfo = "premiumGiftCodeInfo" + TypePremiumGiveawayParticipantStatusEligible = "premiumGiveawayParticipantStatusEligible" + TypePremiumGiveawayParticipantStatusParticipating = "premiumGiveawayParticipantStatusParticipating" + TypePremiumGiveawayParticipantStatusAlreadyWasMember = "premiumGiveawayParticipantStatusAlreadyWasMember" + TypePremiumGiveawayParticipantStatusAdministrator = "premiumGiveawayParticipantStatusAdministrator" + TypePremiumGiveawayParticipantStatusDisallowedCountry = "premiumGiveawayParticipantStatusDisallowedCountry" + TypePremiumGiveawayInfoOngoing = "premiumGiveawayInfoOngoing" + TypePremiumGiveawayInfoCompleted = "premiumGiveawayInfoCompleted" + TypeAccentColor = "accentColor" TypeEmojiStatus = "emojiStatus" TypeEmojiStatuses = "emojiStatuses" TypeUsernames = "usernames" @@ -601,14 +634,14 @@ const ( TypeChatMessageSenders = "chatMessageSenders" TypeMessageViewer = "messageViewer" TypeMessageViewers = "messageViewers" - TypeMessageForwardOriginUser = "messageForwardOriginUser" - TypeMessageForwardOriginChat = "messageForwardOriginChat" - TypeMessageForwardOriginHiddenUser = "messageForwardOriginHiddenUser" - TypeMessageForwardOriginChannel = "messageForwardOriginChannel" - TypeMessageForwardOriginMessageImport = "messageForwardOriginMessageImport" + TypeMessageOriginUser = "messageOriginUser" + TypeMessageOriginHiddenUser = "messageOriginHiddenUser" + TypeMessageOriginChat = "messageOriginChat" + TypeMessageOriginChannel = "messageOriginChannel" TypeReactionTypeEmoji = "reactionTypeEmoji" TypeReactionTypeCustomEmoji = "reactionTypeCustomEmoji" TypeMessageForwardInfo = "messageForwardInfo" + TypeMessageImportInfo = "messageImportInfo" TypeMessageReplyInfo = "messageReplyInfo" TypeMessageReaction = "messageReaction" TypeMessageInteractionInfo = "messageInteractionInfo" @@ -617,6 +650,8 @@ const ( TypeMessageSendingStateFailed = "messageSendingStateFailed" TypeMessageReplyToMessage = "messageReplyToMessage" TypeMessageReplyToStory = "messageReplyToStory" + TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" + TypeInputMessageReplyToStory = "inputMessageReplyToStory" TypeMessage = "message" TypeMessages = "messages" TypeFoundMessages = "foundMessages" @@ -718,6 +753,7 @@ const ( TypeForumTopicInfo = "forumTopicInfo" TypeForumTopic = "forumTopic" TypeForumTopics = "forumTopics" + TypeLinkPreviewOptions = "linkPreviewOptions" TypeRichTextPlain = "richTextPlain" TypeRichTextBold = "richTextBold" TypeRichTextItalic = "richTextItalic" @@ -802,10 +838,12 @@ const ( TypePaymentReceipt = "paymentReceipt" TypeInputInvoiceMessage = "inputInvoiceMessage" TypeInputInvoiceName = "inputInvoiceName" + TypeInputInvoiceTelegram = "inputInvoiceTelegram" TypeMessageExtendedMediaPreview = "messageExtendedMediaPreview" TypeMessageExtendedMediaPhoto = "messageExtendedMediaPhoto" TypeMessageExtendedMediaVideo = "messageExtendedMediaVideo" TypeMessageExtendedMediaUnsupported = "messageExtendedMediaUnsupported" + TypePremiumGiveawayParameters = "premiumGiveawayParameters" TypeDatedFile = "datedFile" TypePassportElementTypePersonalDetails = "passportElementTypePersonalDetails" TypePassportElementTypePassport = "passportElementTypePassport" @@ -930,10 +968,12 @@ const ( TypeMessagePaymentSuccessful = "messagePaymentSuccessful" TypeMessagePaymentSuccessfulBot = "messagePaymentSuccessfulBot" TypeMessageGiftedPremium = "messageGiftedPremium" + TypeMessagePremiumGiftCode = "messagePremiumGiftCode" + TypeMessagePremiumGiveawayCreated = "messagePremiumGiveawayCreated" + TypeMessagePremiumGiveaway = "messagePremiumGiveaway" TypeMessageContactRegistered = "messageContactRegistered" TypeMessageUserShared = "messageUserShared" TypeMessageChatShared = "messageChatShared" - TypeMessageWebsiteConnected = "messageWebsiteConnected" TypeMessageBotWriteAccessAllowed = "messageBotWriteAccessAllowed" TypeMessageWebAppDataSent = "messageWebAppDataSent" TypeMessageWebAppDataReceived = "messageWebAppDataReceived" @@ -957,6 +997,7 @@ const ( TypeTextEntityTypeCode = "textEntityTypeCode" TypeTextEntityTypePre = "textEntityTypePre" TypeTextEntityTypePreCode = "textEntityTypePreCode" + TypeTextEntityTypeBlockQuote = "textEntityTypeBlockQuote" TypeTextEntityTypeTextUrl = "textEntityTypeTextUrl" TypeTextEntityTypeMentionName = "textEntityTypeMentionName" TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji" @@ -1040,10 +1081,12 @@ const ( TypeStoryAreaPosition = "storyAreaPosition" TypeStoryAreaTypeLocation = "storyAreaTypeLocation" TypeStoryAreaTypeVenue = "storyAreaTypeVenue" + TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" TypeStoryArea = "storyArea" TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" + TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" @@ -1059,6 +1102,15 @@ const ( TypeStories = "stories" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" + TypeChatBoostSourceGiftCode = "chatBoostSourceGiftCode" + TypeChatBoostSourceGiveaway = "chatBoostSourceGiveaway" + TypeChatBoostSourcePremium = "chatBoostSourcePremium" + TypePrepaidPremiumGiveaway = "prepaidPremiumGiveaway" + TypeChatBoostStatus = "chatBoostStatus" + TypeChatBoost = "chatBoost" + TypeFoundChatBoosts = "foundChatBoosts" + TypeChatBoostSlot = "chatBoostSlot" + TypeChatBoostSlots = "chatBoostSlots" TypeCallDiscardReasonEmpty = "callDiscardReasonEmpty" TypeCallDiscardReasonMissed = "callDiscardReasonMissed" TypeCallDiscardReasonDeclined = "callDiscardReasonDeclined" @@ -1115,6 +1167,10 @@ const ( TypeAttachmentMenuBotColor = "attachmentMenuBotColor" TypeAttachmentMenuBot = "attachmentMenuBot" TypeSentWebAppMessage = "sentWebAppMessage" + TypeBotWriteAccessAllowReasonConnectedWebsite = "botWriteAccessAllowReasonConnectedWebsite" + TypeBotWriteAccessAllowReasonAddedToAttachmentMenu = "botWriteAccessAllowReasonAddedToAttachmentMenu" + TypeBotWriteAccessAllowReasonLaunchedWebApp = "botWriteAccessAllowReasonLaunchedWebApp" + TypeBotWriteAccessAllowReasonAcceptedRequest = "botWriteAccessAllowReasonAcceptedRequest" TypeHttpUrl = "httpUrl" TypeUserLink = "userLink" TypeInputInlineQueryResultAnimation = "inputInlineQueryResultAnimation" @@ -1176,6 +1232,8 @@ const ( TypeChatEventTitleChanged = "chatEventTitleChanged" TypeChatEventUsernameChanged = "chatEventUsernameChanged" TypeChatEventActiveUsernamesChanged = "chatEventActiveUsernamesChanged" + TypeChatEventAccentColorChanged = "chatEventAccentColorChanged" + TypeChatEventBackgroundCustomEmojiChanged = "chatEventBackgroundCustomEmojiChanged" TypeChatEventHasProtectedContentToggled = "chatEventHasProtectedContentToggled" TypeChatEventInvitesToggled = "chatEventInvitesToggled" TypeChatEventIsAllHistoryAvailableToggled = "chatEventIsAllHistoryAvailableToggled" @@ -1222,6 +1280,7 @@ const ( TypePremiumLimitTypeWeeklySentStoryCount = "premiumLimitTypeWeeklySentStoryCount" TypePremiumLimitTypeMonthlySentStoryCount = "premiumLimitTypeMonthlySentStoryCount" TypePremiumLimitTypeStoryCaptionLength = "premiumLimitTypeStoryCaptionLength" + TypePremiumLimitTypeStorySuggestedReactionAreaCount = "premiumLimitTypeStorySuggestedReactionAreaCount" TypePremiumFeatureIncreasedLimits = "premiumFeatureIncreasedLimits" TypePremiumFeatureIncreasedUploadFileSize = "premiumFeatureIncreasedUploadFileSize" TypePremiumFeatureImprovedDownloadSpeed = "premiumFeatureImprovedDownloadSpeed" @@ -1238,6 +1297,8 @@ const ( TypePremiumFeatureAppIcons = "premiumFeatureAppIcons" TypePremiumFeatureRealTimeChatTranslation = "premiumFeatureRealTimeChatTranslation" TypePremiumFeatureUpgradedStories = "premiumFeatureUpgradedStories" + TypePremiumFeatureChatBoost = "premiumFeatureChatBoost" + TypePremiumFeatureAccentColor = "premiumFeatureAccentColor" TypePremiumStoryFeaturePriorityOrder = "premiumStoryFeaturePriorityOrder" TypePremiumStoryFeatureStealthMode = "premiumStoryFeatureStealthMode" TypePremiumStoryFeaturePermanentViewsHistory = "premiumStoryFeaturePermanentViewsHistory" @@ -1255,6 +1316,10 @@ const ( TypePremiumState = "premiumState" TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription" TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium" + TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes" + TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway" + TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes" + TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway" TypeDeviceTokenFirebaseCloudMessaging = "deviceTokenFirebaseCloudMessaging" TypeDeviceTokenApplePush = "deviceTokenApplePush" TypeDeviceTokenApplePushVoIP = "deviceTokenApplePushVoIP" @@ -1282,6 +1347,7 @@ const ( TypeHashtags = "hashtags" TypeCanSendStoryResultOk = "canSendStoryResultOk" TypeCanSendStoryResultPremiumNeeded = "canSendStoryResultPremiumNeeded" + TypeCanSendStoryResultBoostNeeded = "canSendStoryResultBoostNeeded" TypeCanSendStoryResultActiveStoryLimitExceeded = "canSendStoryResultActiveStoryLimitExceeded" TypeCanSendStoryResultWeeklyLimitExceeded = "canSendStoryResultWeeklyLimitExceeded" TypeCanSendStoryResultMonthlyLimitExceeded = "canSendStoryResultMonthlyLimitExceeded" @@ -1316,6 +1382,8 @@ const ( TypePushMessageContentLocation = "pushMessageContentLocation" TypePushMessageContentPhoto = "pushMessageContentPhoto" TypePushMessageContentPoll = "pushMessageContentPoll" + TypePushMessageContentPremiumGiftCode = "pushMessageContentPremiumGiftCode" + TypePushMessageContentPremiumGiveaway = "pushMessageContentPremiumGiveaway" TypePushMessageContentScreenshotTaken = "pushMessageContentScreenshotTaken" TypePushMessageContentSticker = "pushMessageContentSticker" TypePushMessageContentStory = "pushMessageContentStory" @@ -1427,6 +1495,7 @@ const ( TypeInternalLinkTypeBotStart = "internalLinkTypeBotStart" TypeInternalLinkTypeBotStartInGroup = "internalLinkTypeBotStartInGroup" TypeInternalLinkTypeChangePhoneNumber = "internalLinkTypeChangePhoneNumber" + TypeInternalLinkTypeChatBoost = "internalLinkTypeChatBoost" TypeInternalLinkTypeChatFolderInvite = "internalLinkTypeChatFolderInvite" TypeInternalLinkTypeChatFolderSettings = "internalLinkTypeChatFolderSettings" TypeInternalLinkTypeChatInvite = "internalLinkTypeChatInvite" @@ -1442,6 +1511,7 @@ const ( TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest" TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation" TypeInternalLinkTypePremiumFeatures = "internalLinkTypePremiumFeatures" + TypeInternalLinkTypePremiumGiftCode = "internalLinkTypePremiumGiftCode" TypeInternalLinkTypePrivacyAndSecuritySettings = "internalLinkTypePrivacyAndSecuritySettings" TypeInternalLinkTypeProxy = "internalLinkTypeProxy" TypeInternalLinkTypePublicChat = "internalLinkTypePublicChat" @@ -1461,6 +1531,8 @@ const ( TypeInternalLinkTypeWebApp = "internalLinkTypeWebApp" TypeMessageLink = "messageLink" TypeMessageLinkInfo = "messageLinkInfo" + TypeChatBoostLink = "chatBoostLink" + TypeChatBoostLinkInfo = "chatBoostLinkInfo" TypeBlockListMain = "blockListMain" TypeBlockListStories = "blockListStories" TypeFilePart = "filePart" @@ -1517,6 +1589,7 @@ const ( TypeTopChatCategoryInlineBots = "topChatCategoryInlineBots" TypeTopChatCategoryCalls = "topChatCategoryCalls" TypeTopChatCategoryForwardChats = "topChatCategoryForwardChats" + TypeFoundPosition = "foundPosition" TypeFoundPositions = "foundPositions" TypeTMeUrlTypeUser = "tMeUrlTypeUser" TypeTMeUrlTypeSupergroup = "tMeUrlTypeSupergroup" @@ -1584,6 +1657,8 @@ const ( TypeUpdateNewChat = "updateNewChat" TypeUpdateChatTitle = "updateChatTitle" TypeUpdateChatPhoto = "updateChatPhoto" + TypeUpdateChatAccentColor = "updateChatAccentColor" + TypeUpdateChatBackgroundCustomEmoji = "updateChatBackgroundCustomEmoji" TypeUpdateChatPermissions = "updateChatPermissions" TypeUpdateChatLastMessage = "updateChatLastMessage" TypeUpdateChatPosition = "updateChatPosition" @@ -1658,6 +1733,7 @@ const ( TypeUpdateSavedNotificationSounds = "updateSavedNotificationSounds" TypeUpdateSelectedBackground = "updateSelectedBackground" TypeUpdateChatThemes = "updateChatThemes" + TypeUpdateAccentColors = "updateAccentColors" TypeUpdateLanguagePackStrings = "updateLanguagePackStrings" TypeUpdateConnectionState = "updateConnectionState" TypeUpdateTermsOfService = "updateTermsOfService" @@ -1685,6 +1761,7 @@ const ( TypeUpdatePollAnswer = "updatePollAnswer" TypeUpdateChatMember = "updateChatMember" TypeUpdateNewChatJoinRequest = "updateNewChatJoinRequest" + TypeUpdateChatBoost = "updateChatBoost" TypeUpdates = "updates" TypeLogStreamDefault = "logStreamDefault" TypeLogStreamFile = "logStreamFile" @@ -1771,6 +1848,16 @@ type InputChatPhoto interface { InputChatPhotoType() string } +// Contains information about status of a user in a Telegram Premium giveaway +type PremiumGiveawayParticipantStatus interface { + PremiumGiveawayParticipantStatusType() string +} + +// Contains information about Telegram Premium giveaway +type PremiumGiveawayInfo interface { + PremiumGiveawayInfoType() string +} + // Provides information about the status of a member in a chat type ChatMemberStatus interface { ChatMemberStatusType() string @@ -1801,9 +1888,9 @@ type MessageSender interface { MessageSenderType() string } -// Contains information about the origin of a forwarded message -type MessageForwardOrigin interface { - MessageForwardOriginType() string +// Contains information about the origin of a message +type MessageOrigin interface { + MessageOriginType() string } // Describes type of message reaction @@ -1821,6 +1908,11 @@ type MessageReplyTo interface { MessageReplyToType() string } +// Contains information about the message or the story to be replied +type InputMessageReplyTo interface { + InputMessageReplyToType() string +} + // Describes source of a message type MessageSource interface { MessageSourceType() string @@ -2021,6 +2113,11 @@ type StoryList interface { StoryListType() string } +// Describes source of a chat boost +type ChatBoostSource interface { + ChatBoostSourceType() string +} + // Describes the reason why a call was discarded type CallDiscardReason interface { CallDiscardReasonType() string @@ -2061,6 +2158,11 @@ type SpeechRecognitionResult interface { SpeechRecognitionResultType() string } +// Describes a reason why a bot was allowed to write messages to the current user +type BotWriteAccessAllowReason interface { + BotWriteAccessAllowReasonType() string +} + // Represents a single result of an inline query; for bots only type InputInlineQueryResult interface { InputInlineQueryResultType() string @@ -2116,6 +2218,11 @@ type StorePaymentPurpose interface { StorePaymentPurposeType() string } +// Describes a purpose of a payment toward Telegram +type TelegramPaymentPurpose interface { + TelegramPaymentPurposeType() string +} + // Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org type DeviceToken interface { DeviceTokenType() string @@ -2136,7 +2243,7 @@ type InputBackground interface { InputBackgroundType() string } -// Represents result of checking whether the current user can send a story +// Represents result of checking whether the current user can send a story in the specific chat type CanSendStoryResult interface { CanSendStoryResultType() string } @@ -2873,7 +2980,7 @@ type FormattedText struct { meta // The text Text string `json:"text"` - // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other + // Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other Entities []*TextEntity `json:"entities"` } @@ -5724,15 +5831,15 @@ func (*InputChatPhotoSticker) InputChatPhotoType() string { // Describes actions that a user is allowed to take in a chat type ChatPermissions struct { meta - // True, if the user can send text messages, contacts, invoices, locations, and venues + // True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues CanSendBasicMessages bool `json:"can_send_basic_messages"` // True, if the user can send music files CanSendAudios bool `json:"can_send_audios"` // True, if the user can send documents CanSendDocuments bool `json:"can_send_documents"` - // True, if the user can send audio photos + // True, if the user can send photos CanSendPhotos bool `json:"can_send_photos"` - // True, if the user can send audio videos + // True, if the user can send videos CanSendVideos bool `json:"can_send_videos"` // True, if the user can send video notes CanSendVideoNotes bool `json:"can_send_video_notes"` @@ -5779,11 +5886,11 @@ func (*ChatPermissions) GetType() string { // Describes rights of the administrator type ChatAdministratorRights struct { meta - // True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only + // True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only CanManageChat bool `json:"can_manage_chat"` // True, if the administrator can change the chat title, photo, and other settings CanChangeInfo bool `json:"can_change_info"` - // True, if the administrator can create channel posts; applicable to channels only + // True, if the administrator can create channel posts or view channel statistics; applicable to channels only CanPostMessages bool `json:"can_post_messages"` // True, if the administrator can edit messages of other users and pin messages; applicable to channels only CanEditMessages bool `json:"can_edit_messages"` @@ -5791,7 +5898,7 @@ type ChatAdministratorRights struct { CanDeleteMessages bool `json:"can_delete_messages"` // True, if the administrator can invite new users to the chat CanInviteUsers bool `json:"can_invite_users"` - // True, if the administrator can restrict, ban, or unban chat members; always true for channels + // True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels CanRestrictMembers bool `json:"can_restrict_members"` // True, if the administrator can pin messages; applicable to basic groups and supergroups only CanPinMessages bool `json:"can_pin_messages"` @@ -5801,6 +5908,12 @@ type ChatAdministratorRights struct { CanPromoteMembers bool `json:"can_promote_members"` // True, if the administrator can manage video chats CanManageVideoChats bool `json:"can_manage_video_chats"` + // True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only + CanPostStories bool `json:"can_post_stories"` + // True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only + CanEditStories bool `json:"can_edit_stories"` + // True, if the administrator can delete stories posted by other users; applicable to channels only + CanDeleteStories bool `json:"can_delete_stories"` // True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only IsAnonymous bool `json:"is_anonymous"` } @@ -5910,6 +6023,375 @@ func (*PremiumStatePaymentOption) GetType() string { return TypePremiumStatePaymentOption } +// Describes an option for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOption struct { + meta + // ISO 4217 currency code for Telegram Premium gift code payment + Currency string `json:"currency"` + // The amount to pay, in the smallest units of the currency + Amount int64 `json:"amount"` + // Number of users which will be able to activate the gift codes + UserCount int32 `json:"user_count"` + // Number of month the Telegram Premium subscription will be active + MonthCount int32 `json:"month_count"` + // Identifier of the store product associated with the option; may be empty if none + StoreProductId string `json:"store_product_id"` + // Number of times the store product must be paid + StoreProductQuantity int32 `json:"store_product_quantity"` +} + +func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOption + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOption) GetClass() string { + return ClassPremiumGiftCodePaymentOption +} + +func (*PremiumGiftCodePaymentOption) GetType() string { + return TypePremiumGiftCodePaymentOption +} + +// Contains a list of options for creating Telegram Premium gift codes +type PremiumGiftCodePaymentOptions struct { + meta + // The list of options + Options []*PremiumGiftCodePaymentOption `json:"options"` +} + +func (entity *PremiumGiftCodePaymentOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodePaymentOptions + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodePaymentOptions) GetClass() string { + return ClassPremiumGiftCodePaymentOptions +} + +func (*PremiumGiftCodePaymentOptions) GetType() string { + return TypePremiumGiftCodePaymentOptions +} + +// Contains information about a Telegram Premium gift code +type PremiumGiftCodeInfo struct { + meta + // Identifier of a chat or a user that created the gift code + CreatorId MessageSender `json:"creator_id"` + // Point in time (Unix timestamp) when the code was created + CreationDate int32 `json:"creation_date"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Identifier of a user for which the code was created; 0 if none + UserId int64 `json:"user_id"` + // Point in time (Unix timestamp) when the code was activated; 0 if none + UseDate int32 `json:"use_date"` +} + +func (entity *PremiumGiftCodeInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiftCodeInfo + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiftCodeInfo) GetClass() string { + return ClassPremiumGiftCodeInfo +} + +func (*PremiumGiftCodeInfo) GetType() string { + return TypePremiumGiftCodeInfo +} + +func (premiumGiftCodeInfo *PremiumGiftCodeInfo) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + CreationDate int32 `json:"creation_date"` + IsFromGiveaway bool `json:"is_from_giveaway"` + GiveawayMessageId int64 `json:"giveaway_message_id"` + MonthCount int32 `json:"month_count"` + UserId int64 `json:"user_id"` + UseDate int32 `json:"use_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiftCodeInfo.CreationDate = tmp.CreationDate + premiumGiftCodeInfo.IsFromGiveaway = tmp.IsFromGiveaway + premiumGiftCodeInfo.GiveawayMessageId = tmp.GiveawayMessageId + premiumGiftCodeInfo.MonthCount = tmp.MonthCount + premiumGiftCodeInfo.UserId = tmp.UserId + premiumGiftCodeInfo.UseDate = tmp.UseDate + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + premiumGiftCodeInfo.CreatorId = fieldCreatorId + + return nil +} + +// The user is eligible for the giveaway +type PremiumGiveawayParticipantStatusEligible struct{ + meta +} + +func (entity *PremiumGiveawayParticipantStatusEligible) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusEligible + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusEligible) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusEligible) GetType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +func (*PremiumGiveawayParticipantStatusEligible) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusEligible +} + +// The user participates in the giveaway +type PremiumGiveawayParticipantStatusParticipating struct{ + meta +} + +func (entity *PremiumGiveawayParticipantStatusParticipating) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusParticipating + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusParticipating) GetType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +func (*PremiumGiveawayParticipantStatusParticipating) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusParticipating +} + +// The user can't participate in the giveaway, because they have already been member of the chat +type PremiumGiveawayParticipantStatusAlreadyWasMember struct { + meta + // Point in time (Unix timestamp) when the user joined the chat + JoinedChatDate int32 `json:"joined_chat_date"` +} + +func (entity *PremiumGiveawayParticipantStatusAlreadyWasMember) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAlreadyWasMember + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) GetType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +func (*PremiumGiveawayParticipantStatusAlreadyWasMember) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAlreadyWasMember +} + +// The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway +type PremiumGiveawayParticipantStatusAdministrator struct { + meta + // Identifier of the chat administered by the user + ChatId int64 `json:"chat_id"` +} + +func (entity *PremiumGiveawayParticipantStatusAdministrator) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusAdministrator + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusAdministrator) GetType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +func (*PremiumGiveawayParticipantStatusAdministrator) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusAdministrator +} + +// The user can't participate in the giveaway, because they phone number is from a disallowed country +type PremiumGiveawayParticipantStatusDisallowedCountry struct { + meta + // A two-letter ISO 3166-1 alpha-2 country code of the user's country + UserCountryCode string `json:"user_country_code"` +} + +func (entity *PremiumGiveawayParticipantStatusDisallowedCountry) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParticipantStatusDisallowedCountry + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetClass() string { + return ClassPremiumGiveawayParticipantStatus +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) GetType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +func (*PremiumGiveawayParticipantStatusDisallowedCountry) PremiumGiveawayParticipantStatusType() string { + return TypePremiumGiveawayParticipantStatusDisallowedCountry +} + +// Describes an ongoing giveaway +type PremiumGiveawayInfoOngoing struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Status of the current user in the giveaway + Status PremiumGiveawayParticipantStatus `json:"status"` + // True, if the giveaway has ended and results are being prepared + IsEnded bool `json:"is_ended"` +} + +func (entity *PremiumGiveawayInfoOngoing) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoOngoing + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoOngoing) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoOngoing) GetType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (*PremiumGiveawayInfoOngoing) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoOngoing +} + +func (premiumGiveawayInfoOngoing *PremiumGiveawayInfoOngoing) UnmarshalJSON(data []byte) error { + var tmp struct { + CreationDate int32 `json:"creation_date"` + Status json.RawMessage `json:"status"` + IsEnded bool `json:"is_ended"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + premiumGiveawayInfoOngoing.CreationDate = tmp.CreationDate + premiumGiveawayInfoOngoing.IsEnded = tmp.IsEnded + + fieldStatus, _ := UnmarshalPremiumGiveawayParticipantStatus(tmp.Status) + premiumGiveawayInfoOngoing.Status = fieldStatus + + return nil +} + +// Describes a completed giveaway +type PremiumGiveawayInfoCompleted struct { + meta + // Point in time (Unix timestamp) when the giveaway was created + CreationDate int32 `json:"creation_date"` + // Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway + ActualWinnersSelectionDate int32 `json:"actual_winners_selection_date"` + // True, if the giveaway was canceled and was fully refunded + WasRefunded bool `json:"was_refunded"` + // Number of winners in the giveaway + WinnerCount int32 `json:"winner_count"` + // Number of winners, which activated their gift codes + ActivationCount int32 `json:"activation_count"` + // Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway + GiftCode string `json:"gift_code"` +} + +func (entity *PremiumGiveawayInfoCompleted) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayInfoCompleted + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayInfoCompleted) GetClass() string { + return ClassPremiumGiveawayInfo +} + +func (*PremiumGiveawayInfoCompleted) GetType() string { + return TypePremiumGiveawayInfoCompleted +} + +func (*PremiumGiveawayInfoCompleted) PremiumGiveawayInfoType() string { + return TypePremiumGiveawayInfoCompleted +} + +// Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +type AccentColor struct { + meta + // Accent color identifier + Id int32 `json:"id"` + // Identifier of a built-in color to use in places, where only one color is needed; 0-6 + BuiltInAccentColorId int32 `json:"built_in_accent_color_id"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes + LightThemeColors []int32 `json:"light_theme_colors"` + // The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes + DarkThemeColors []int32 `json:"dark_theme_colors"` +} + +func (entity *AccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub AccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*AccentColor) GetClass() string { + return ClassAccentColor +} + +func (*AccentColor) GetType() string { + return TypeAccentColor +} + // Describes a custom emoji to be shown instead of the Telegram Premium badge type EmojiStatus struct { meta @@ -6004,6 +6486,10 @@ type User struct { Status UserStatus `json:"status"` // Profile photo of the user; may be null ProfilePhoto *ProfilePhoto `json:"profile_photo"` + // Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` // Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only EmojiStatus *EmojiStatus `json:"emoji_status"` // The user is a contact of the current user @@ -6064,6 +6550,8 @@ func (user *User) UnmarshalJSON(data []byte) error { PhoneNumber string `json:"phone_number"` Status json.RawMessage `json:"status"` ProfilePhoto *ProfilePhoto `json:"profile_photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` EmojiStatus *EmojiStatus `json:"emoji_status"` IsContact bool `json:"is_contact"` IsMutualContact bool `json:"is_mutual_contact"` @@ -6094,6 +6582,8 @@ func (user *User) UnmarshalJSON(data []byte) error { user.Usernames = tmp.Usernames user.PhoneNumber = tmp.PhoneNumber user.ProfilePhoto = tmp.ProfilePhoto + user.AccentColorId = tmp.AccentColorId + user.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId user.EmojiStatus = tmp.EmojiStatus user.IsContact = tmp.IsContact user.IsMutualContact = tmp.IsMutualContact @@ -7280,6 +7770,8 @@ type ChatInviteLinkInfo struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` // Chat description Description string `json:"description"` // Number of members in the chat @@ -7321,6 +7813,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { Type json.RawMessage `json:"type"` Title string `json:"title"` Photo *ChatPhotoInfo `json:"photo"` + AccentColorId int32 `json:"accent_color_id"` Description string `json:"description"` MemberCount int32 `json:"member_count"` MemberUserIds []int64 `json:"member_user_ids"` @@ -7340,6 +7833,7 @@ func (chatInviteLinkInfo *ChatInviteLinkInfo) UnmarshalJSON(data []byte) error { chatInviteLinkInfo.AccessibleFor = tmp.AccessibleFor chatInviteLinkInfo.Title = tmp.Title chatInviteLinkInfo.Photo = tmp.Photo + chatInviteLinkInfo.AccentColorId = tmp.AccentColorId chatInviteLinkInfo.Description = tmp.Description chatInviteLinkInfo.MemberCount = tmp.MemberCount chatInviteLinkInfo.MemberUserIds = tmp.MemberUserIds @@ -7570,6 +8064,10 @@ type Supergroup struct { IsScam bool `json:"is_scam"` // True, if many users reported this supergroup or channel as a fake account IsFake bool `json:"is_fake"` + // True, if the channel has non-expired stories available to the current user + HasActiveStories bool `json:"has_active_stories"` + // True, if the channel has unread non-expired stories available to the current user + HasUnreadActiveStories bool `json:"has_unread_active_stories"` } func (entity *Supergroup) MarshalJSON() ([]byte, error) { @@ -7609,6 +8107,8 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { RestrictionReason string `json:"restriction_reason"` IsScam bool `json:"is_scam"` IsFake bool `json:"is_fake"` + HasActiveStories bool `json:"has_active_stories"` + HasUnreadActiveStories bool `json:"has_unread_active_stories"` } err := json.Unmarshal(data, &tmp) @@ -7634,6 +8134,8 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error { supergroup.RestrictionReason = tmp.RestrictionReason supergroup.IsScam = tmp.IsScam supergroup.IsFake = tmp.IsFake + supergroup.HasActiveStories = tmp.HasActiveStories + supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories fieldStatus, _ := UnmarshalChatMemberStatus(tmp.Status) supergroup.Status = fieldStatus @@ -7680,6 +8182,8 @@ type SupergroupFullInfo struct { IsAllHistoryAvailable bool `json:"is_all_history_available"` // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled"` + // True, if the channel has pinned stories + HasPinnedStories bool `json:"has_pinned_stories"` // Identifier of the supergroup sticker set; 0 if none StickerSetId JsonInt64 `json:"sticker_set_id"` // Location to which the supergroup is connected; may be null if none @@ -8059,34 +8563,61 @@ func (*MessageViewers) GetType() string { } // The message was originally sent by a known user -type MessageForwardOriginUser struct { +type MessageOriginUser struct { meta // Identifier of the user that originally sent the message SenderUserId int64 `json:"sender_user_id"` } -func (entity *MessageForwardOriginUser) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginUser) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginUser + type stub MessageOriginUser return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginUser) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginUser) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginUser) GetType() string { - return TypeMessageForwardOriginUser +func (*MessageOriginUser) GetType() string { + return TypeMessageOriginUser } -func (*MessageForwardOriginUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginUser +func (*MessageOriginUser) MessageOriginType() string { + return TypeMessageOriginUser +} + +// The message was originally sent by a user, which is hidden by their privacy settings +type MessageOriginHiddenUser struct { + meta + // Name of the sender + SenderName string `json:"sender_name"` +} + +func (entity *MessageOriginHiddenUser) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageOriginHiddenUser + + return json.Marshal((*stub)(entity)) +} + +func (*MessageOriginHiddenUser) GetClass() string { + return ClassMessageOrigin +} + +func (*MessageOriginHiddenUser) GetType() string { + return TypeMessageOriginHiddenUser +} + +func (*MessageOriginHiddenUser) MessageOriginType() string { + return TypeMessageOriginHiddenUser } // The message was originally sent on behalf of a chat -type MessageForwardOriginChat struct { +type MessageOriginChat struct { meta // Identifier of the chat that originally sent the message SenderChatId int64 `json:"sender_chat_id"` @@ -8094,57 +8625,30 @@ type MessageForwardOriginChat struct { AuthorSignature string `json:"author_signature"` } -func (entity *MessageForwardOriginChat) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginChat) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginChat + type stub MessageOriginChat return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginChat) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginChat) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginChat) GetType() string { - return TypeMessageForwardOriginChat +func (*MessageOriginChat) GetType() string { + return TypeMessageOriginChat } -func (*MessageForwardOriginChat) MessageForwardOriginType() string { - return TypeMessageForwardOriginChat -} - -// The message was originally sent by a user, which is hidden by their privacy settings -type MessageForwardOriginHiddenUser struct { - meta - // Name of the sender - SenderName string `json:"sender_name"` -} - -func (entity *MessageForwardOriginHiddenUser) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginHiddenUser - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginHiddenUser) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginHiddenUser) GetType() string { - return TypeMessageForwardOriginHiddenUser -} - -func (*MessageForwardOriginHiddenUser) MessageForwardOriginType() string { - return TypeMessageForwardOriginHiddenUser +func (*MessageOriginChat) MessageOriginType() string { + return TypeMessageOriginChat } // The message was originally a post in a channel -type MessageForwardOriginChannel struct { +type MessageOriginChannel struct { meta - // Identifier of the chat from which the message was originally forwarded + // Identifier of the channel chat to which the message was originally sent ChatId int64 `json:"chat_id"` // Message identifier of the original message MessageId int64 `json:"message_id"` @@ -8152,51 +8656,24 @@ type MessageForwardOriginChannel struct { AuthorSignature string `json:"author_signature"` } -func (entity *MessageForwardOriginChannel) MarshalJSON() ([]byte, error) { +func (entity *MessageOriginChannel) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub MessageForwardOriginChannel + type stub MessageOriginChannel return json.Marshal((*stub)(entity)) } -func (*MessageForwardOriginChannel) GetClass() string { - return ClassMessageForwardOrigin +func (*MessageOriginChannel) GetClass() string { + return ClassMessageOrigin } -func (*MessageForwardOriginChannel) GetType() string { - return TypeMessageForwardOriginChannel +func (*MessageOriginChannel) GetType() string { + return TypeMessageOriginChannel } -func (*MessageForwardOriginChannel) MessageForwardOriginType() string { - return TypeMessageForwardOriginChannel -} - -// The message was imported from an exported message history -type MessageForwardOriginMessageImport struct { - meta - // Name of the sender - SenderName string `json:"sender_name"` -} - -func (entity *MessageForwardOriginMessageImport) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageForwardOriginMessageImport - - return json.Marshal((*stub)(entity)) -} - -func (*MessageForwardOriginMessageImport) GetClass() string { - return ClassMessageForwardOrigin -} - -func (*MessageForwardOriginMessageImport) GetType() string { - return TypeMessageForwardOriginMessageImport -} - -func (*MessageForwardOriginMessageImport) MessageForwardOriginType() string { - return TypeMessageForwardOriginMessageImport +func (*MessageOriginChannel) MessageOriginType() string { + return TypeMessageOriginChannel } // A reaction with an emoji @@ -8256,8 +8733,8 @@ func (*ReactionTypeCustomEmoji) ReactionTypeType() string { // Contains information about a forwarded message type MessageForwardInfo struct { meta - // Origin of a forwarded message - Origin MessageForwardOrigin `json:"origin"` + // Origin of the forwarded message + Origin MessageOrigin `json:"origin"` // Point in time (Unix timestamp) when the message was originally sent Date int32 `json:"date"` // The type of a public service announcement for the forwarded message @@ -8303,12 +8780,37 @@ func (messageForwardInfo *MessageForwardInfo) UnmarshalJSON(data []byte) error { messageForwardInfo.FromChatId = tmp.FromChatId messageForwardInfo.FromMessageId = tmp.FromMessageId - fieldOrigin, _ := UnmarshalMessageForwardOrigin(tmp.Origin) + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) messageForwardInfo.Origin = fieldOrigin return nil } +// Contains information about a message created with importMessages +type MessageImportInfo struct { + meta + // Name of the original sender + SenderName string `json:"sender_name"` + // Point in time (Unix timestamp) when the message was originally sent + Date int32 `json:"date"` +} + +func (entity *MessageImportInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessageImportInfo + + return json.Marshal((*stub)(entity)) +} + +func (*MessageImportInfo) GetClass() string { + return ClassMessageImportInfo +} + +func (*MessageImportInfo) GetType() string { + return TypeMessageImportInfo +} + // Contains information about replies to a message type MessageReplyInfo struct { meta @@ -8374,6 +8876,8 @@ type MessageReaction struct { TotalCount int32 `json:"total_count"` // True, if the reaction is chosen by the current user IsChosen bool `json:"is_chosen"` + // Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen + UsedSenderId MessageSender `json:"used_sender_id"` // Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats RecentSenderIds []MessageSender `json:"recent_sender_ids"` } @@ -8399,6 +8903,7 @@ func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { Type json.RawMessage `json:"type"` TotalCount int32 `json:"total_count"` IsChosen bool `json:"is_chosen"` + UsedSenderId json.RawMessage `json:"used_sender_id"` RecentSenderIds []json.RawMessage `json:"recent_sender_ids"` } @@ -8413,6 +8918,9 @@ func (messageReaction *MessageReaction) UnmarshalJSON(data []byte) error { fieldType, _ := UnmarshalReactionType(tmp.Type) messageReaction.Type = fieldType + fieldUsedSenderId, _ := UnmarshalMessageSender(tmp.UsedSenderId) + messageReaction.UsedSenderId = fieldUsedSenderId + fieldRecentSenderIds, _ := UnmarshalListOfMessageSender(tmp.RecentSenderIds) messageReaction.RecentSenderIds = fieldRecentSenderIds @@ -8528,14 +9036,16 @@ func (*MessageSendingStatePending) MessageSendingStateType() string { // The message failed to be sent type MessageSendingStateFailed struct { meta - // An error code; 0 if unknown - ErrorCode int32 `json:"error_code"` - // Error message - ErrorMessage string `json:"error_message"` + // The cause of the message sending failure + Error *Error `json:"error"` // True, if the message can be re-sent 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"` + // True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message + NeedAnotherReplyQuote bool `json:"need_another_reply_quote"` + // True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages + NeedDropReply bool `json:"need_drop_reply"` // Time left before the message can be re-sent, in seconds. No update is sent when this field changes RetryAfter float64 `json:"retry_after"` } @@ -8560,13 +9070,23 @@ func (*MessageSendingStateFailed) MessageSendingStateType() string { return TypeMessageSendingStateFailed } -// Describes a replied message +// Describes a message replied by a given message type MessageReplyToMessage struct { meta - // The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats + // The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat ChatId int64 `json:"chat_id"` - // The identifier of the replied message + // The identifier of the message; may be 0 if the replied message is in unknown chat MessageId int64 `json:"message_id"` + // Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote + Quote *FormattedText `json:"quote"` + // True, if the quote was manually chosen by the message sender + IsQuoteManual bool `json:"is_quote_manual"` + // Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat + Origin MessageOrigin `json:"origin"` + // Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat + OriginSendDate int32 `json:"origin_send_date"` + // Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote + Content MessageContent `json:"content"` } func (entity *MessageReplyToMessage) MarshalJSON() ([]byte, error) { @@ -8589,12 +9109,43 @@ func (*MessageReplyToMessage) MessageReplyToType() string { return TypeMessageReplyToMessage } -// Describes a replied story +func (messageReplyToMessage *MessageReplyToMessage) UnmarshalJSON(data []byte) error { + var tmp struct { + ChatId int64 `json:"chat_id"` + MessageId int64 `json:"message_id"` + Quote *FormattedText `json:"quote"` + IsQuoteManual bool `json:"is_quote_manual"` + Origin json.RawMessage `json:"origin"` + OriginSendDate int32 `json:"origin_send_date"` + Content json.RawMessage `json:"content"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messageReplyToMessage.ChatId = tmp.ChatId + messageReplyToMessage.MessageId = tmp.MessageId + messageReplyToMessage.Quote = tmp.Quote + messageReplyToMessage.IsQuoteManual = tmp.IsQuoteManual + messageReplyToMessage.OriginSendDate = tmp.OriginSendDate + + fieldOrigin, _ := UnmarshalMessageOrigin(tmp.Origin) + messageReplyToMessage.Origin = fieldOrigin + + fieldContent, _ := UnmarshalMessageContent(tmp.Content) + messageReplyToMessage.Content = fieldContent + + return nil +} + +// Describes a story replied by a given message type MessageReplyToStory struct { meta - // The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat + // The identifier of the sender of the story StorySenderChatId int64 `json:"story_sender_chat_id"` - // The identifier of the replied story + // The identifier of the story StoryId int32 `json:"story_id"` } @@ -8618,6 +9169,66 @@ func (*MessageReplyToStory) MessageReplyToType() string { return TypeMessageReplyToStory } +// Describes a message to be replied +type InputMessageReplyToMessage struct { + meta + // The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat + ChatId int64 `json:"chat_id"` + // The identifier of the message to be replied in the same or the specified chat + MessageId int64 `json:"message_id"` + // Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote + Quote *FormattedText `json:"quote"` +} + +func (entity *InputMessageReplyToMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToMessage) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToMessage) GetType() string { + return TypeInputMessageReplyToMessage +} + +func (*InputMessageReplyToMessage) InputMessageReplyToType() string { + return TypeInputMessageReplyToMessage +} + +// Describes a story to be replied +type InputMessageReplyToStory struct { + meta + // The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat + StorySenderChatId int64 `json:"story_sender_chat_id"` + // The identifier of the story + StoryId int32 `json:"story_id"` +} + +func (entity *InputMessageReplyToStory) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToStory + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToStory) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToStory) GetType() string { + return TypeInputMessageReplyToStory +} + +func (*InputMessageReplyToStory) InputMessageReplyToType() string { + return TypeInputMessageReplyToStory +} + // Describes a message type Message struct { meta @@ -8639,6 +9250,8 @@ type Message struct { 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 + 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 @@ -8671,6 +9284,8 @@ type Message struct { EditDate int32 `json:"edit_date"` // Information about the initial message sender; may be null if none or unknown ForwardInfo *MessageForwardInfo `json:"forward_info"` + // Information about the initial message for messages created with importMessages; may be null if the message isn't imported + ImportInfo *MessageImportInfo `json:"import_info"` // Information about interactions with the message; may be null if none InteractionInfo *MessageInteractionInfo `json:"interaction_info"` // Information about unread reactions added to the message @@ -8681,7 +9296,7 @@ type Message struct { MessageThreadId int64 `json:"message_thread_id"` // The message's self-destruct type; may be null if none SelfDestructType MessageSelfDestructType `json:"self_destruct_type"` - // Time left before the message self-destruct timer expires, in seconds; 0 if self-desctruction isn't scheduled yet + // Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet SelfDestructIn float64 `json:"self_destruct_in"` // Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never AutoDeleteIn float64 `json:"auto_delete_in"` @@ -8726,6 +9341,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { IsPinned bool `json:"is_pinned"` 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"` @@ -8742,6 +9358,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { Date int32 `json:"date"` EditDate int32 `json:"edit_date"` ForwardInfo *MessageForwardInfo `json:"forward_info"` + ImportInfo *MessageImportInfo `json:"import_info"` InteractionInfo *MessageInteractionInfo `json:"interaction_info"` UnreadReactions []*UnreadReaction `json:"unread_reactions"` ReplyTo json.RawMessage `json:"reply_to"` @@ -8768,6 +9385,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.IsPinned = tmp.IsPinned message.CanBeEdited = tmp.CanBeEdited message.CanBeForwarded = tmp.CanBeForwarded + message.CanBeRepliedInAnotherChat = tmp.CanBeRepliedInAnotherChat message.CanBeSaved = tmp.CanBeSaved message.CanBeDeletedOnlyForSelf = tmp.CanBeDeletedOnlyForSelf message.CanBeDeletedForAllUsers = tmp.CanBeDeletedForAllUsers @@ -8784,6 +9402,7 @@ func (message *Message) UnmarshalJSON(data []byte) error { message.Date = tmp.Date message.EditDate = tmp.EditDate message.ForwardInfo = tmp.ForwardInfo + message.ImportInfo = tmp.ImportInfo message.InteractionInfo = tmp.InteractionInfo message.UnreadReactions = tmp.UnreadReactions message.MessageThreadId = tmp.MessageThreadId @@ -9787,8 +10406,8 @@ func (*ScopeNotificationSettings) GetType() string { // Contains information about a message draft type DraftMessage struct { meta - // Identifier of the replied message; 0 if none - ReplyToMessageId int64 `json:"reply_to_message_id"` + // Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none + ReplyTo InputMessageReplyTo `json:"reply_to"` // Point in time (Unix timestamp) when the draft was created Date int32 `json:"date"` // Content of the message draft; must be of the type inputMessageText @@ -9813,7 +10432,7 @@ func (*DraftMessage) GetType() string { func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { var tmp struct { - ReplyToMessageId int64 `json:"reply_to_message_id"` + ReplyTo json.RawMessage `json:"reply_to"` Date int32 `json:"date"` InputMessageText json.RawMessage `json:"input_message_text"` } @@ -9823,9 +10442,11 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { return err } - draftMessage.ReplyToMessageId = tmp.ReplyToMessageId draftMessage.Date = tmp.Date + fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) + draftMessage.ReplyTo = fieldReplyTo + fieldInputMessageText, _ := UnmarshalInputMessageContent(tmp.InputMessageText) draftMessage.InputMessageText = fieldInputMessageText @@ -10550,6 +11171,10 @@ type Chat struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview + AccentColorId int32 `json:"accent_color_id"` + // Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` // Actions that non-administrator chat members are allowed to take in the chat Permissions *ChatPermissions `json:"permissions"` // Last message in the chat; may be null if none or unknown @@ -10632,6 +11257,8 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { Type json.RawMessage `json:"type"` Title string `json:"title"` Photo *ChatPhotoInfo `json:"photo"` + AccentColorId int32 `json:"accent_color_id"` + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` Permissions *ChatPermissions `json:"permissions"` LastMessage *Message `json:"last_message"` Positions []*ChatPosition `json:"positions"` @@ -10671,6 +11298,8 @@ func (chat *Chat) UnmarshalJSON(data []byte) error { chat.Id = tmp.Id chat.Title = tmp.Title chat.Photo = tmp.Photo + chat.AccentColorId = tmp.AccentColorId + chat.BackgroundCustomEmojiId = tmp.BackgroundCustomEmojiId chat.Permissions = tmp.Permissions chat.LastMessage = tmp.LastMessage chat.Positions = tmp.Positions @@ -11777,8 +12406,6 @@ type FoundWebApp struct { meta // The Web App WebApp *WebApp `json:"web_app"` - // True, if the app supports "settings_button_pressed" event - SupportsSettings bool `json:"supports_settings"` // True, if the user must be asked for the permission to the bot to send them messages RequestWriteAccess bool `json:"request_write_access"` // True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden @@ -12028,6 +12655,37 @@ func (*ForumTopics) GetType() string { return TypeForumTopics } +// Options to be used for generation of a link preview +type LinkPreviewOptions struct { + meta + // True, if link preview must be disabled + IsDisabled bool `json:"is_disabled"` + // URL to use for link preview. If empty, then the first URL found in the message text will be used + Url string `json:"url"` + // True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified + ForceSmallMedia bool `json:"force_small_media"` + // True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified + ForceLargeMedia bool `json:"force_large_media"` + // True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats + ShowAboveText bool `json:"show_above_text"` +} + +func (entity *LinkPreviewOptions) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LinkPreviewOptions + + return json.Marshal((*stub)(entity)) +} + +func (*LinkPreviewOptions) GetClass() string { + return ClassLinkPreviewOptions +} + +func (*LinkPreviewOptions) GetType() string { + return TypeLinkPreviewOptions +} + // A plain text type RichTextPlain struct { meta @@ -14066,6 +14724,8 @@ type PageBlockChatLink struct { Title string `json:"title"` // Chat photo; may be null Photo *ChatPhotoInfo `json:"photo"` + // Identifier of the accent color for chat title and background of chat photo + AccentColorId int32 `json:"accent_color_id"` // Chat username by which all other information about the chat can be resolved Username string `json:"username"` } @@ -14345,7 +15005,7 @@ func (webPageInstantView *WebPageInstantView) UnmarshalJSON(data []byte) error { return nil } -// Describes a web page preview +// Describes a link preview type WebPage struct { meta // Original URL of the link @@ -14374,6 +15034,14 @@ type WebPage struct { Duration int32 `json:"duration"` // Author of the content Author string `json:"author"` + // True, if the preview has large media and its appearance can be changed + HasLargeMedia bool `json:"has_large_media"` + // True, if large media preview must be shown + ShowLargeMedia bool `json:"show_large_media"` + // 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 @@ -14585,8 +15253,20 @@ type ThemeParameters struct { BackgroundColor int32 `json:"background_color"` // A secondary color for the background in the RGB24 format SecondaryBackgroundColor int32 `json:"secondary_background_color"` + // A color of the header background in the RGB24 format + HeaderBackgroundColor int32 `json:"header_background_color"` + // A color of the section background in the RGB24 format + SectionBackgroundColor int32 `json:"section_background_color"` // A color of text in the RGB24 format TextColor int32 `json:"text_color"` + // An accent color of the text in the RGB24 format + AccentTextColor int32 `json:"accent_text_color"` + // A color of text on the section headers in the RGB24 format + SectionHeaderTextColor int32 `json:"section_header_text_color"` + // A color of the subtitle text in the RGB24 format + SubtitleTextColor int32 `json:"subtitle_text_color"` + // A color of the text for destructive actions in the RGB24 format + DestructiveTextColor int32 `json:"destructive_text_color"` // A color of hints in the RGB24 format HintColor int32 `json:"hint_color"` // A color of links in the RGB24 format @@ -14651,6 +15331,8 @@ type Invoice struct { SuggestedTipAmounts []int64 `json:"suggested_tip_amounts"` // An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay RecurringPaymentTermsOfServiceUrl string `json:"recurring_payment_terms_of_service_url"` + // An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay + TermsOfServiceUrl string `json:"terms_of_service_url"` // True, if the payment is a test payment IsTest bool `json:"is_test"` // True, if the user's name is needed for payment @@ -15225,6 +15907,49 @@ func (*InputInvoiceName) InputInvoiceType() string { return TypeInputInvoiceName } +// An invoice for a payment toward Telegram; must not be used in the in-store apps +type InputInvoiceTelegram struct { + meta + // Transaction purpose + Purpose TelegramPaymentPurpose `json:"purpose"` +} + +func (entity *InputInvoiceTelegram) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputInvoiceTelegram + + return json.Marshal((*stub)(entity)) +} + +func (*InputInvoiceTelegram) GetClass() string { + return ClassInputInvoice +} + +func (*InputInvoiceTelegram) GetType() string { + return TypeInputInvoiceTelegram +} + +func (*InputInvoiceTelegram) InputInvoiceType() string { + return TypeInputInvoiceTelegram +} + +func (inputInvoiceTelegram *InputInvoiceTelegram) UnmarshalJSON(data []byte) error { + var tmp struct { + Purpose json.RawMessage `json:"purpose"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldPurpose, _ := UnmarshalTelegramPaymentPurpose(tmp.Purpose) + inputInvoiceTelegram.Purpose = fieldPurpose + + return nil +} + // The media is hidden until the invoice is paid type MessageExtendedMediaPreview struct { meta @@ -15345,6 +16070,37 @@ func (*MessageExtendedMediaUnsupported) MessageExtendedMediaType() string { return TypeMessageExtendedMediaUnsupported } +// Describes parameters of a Telegram Premium giveaway +type PremiumGiveawayParameters struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription + BoostedChatId int64 `json:"boosted_chat_id"` + // Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats + AdditionalChatIds []int64 `json:"additional_chat_ids"` + // Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways + WinnersSelectionDate int32 `json:"winners_selection_date"` + // True, if only new subscribers of the chats will be eligible for the giveaway + OnlyNewMembers bool `json:"only_new_members"` + // The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list + CountryCodes []string `json:"country_codes"` +} + +func (entity *PremiumGiveawayParameters) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumGiveawayParameters + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumGiveawayParameters) GetClass() string { + return ClassPremiumGiveawayParameters +} + +func (*PremiumGiveawayParameters) GetType() string { + return TypePremiumGiveawayParameters +} + // File with the date it was uploaded type DatedFile struct { meta @@ -17499,8 +18255,10 @@ type MessageText struct { meta // Text of the message Text *FormattedText `json:"text"` - // A preview of the web page that's mentioned in the text; may be null + // A link preview attached to the message; may be null WebPage *WebPage `json:"web_page"` + // Options which was used for generation of the link preview; may be null if default options were used + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` } func (entity *MessageText) MarshalJSON() ([]byte, error) { @@ -19082,6 +19840,128 @@ func (*MessageGiftedPremium) MessageContentType() string { return TypeMessageGiftedPremium } +// A Telegram Premium gift code was created for the user +type MessagePremiumGiftCode struct { + meta + // Identifier of a chat or a user that created the gift code + CreatorId MessageSender `json:"creator_id"` + // True, if the gift code was created for a giveaway + IsFromGiveaway bool `json:"is_from_giveaway"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen + IsUnclaimed bool `json:"is_unclaimed"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` + // The gift code + Code string `json:"code"` +} + +func (entity *MessagePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiftCode) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiftCode) GetType() string { + return TypeMessagePremiumGiftCode +} + +func (*MessagePremiumGiftCode) MessageContentType() string { + return TypeMessagePremiumGiftCode +} + +func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) error { + var tmp struct { + CreatorId json.RawMessage `json:"creator_id"` + IsFromGiveaway bool `json:"is_from_giveaway"` + IsUnclaimed bool `json:"is_unclaimed"` + MonthCount int32 `json:"month_count"` + Sticker *Sticker `json:"sticker"` + Code string `json:"code"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + messagePremiumGiftCode.IsFromGiveaway = tmp.IsFromGiveaway + messagePremiumGiftCode.IsUnclaimed = tmp.IsUnclaimed + messagePremiumGiftCode.MonthCount = tmp.MonthCount + messagePremiumGiftCode.Sticker = tmp.Sticker + messagePremiumGiftCode.Code = tmp.Code + + fieldCreatorId, _ := UnmarshalMessageSender(tmp.CreatorId) + messagePremiumGiftCode.CreatorId = fieldCreatorId + + return nil +} + +// A Telegram Premium giveaway was created for the chat +type MessagePremiumGiveawayCreated struct{ + meta +} + +func (entity *MessagePremiumGiveawayCreated) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveawayCreated + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveawayCreated) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveawayCreated) GetType() string { + return TypeMessagePremiumGiveawayCreated +} + +func (*MessagePremiumGiveawayCreated) MessageContentType() string { + return TypeMessagePremiumGiveawayCreated +} + +// A Telegram Premium giveaway +type MessagePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // A sticker to be shown in the message; may be null if unknown + Sticker *Sticker `json:"sticker"` +} + +func (entity *MessagePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub MessagePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*MessagePremiumGiveaway) GetClass() string { + return ClassMessageContent +} + +func (*MessagePremiumGiveaway) GetType() string { + return TypeMessagePremiumGiveaway +} + +func (*MessagePremiumGiveaway) MessageContentType() string { + return TypeMessagePremiumGiveaway +} + // A contact has registered with Telegram type MessageContactRegistered struct{ meta @@ -19165,40 +20045,11 @@ func (*MessageChatShared) MessageContentType() string { return TypeMessageChatShared } -// The current user has connected a website by logging in using Telegram Login Widget on it -type MessageWebsiteConnected struct { - meta - // Domain name of the connected website - DomainName string `json:"domain_name"` -} - -func (entity *MessageWebsiteConnected) MarshalJSON() ([]byte, error) { - entity.meta.Type = entity.GetType() - - type stub MessageWebsiteConnected - - return json.Marshal((*stub)(entity)) -} - -func (*MessageWebsiteConnected) GetClass() string { - return ClassMessageContent -} - -func (*MessageWebsiteConnected) GetType() string { - return TypeMessageWebsiteConnected -} - -func (*MessageWebsiteConnected) MessageContentType() string { - return TypeMessageWebsiteConnected -} - // The user allowed the bot to send messages type MessageBotWriteAccessAllowed struct { meta - // Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu - WebApp *WebApp `json:"web_app"` - // True, if user allowed the bot to send messages by an explicit call to allowBotToSendMessages - ByRequest bool `json:"by_request"` + // The reason why the bot was allowed to write messages + Reason BotWriteAccessAllowReason `json:"reason"` } func (entity *MessageBotWriteAccessAllowed) MarshalJSON() ([]byte, error) { @@ -19221,6 +20072,22 @@ func (*MessageBotWriteAccessAllowed) MessageContentType() string { return TypeMessageBotWriteAccessAllowed } +func (messageBotWriteAccessAllowed *MessageBotWriteAccessAllowed) UnmarshalJSON(data []byte) error { + var tmp struct { + Reason json.RawMessage `json:"reason"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldReason, _ := UnmarshalBotWriteAccessAllowReason(tmp.Reason) + messageBotWriteAccessAllowed.Reason = fieldReason + + return nil +} + // Data from a Web App has been sent to a bot type MessageWebAppDataSent struct { meta @@ -19830,6 +20697,31 @@ func (*TextEntityTypePreCode) TextEntityTypeType() string { return TypeTextEntityTypePreCode } +// Text that must be formatted as if inside a blockquote HTML tag +type TextEntityTypeBlockQuote struct{ + meta +} + +func (entity *TextEntityTypeBlockQuote) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TextEntityTypeBlockQuote + + return json.Marshal((*stub)(entity)) +} + +func (*TextEntityTypeBlockQuote) GetClass() string { + return ClassTextEntityType +} + +func (*TextEntityTypeBlockQuote) GetType() string { + return TypeTextEntityTypeBlockQuote +} + +func (*TextEntityTypeBlockQuote) TextEntityTypeType() string { + return TypeTextEntityTypeBlockQuote +} + // A text description shown instead of a raw URL type TextEntityTypeTextUrl struct { meta @@ -19914,7 +20806,7 @@ func (*TextEntityTypeCustomEmoji) TextEntityTypeType() string { // A media timestamp type TextEntityTypeMediaTimestamp struct { meta - // Timestamp from which a video/audio/video note/voice note 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 web page preview of the current message, or in the same places in the replied message MediaTimestamp int32 `json:"media_timestamp"` } @@ -20105,6 +20997,8 @@ type MessageSendOptions struct { SchedulingState MessageSchedulingState `json:"scheduling_state"` // Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates SendingId int32 `json:"sending_id"` + // Pass true to get a fake message instead of actually sending them + OnlyPreview bool `json:"only_preview"` } func (entity *MessageSendOptions) MarshalJSON() ([]byte, error) { @@ -20131,6 +21025,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` SchedulingState json.RawMessage `json:"scheduling_state"` SendingId int32 `json:"sending_id"` + OnlyPreview bool `json:"only_preview"` } err := json.Unmarshal(data, &tmp) @@ -20143,6 +21038,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { messageSendOptions.ProtectContent = tmp.ProtectContent messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets messageSendOptions.SendingId = tmp.SendingId + messageSendOptions.OnlyPreview = tmp.OnlyPreview fieldSchedulingState, _ := UnmarshalMessageSchedulingState(tmp.SchedulingState) messageSendOptions.SchedulingState = fieldSchedulingState @@ -20150,7 +21046,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error { return nil } -// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +// Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied type MessageCopyOptions struct { meta // True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local @@ -20180,10 +21076,10 @@ func (*MessageCopyOptions) GetType() string { // A text message type InputMessageText struct { meta - // Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually + // Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually Text *FormattedText `json:"text"` - // True, if rich web page previews for URLs in the message text must be disabled - DisableWebPagePreview bool `json:"disable_web_page_preview"` + // Options to be used for generation of a link preview; pass null to use default link preview options + LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options"` // True, if a chat message draft must be deleted ClearDraft bool `json:"clear_draft"` } @@ -21063,7 +21959,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 + // Identifier of the message to forward. A message can be forwarded only if message.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"` @@ -22126,6 +23022,8 @@ type StickerSet struct { StickerFormat StickerFormat `json:"sticker_format"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` + // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // List of stickers in this set @@ -22162,6 +23060,7 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { IsOfficial bool `json:"is_official"` StickerFormat json.RawMessage `json:"sticker_format"` StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` IsViewed bool `json:"is_viewed"` Stickers []*Sticker `json:"stickers"` Emojis []*Emojis `json:"emojis"` @@ -22180,6 +23079,7 @@ func (stickerSet *StickerSet) UnmarshalJSON(data []byte) error { stickerSet.IsInstalled = tmp.IsInstalled stickerSet.IsArchived = tmp.IsArchived stickerSet.IsOfficial = tmp.IsOfficial + stickerSet.NeedsRepainting = tmp.NeedsRepainting stickerSet.IsViewed = tmp.IsViewed stickerSet.Stickers = tmp.Stickers stickerSet.Emojis = tmp.Emojis @@ -22216,6 +23116,8 @@ type StickerSetInfo struct { StickerFormat StickerFormat `json:"sticker_format"` // Type of the stickers in the set StickerType StickerType `json:"sticker_type"` + // True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only + NeedsRepainting bool `json:"needs_repainting"` // True for already viewed trending sticker sets IsViewed bool `json:"is_viewed"` // Total number of stickers in the set @@ -22252,6 +23154,7 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { IsOfficial bool `json:"is_official"` StickerFormat json.RawMessage `json:"sticker_format"` StickerType json.RawMessage `json:"sticker_type"` + NeedsRepainting bool `json:"needs_repainting"` IsViewed bool `json:"is_viewed"` Size int32 `json:"size"` Covers []*Sticker `json:"covers"` @@ -22270,6 +23173,7 @@ func (stickerSetInfo *StickerSetInfo) UnmarshalJSON(data []byte) error { stickerSetInfo.IsInstalled = tmp.IsInstalled stickerSetInfo.IsArchived = tmp.IsArchived stickerSetInfo.IsOfficial = tmp.IsOfficial + stickerSetInfo.NeedsRepainting = tmp.NeedsRepainting stickerSetInfo.IsViewed = tmp.IsViewed stickerSetInfo.Size = tmp.Size stickerSetInfo.Covers = tmp.Covers @@ -22552,7 +23456,7 @@ type StoryAreaPosition struct { YPercentage float64 `json:"y_percentage"` // The width of the rectangle, as a percentage of the media width WidthPercentage float64 `json:"width_percentage"` - // The ordinate of the rectangle's center, as a percentage of the media height + // The height of the rectangle, as a percentage of the media height HeightPercentage float64 `json:"height_percentage"` // Clockwise rotation angle of the rectangle, in degrees; 0-360 RotationAngle float64 `json:"rotation_angle"` @@ -22628,6 +23532,62 @@ func (*StoryAreaTypeVenue) StoryAreaTypeType() string { return TypeStoryAreaTypeVenue } +// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked +type StoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // Number of times the reaction was added + TotalCount int32 `json:"total_count"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *StoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeSuggestedReaction) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeSuggestedReaction) GetType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (*StoryAreaTypeSuggestedReaction) StoryAreaTypeType() string { + return TypeStoryAreaTypeSuggestedReaction +} + +func (storyAreaTypeSuggestedReaction *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + TotalCount int32 `json:"total_count"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + storyAreaTypeSuggestedReaction.TotalCount = tmp.TotalCount + storyAreaTypeSuggestedReaction.IsDark = tmp.IsDark + storyAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + storyAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + // Describes a clickable rectangle area on a story media type StoryArea struct { meta @@ -22757,6 +23717,58 @@ func (*InputStoryAreaTypePreviousVenue) InputStoryAreaTypeType() string { return TypeInputStoryAreaTypePreviousVenue } +// An area pointing to a suggested reaction +type InputStoryAreaTypeSuggestedReaction struct { + meta + // Type of the reaction + ReactionType ReactionType `json:"reaction_type"` + // True, if reaction has a dark background + IsDark bool `json:"is_dark"` + // True, if reaction corner is flipped + IsFlipped bool `json:"is_flipped"` +} + +func (entity *InputStoryAreaTypeSuggestedReaction) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeSuggestedReaction + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeSuggestedReaction) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeSuggestedReaction) GetType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (*InputStoryAreaTypeSuggestedReaction) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeSuggestedReaction +} + +func (inputStoryAreaTypeSuggestedReaction *InputStoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error { + var tmp struct { + ReactionType json.RawMessage `json:"reaction_type"` + IsDark bool `json:"is_dark"` + IsFlipped bool `json:"is_flipped"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + inputStoryAreaTypeSuggestedReaction.IsDark = tmp.IsDark + inputStoryAreaTypeSuggestedReaction.IsFlipped = tmp.IsFlipped + + fieldReactionType, _ := UnmarshalReactionType(tmp.ReactionType) + inputStoryAreaTypeSuggestedReaction.ReactionType = fieldReactionType + + return nil +} + // Describes a clickable rectangle area on a story media to be added type InputStoryArea struct { meta @@ -23103,7 +24115,9 @@ type StoryInteractionInfo struct { meta // Number of times the story was viewed ViewCount int32 `json:"view_count"` - // Number of reactions added to the story + // Number of times the story was forwarded; 0 if none or unknown + ForwardCount int32 `json:"forward_count"` + // Number of reactions added to the story; 0 if none or unknown ReactionCount int32 `json:"reaction_count"` // Identifiers of at most 3 recent viewers of the story RecentViewerUserIds []int64 `json:"recent_viewer_user_ids"` @@ -23144,10 +24158,16 @@ type Story struct { IsPinned bool `json:"is_pinned"` // True, if the story is visible only for the current user IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + // True, if the story can be deleted + CanBeDeleted bool `json:"can_be_deleted"` + // True, if the story can be edited + CanBeEdited bool `json:"can_be_edited"` // True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden CanBeForwarded bool `json:"can_be_forwarded"` // True, if the story can be replied in the chat with the story sender CanBeReplied bool `json:"can_be_replied"` + // True, if the story's is_pinned value can be changed + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` // True, if users viewed the story can be received through getStoryViewers CanGetViewers bool `json:"can_get_viewers"` // True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago @@ -23192,8 +24212,11 @@ func (story *Story) UnmarshalJSON(data []byte) error { IsEdited bool `json:"is_edited"` IsPinned bool `json:"is_pinned"` IsVisibleOnlyForSelf bool `json:"is_visible_only_for_self"` + CanBeDeleted bool `json:"can_be_deleted"` + CanBeEdited bool `json:"can_be_edited"` CanBeForwarded bool `json:"can_be_forwarded"` CanBeReplied bool `json:"can_be_replied"` + CanToggleIsPinned bool `json:"can_toggle_is_pinned"` CanGetViewers bool `json:"can_get_viewers"` HasExpiredViewers bool `json:"has_expired_viewers"` InteractionInfo *StoryInteractionInfo `json:"interaction_info"` @@ -23217,8 +24240,11 @@ func (story *Story) UnmarshalJSON(data []byte) error { story.IsEdited = tmp.IsEdited story.IsPinned = tmp.IsPinned story.IsVisibleOnlyForSelf = tmp.IsVisibleOnlyForSelf + story.CanBeDeleted = tmp.CanBeDeleted + story.CanBeEdited = tmp.CanBeEdited story.CanBeForwarded = tmp.CanBeForwarded story.CanBeReplied = tmp.CanBeReplied + story.CanToggleIsPinned = tmp.CanToggleIsPinned story.CanGetViewers = tmp.CanGetViewers story.HasExpiredViewers = tmp.HasExpiredViewers story.InteractionInfo = tmp.InteractionInfo @@ -23345,6 +24371,302 @@ func (chatActiveStories *ChatActiveStories) UnmarshalJSON(data []byte) error { return nil } +// The chat created a Telegram Premium gift code for a user +type ChatBoostSourceGiftCode struct { + meta + // Identifier of a user, for which the gift code was created + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed + GiftCode string `json:"gift_code"` +} + +func (entity *ChatBoostSourceGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiftCode) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiftCode) GetType() string { + return TypeChatBoostSourceGiftCode +} + +func (*ChatBoostSourceGiftCode) ChatBoostSourceType() string { + return TypeChatBoostSourceGiftCode +} + +// The chat created a Telegram Premium giveaway +type ChatBoostSourceGiveaway struct { + meta + // Identifier of a user that won in the giveaway; 0 if none + UserId int64 `json:"user_id"` + // The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise + GiftCode string `json:"gift_code"` + // Identifier of the corresponding giveaway message; can be an identifier of a deleted message + GiveawayMessageId int64 `json:"giveaway_message_id"` + // True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants + IsUnclaimed bool `json:"is_unclaimed"` +} + +func (entity *ChatBoostSourceGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourceGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourceGiveaway) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourceGiveaway) GetType() string { + return TypeChatBoostSourceGiveaway +} + +func (*ChatBoostSourceGiveaway) ChatBoostSourceType() string { + return TypeChatBoostSourceGiveaway +} + +// A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +type ChatBoostSourcePremium struct { + meta + // Identifier of the user + UserId int64 `json:"user_id"` +} + +func (entity *ChatBoostSourcePremium) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSourcePremium + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSourcePremium) GetClass() string { + return ClassChatBoostSource +} + +func (*ChatBoostSourcePremium) GetType() string { + return TypeChatBoostSourcePremium +} + +func (*ChatBoostSourcePremium) ChatBoostSourceType() string { + return TypeChatBoostSourcePremium +} + +// Describes a prepaid Telegram Premium giveaway +type PrepaidPremiumGiveaway struct { + meta + // Unique identifier of the prepaid giveaway + Id JsonInt64 `json:"id"` + // Number of users which will receive Telegram Premium subscription gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` + // Point in time (Unix timestamp) when the giveaway was paid + PaymentDate int32 `json:"payment_date"` +} + +func (entity *PrepaidPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PrepaidPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PrepaidPremiumGiveaway) GetClass() string { + return ClassPrepaidPremiumGiveaway +} + +func (*PrepaidPremiumGiveaway) GetType() string { + return TypePrepaidPremiumGiveaway +} + +// Describes current boost status of a chat +type ChatBoostStatus struct { + meta + // An HTTP URL, which can be used to boost the chat + BoostUrl string `json:"boost_url"` + // Identifiers of boost slots of the current user applied to the chat + AppliedSlotIds []int32 `json:"applied_slot_ids"` + // Current boost level of the chat + Level int32 `json:"level"` + // The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat + GiftCodeBoostCount int32 `json:"gift_code_boost_count"` + // The number of boosts received by the chat + BoostCount int32 `json:"boost_count"` + // The number of boosts added to reach the current level + CurrentLevelBoostCount int32 `json:"current_level_boost_count"` + // The number of boosts needed to reach the next level; 0 if the next level isn't available + NextLevelBoostCount int32 `json:"next_level_boost_count"` + // Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberCount int32 `json:"premium_member_count"` + // A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat + PremiumMemberPercentage float64 `json:"premium_member_percentage"` + // The list of prepaid giveaways available for the chat; only for chat administrators + PrepaidGiveaways []*PrepaidPremiumGiveaway `json:"prepaid_giveaways"` +} + +func (entity *ChatBoostStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostStatus + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostStatus) GetClass() string { + return ClassChatBoostStatus +} + +func (*ChatBoostStatus) GetType() string { + return TypeChatBoostStatus +} + +// Describes a boost applied to a chat +type ChatBoost struct { + meta + // Unique identifier of the boost + Id string `json:"id"` + // The number of identical boosts applied + Count int32 `json:"count"` + // Source of the boost + Source ChatBoostSource `json:"source"` + // Point in time (Unix timestamp) when the chat was boosted + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` +} + +func (entity *ChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoost) GetClass() string { + return ClassChatBoost +} + +func (*ChatBoost) GetType() string { + return TypeChatBoost +} + +func (chatBoost *ChatBoost) UnmarshalJSON(data []byte) error { + var tmp struct { + Id string `json:"id"` + Count int32 `json:"count"` + Source json.RawMessage `json:"source"` + StartDate int32 `json:"start_date"` + ExpirationDate int32 `json:"expiration_date"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + chatBoost.Id = tmp.Id + chatBoost.Count = tmp.Count + chatBoost.StartDate = tmp.StartDate + chatBoost.ExpirationDate = tmp.ExpirationDate + + fieldSource, _ := UnmarshalChatBoostSource(tmp.Source) + chatBoost.Source = fieldSource + + return nil +} + +// Contains a list of boosts applied to a chat +type FoundChatBoosts struct { + meta + // Total number of boosts applied to the chat + TotalCount int32 `json:"total_count"` + // List of boosts + Boosts []*ChatBoost `json:"boosts"` + // The offset for the next request. If empty, there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundChatBoosts) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundChatBoosts + + return json.Marshal((*stub)(entity)) +} + +func (*FoundChatBoosts) GetClass() string { + return ClassFoundChatBoosts +} + +func (*FoundChatBoosts) GetType() string { + return TypeFoundChatBoosts +} + +// Describes a slot for chat boost +type ChatBoostSlot struct { + meta + // Unique identifier of the slot + SlotId int32 `json:"slot_id"` + // Identifier of the currently boosted chat; 0 if none + CurrentlyBoostedChatId int64 `json:"currently_boosted_chat_id"` + // Point in time (Unix timestamp) when the chat was boosted; 0 if none + StartDate int32 `json:"start_date"` + // Point in time (Unix timestamp) when the boost will expire + ExpirationDate int32 `json:"expiration_date"` + // Point in time (Unix timestamp) after which the boost can be used for another chat + CooldownUntilDate int32 `json:"cooldown_until_date"` +} + +func (entity *ChatBoostSlot) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlot + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlot) GetClass() string { + return ClassChatBoostSlot +} + +func (*ChatBoostSlot) GetType() string { + return TypeChatBoostSlot +} + +// Contains a list of chat boost slots +type ChatBoostSlots struct { + meta + // List of boost slots + Slots []*ChatBoostSlot `json:"slots"` +} + +func (entity *ChatBoostSlots) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostSlots + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostSlots) GetClass() string { + return ClassChatBoostSlots +} + +func (*ChatBoostSlots) GetType() string { + return TypeChatBoostSlots +} + // The call wasn't discarded, or the reason is unknown type CallDiscardReasonEmpty struct{ meta @@ -23784,7 +25106,7 @@ func (*CallStateHangingUp) CallStateType() string { // The call has ended successfully type CallStateDiscarded struct { meta - // The reason, why the call has ended + // The reason why the call has ended Reason CallDiscardReason `json:"reason"` // True, if the call rating must be sent to the server NeedRating bool `json:"need_rating"` @@ -24683,6 +26005,8 @@ type AddedReaction struct { Type ReactionType `json:"type"` // Identifier of the chat member, applied the reaction SenderId MessageSender `json:"sender_id"` + // True, if the reaction was added by the current user + IsOutgoing bool `json:"is_outgoing"` // Point in time (Unix timestamp) when the reaction was added Date int32 `json:"date"` } @@ -24707,6 +26031,7 @@ func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { var tmp struct { Type json.RawMessage `json:"type"` SenderId json.RawMessage `json:"sender_id"` + IsOutgoing bool `json:"is_outgoing"` Date int32 `json:"date"` } @@ -24715,6 +26040,7 @@ func (addedReaction *AddedReaction) UnmarshalJSON(data []byte) error { return err } + addedReaction.IsOutgoing = tmp.IsOutgoing addedReaction.Date = tmp.Date fieldType, _ := UnmarshalReactionType(tmp.Type) @@ -25098,8 +26424,6 @@ type AttachmentMenuBot struct { SupportsGroupChats bool `json:"supports_group_chats"` // True, if the bot supports opening from attachment menu in channel chats SupportsChannelChats bool `json:"supports_channel_chats"` - // True, if the bot supports "settings_button_pressed" event - SupportsSettings bool `json:"supports_settings"` // True, if the user must be asked for the permission to send messages to the bot RequestWriteAccess bool `json:"request_write_access"` // True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed @@ -25175,6 +26499,110 @@ func (*SentWebAppMessage) GetType() string { return TypeSentWebAppMessage } +// The user connected a website by logging in using Telegram Login Widget on it +type BotWriteAccessAllowReasonConnectedWebsite struct { + meta + // Domain name of the connected website + DomainName string `json:"domain_name"` +} + +func (entity *BotWriteAccessAllowReasonConnectedWebsite) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonConnectedWebsite + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) GetType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +func (*BotWriteAccessAllowReasonConnectedWebsite) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonConnectedWebsite +} + +// The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +type BotWriteAccessAllowReasonAddedToAttachmentMenu struct{ + meta +} + +func (entity *BotWriteAccessAllowReasonAddedToAttachmentMenu) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAddedToAttachmentMenu + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) GetType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +func (*BotWriteAccessAllowReasonAddedToAttachmentMenu) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAddedToAttachmentMenu +} + +// The user launched a Web App using getWebAppLinkUrl +type BotWriteAccessAllowReasonLaunchedWebApp struct { + meta + // Information about the Web App + WebApp *WebApp `json:"web_app"` +} + +func (entity *BotWriteAccessAllowReasonLaunchedWebApp) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonLaunchedWebApp + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) GetType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +func (*BotWriteAccessAllowReasonLaunchedWebApp) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonLaunchedWebApp +} + +// The user accepted bot's request to send messages with allowBotToSendMessages +type BotWriteAccessAllowReasonAcceptedRequest struct{ + meta +} + +func (entity *BotWriteAccessAllowReasonAcceptedRequest) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub BotWriteAccessAllowReasonAcceptedRequest + + return json.Marshal((*stub)(entity)) +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetClass() string { + return ClassBotWriteAccessAllowReason +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) GetType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + +func (*BotWriteAccessAllowReasonAcceptedRequest) BotWriteAccessAllowReasonType() string { + return TypeBotWriteAccessAllowReasonAcceptedRequest +} + // Contains an HTTP URL type HttpUrl struct { meta @@ -27598,6 +29026,64 @@ func (*ChatEventActiveUsernamesChanged) ChatEventActionType() string { return TypeChatEventActiveUsernamesChanged } +// The chat accent color was changed +type ChatEventAccentColorChanged struct { + meta + // Previous identifier of chat accent color + OldAccentColorId int32 `json:"old_accent_color_id"` + // New identifier of chat accent color + NewAccentColorId int32 `json:"new_accent_color_id"` +} + +func (entity *ChatEventAccentColorChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventAccentColorChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventAccentColorChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventAccentColorChanged) GetType() string { + return TypeChatEventAccentColorChanged +} + +func (*ChatEventAccentColorChanged) ChatEventActionType() string { + return TypeChatEventAccentColorChanged +} + +// The chat's custom emoji for reply background was changed +type ChatEventBackgroundCustomEmojiChanged struct { + meta + // Previous identifier of the custom emoji; 0 if none + OldBackgroundCustomEmojiId JsonInt64 `json:"old_background_custom_emoji_id"` + // New identifier of the custom emoji; 0 if none + NewBackgroundCustomEmojiId JsonInt64 `json:"new_background_custom_emoji_id"` +} + +func (entity *ChatEventBackgroundCustomEmojiChanged) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatEventBackgroundCustomEmojiChanged + + return json.Marshal((*stub)(entity)) +} + +func (*ChatEventBackgroundCustomEmojiChanged) GetClass() string { + return ClassChatEventAction +} + +func (*ChatEventBackgroundCustomEmojiChanged) GetType() string { + return TypeChatEventBackgroundCustomEmojiChanged +} + +func (*ChatEventBackgroundCustomEmojiChanged) ChatEventActionType() string { + return TypeChatEventBackgroundCustomEmojiChanged +} + // The has_protected_content setting of a channel was toggled type ChatEventHasProtectedContentToggled struct { meta @@ -28936,6 +30422,31 @@ func (*PremiumLimitTypeStoryCaptionLength) PremiumLimitTypeType() string { return TypePremiumLimitTypeStoryCaptionLength } +// The maximum number of suggested reaction areas on a story +type PremiumLimitTypeStorySuggestedReactionAreaCount struct{ + meta +} + +func (entity *PremiumLimitTypeStorySuggestedReactionAreaCount) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumLimitTypeStorySuggestedReactionAreaCount + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetClass() string { + return ClassPremiumLimitType +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) GetType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + +func (*PremiumLimitTypeStorySuggestedReactionAreaCount) PremiumLimitTypeType() string { + return TypePremiumLimitTypeStorySuggestedReactionAreaCount +} + // Increased limits type PremiumFeatureIncreasedLimits struct{ meta @@ -29336,7 +30847,57 @@ func (*PremiumFeatureUpgradedStories) PremiumFeatureType() string { return TypePremiumFeatureUpgradedStories } -// User stories are displayed before stories of non-premium contacts +// The ability to boost chats +type PremiumFeatureChatBoost struct{ + meta +} + +func (entity *PremiumFeatureChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureChatBoost) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureChatBoost) GetType() string { + return TypePremiumFeatureChatBoost +} + +func (*PremiumFeatureChatBoost) PremiumFeatureType() string { + return TypePremiumFeatureChatBoost +} + +// The ability to choose accent color +type PremiumFeatureAccentColor struct{ + meta +} + +func (entity *PremiumFeatureAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PremiumFeatureAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*PremiumFeatureAccentColor) GetClass() string { + return ClassPremiumFeature +} + +func (*PremiumFeatureAccentColor) GetType() string { + return TypePremiumFeatureAccentColor +} + +func (*PremiumFeatureAccentColor) PremiumFeatureType() string { + return TypePremiumFeatureAccentColor +} + +// User stories are displayed before stories of non-premium contacts and channels type PremiumStoryFeaturePriorityOrder struct{ meta } @@ -29836,7 +31397,7 @@ func (*PremiumState) GetType() string { return TypePremiumState } -// The user subscribed to Telegram Premium +// The user subscribing to Telegram Premium type StorePaymentPurposePremiumSubscription struct { meta // Pass true if this is a restore of a Telegram Premium purchase; only for App Store @@ -29865,10 +31426,10 @@ func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string return TypeStorePaymentPurposePremiumSubscription } -// The user gifted Telegram Premium to another user +// The user gifting Telegram Premium to another user type StorePaymentPurposeGiftedPremium struct { meta - // Identifier of the user for which Premium was gifted + // Identifier of the user to which Premium was gifted UserId int64 `json:"user_id"` // ISO 4217 currency code of the payment currency Currency string `json:"currency"` @@ -29896,6 +31457,140 @@ func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string { return TypeStorePaymentPurposeGiftedPremium } +// The user creating Telegram Premium gift codes for other users +type StorePaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_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"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` +} + +func (entity *StorePaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiftCodes) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiftCodes) GetType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +func (*StorePaymentPurposePremiumGiftCodes) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +type StorePaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // 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"` +} + +func (entity *StorePaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StorePaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*StorePaymentPurposePremiumGiveaway) GetClass() string { + return ClassStorePaymentPurpose +} + +func (*StorePaymentPurposePremiumGiveaway) GetType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +func (*StorePaymentPurposePremiumGiveaway) StorePaymentPurposeType() string { + return TypeStorePaymentPurposePremiumGiveaway +} + +// The user creating Telegram Premium gift codes for other users +type TelegramPaymentPurposePremiumGiftCodes struct { + meta + // Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none + BoostedChatId int64 `json:"boosted_chat_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"` + // Identifiers of the users which can activate the gift codes + UserIds []int64 `json:"user_ids"` + // Number of month the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiftCodes + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiftCodes) GetType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +func (*TelegramPaymentPurposePremiumGiftCodes) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiftCodes +} + +// The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +type TelegramPaymentPurposePremiumGiveaway struct { + meta + // Giveaway parameters + Parameters *PremiumGiveawayParameters `json:"parameters"` + // 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 users which will be able to activate the gift codes + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active for the users + MonthCount int32 `json:"month_count"` +} + +func (entity *TelegramPaymentPurposePremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub TelegramPaymentPurposePremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetClass() string { + return ClassTelegramPaymentPurpose +} + +func (*TelegramPaymentPurposePremiumGiveaway) GetType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + +func (*TelegramPaymentPurposePremiumGiveaway) TelegramPaymentPurposeType() string { + return TypeTelegramPaymentPurposePremiumGiveaway +} + // A token for Firebase Cloud Messaging type DeviceTokenFirebaseCloudMessaging struct { meta @@ -30723,6 +32418,31 @@ func (*CanSendStoryResultPremiumNeeded) CanSendStoryResultType() string { return TypeCanSendStoryResultPremiumNeeded } +// The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +type CanSendStoryResultBoostNeeded struct{ + meta +} + +func (entity *CanSendStoryResultBoostNeeded) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub CanSendStoryResultBoostNeeded + + return json.Marshal((*stub)(entity)) +} + +func (*CanSendStoryResultBoostNeeded) GetClass() string { + return ClassCanSendStoryResult +} + +func (*CanSendStoryResultBoostNeeded) GetType() string { + return TypeCanSendStoryResultBoostNeeded +} + +func (*CanSendStoryResultBoostNeeded) CanSendStoryResultType() string { + return TypeCanSendStoryResultBoostNeeded +} + // The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire type CanSendStoryResultActiveStoryLimitExceeded struct{ meta @@ -31641,6 +33361,64 @@ func (*PushMessageContentPoll) PushMessageContentType() string { return TypePushMessageContentPoll } +// A message with a Telegram Premium gift code created for the user +type PushMessageContentPremiumGiftCode struct { + meta + // Number of month the Telegram Premium subscription will be active after code activation + MonthCount int32 `json:"month_count"` +} + +func (entity *PushMessageContentPremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiftCode) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiftCode) GetType() string { + return TypePushMessageContentPremiumGiftCode +} + +func (*PushMessageContentPremiumGiftCode) PushMessageContentType() string { + return TypePushMessageContentPremiumGiftCode +} + +// A message with a Telegram Premium giveaway +type PushMessageContentPremiumGiveaway struct { + meta + // Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message + WinnerCount int32 `json:"winner_count"` + // Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message + MonthCount int32 `json:"month_count"` + // True, if the message is a pinned message with the specified content + IsPinned bool `json:"is_pinned"` +} + +func (entity *PushMessageContentPremiumGiveaway) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub PushMessageContentPremiumGiveaway + + return json.Marshal((*stub)(entity)) +} + +func (*PushMessageContentPremiumGiveaway) GetClass() string { + return ClassPushMessageContent +} + +func (*PushMessageContentPremiumGiveaway) GetType() string { + return TypePushMessageContentPremiumGiveaway +} + +func (*PushMessageContentPremiumGiveaway) PushMessageContentType() string { + return TypePushMessageContentPremiumGiveaway +} + // A screenshot of a message in the chat has been taken type PushMessageContentScreenshotTaken struct{ meta @@ -32285,7 +34063,7 @@ func (*NotificationTypeNewCall) NotificationTypeType() string { // New message was received through a push notification type NotificationTypeNewPushMessage struct { meta - // The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to reply + // The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat MessageId int64 `json:"message_id"` // Identifier of the sender of the message. Corresponding user or chat may be inaccessible SenderId MessageSender `json:"sender_id"` @@ -34830,6 +36608,33 @@ func (*InternalLinkTypeChangePhoneNumber) InternalLinkTypeType() string { return TypeInternalLinkTypeChangePhoneNumber } +// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat +type InternalLinkTypeChatBoost struct { + meta + // URL to be passed to getChatBoostLinkInfo + Url string `json:"url"` +} + +func (entity *InternalLinkTypeChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypeChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypeChatBoost) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypeChatBoost) GetType() string { + return TypeInternalLinkTypeChatBoost +} + +func (*InternalLinkTypeChatBoost) InternalLinkTypeType() string { + return TypeInternalLinkTypeChatBoost +} + // The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link type InternalLinkTypeChatFolderInvite struct { meta @@ -35243,6 +37048,33 @@ func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string { return TypeInternalLinkTypePremiumFeatures } +// The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +type InternalLinkTypePremiumGiftCode struct { + meta + // The Telegram Premium gift code + Code string `json:"code"` +} + +func (entity *InternalLinkTypePremiumGiftCode) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InternalLinkTypePremiumGiftCode + + return json.Marshal((*stub)(entity)) +} + +func (*InternalLinkTypePremiumGiftCode) GetClass() string { + return ClassInternalLinkType +} + +func (*InternalLinkTypePremiumGiftCode) GetType() string { + return TypeInternalLinkTypePremiumGiftCode +} + +func (*InternalLinkTypePremiumGiftCode) InternalLinkTypeType() string { + return TypeInternalLinkTypePremiumGiftCode +} + // The link is a link to the privacy and security section of the app settings type InternalLinkTypePrivacyAndSecuritySettings struct{ meta @@ -35698,7 +37530,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 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 type InternalLinkTypeWebApp struct { meta // Username of the bot that owns the Web App @@ -35765,7 +37597,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 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 web page preview MediaTimestamp int32 `json:"media_timestamp"` // True, if the whole media album to which the message belongs is linked ForAlbum bool `json:"for_album"` @@ -35787,6 +37619,56 @@ func (*MessageLinkInfo) GetType() string { return TypeMessageLinkInfo } +// Contains an HTTPS link to boost a chat +type ChatBoostLink struct { + meta + // The link + Link string `json:"link"` + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` +} + +func (entity *ChatBoostLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLink + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLink) GetClass() string { + return ClassChatBoostLink +} + +func (*ChatBoostLink) GetType() string { + return TypeChatBoostLink +} + +// Contains information about a link to boost a chat +type ChatBoostLinkInfo struct { + meta + // True, if the link will work for non-members of the chat + IsPublic bool `json:"is_public"` + // Identifier of the chat to which the link points; 0 if the chat isn't found + ChatId int64 `json:"chat_id"` +} + +func (entity *ChatBoostLinkInfo) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub ChatBoostLinkInfo + + return json.Marshal((*stub)(entity)) +} + +func (*ChatBoostLinkInfo) GetClass() string { + return ClassChatBoostLinkInfo +} + +func (*ChatBoostLinkInfo) GetType() string { + return TypeChatBoostLinkInfo +} + // The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions type BlockListMain struct{ meta @@ -37325,6 +39207,29 @@ func (*TopChatCategoryForwardChats) TopChatCategoryType() string { return TypeTopChatCategoryForwardChats } +// Contains 0-based match position +type FoundPosition struct { + meta + // The position of the match + Position int32 `json:"position"` +} + +func (entity *FoundPosition) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundPosition + + return json.Marshal((*stub)(entity)) +} + +func (*FoundPosition) GetClass() string { + return ClassFoundPosition +} + +func (*FoundPosition) GetType() string { + return TypeFoundPosition +} + // Contains 0-based positions of matched objects type FoundPositions struct { meta @@ -38517,7 +40422,7 @@ type ChatStatisticsChannel struct { MeanViewCount *StatisticalValue `json:"mean_view_count"` // Mean number of times the recently sent messages was shared MeanShareCount *StatisticalValue `json:"mean_share_count"` - // A percentage of users with enabled notifications for the chat + // A percentage of users with enabled notifications for the chat; 0-100 EnabledNotificationsPercentage float64 `json:"enabled_notifications_percentage"` // A graph containing number of members in the chat MemberCountGraph StatisticalGraph `json:"member_count_graph"` @@ -39062,10 +40967,8 @@ type UpdateMessageSendFailed struct { Message *Message `json:"message"` // The previous temporary message identifier OldMessageId int64 `json:"old_message_id"` - // An error code - ErrorCode int32 `json:"error_code"` - // Error message - ErrorMessage string `json:"error_message"` + // The cause of the message sending failure + Error *Error `json:"error"` } func (entity *UpdateMessageSendFailed) MarshalJSON() ([]byte, error) { @@ -39465,6 +41368,64 @@ func (*UpdateChatPhoto) UpdateType() string { return TypeUpdateChatPhoto } +// A chat accent color has changed +type UpdateChatAccentColor struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new chat accent color identifier + AccentColorId int32 `json:"accent_color_id"` +} + +func (entity *UpdateChatAccentColor) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatAccentColor + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatAccentColor) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatAccentColor) GetType() string { + return TypeUpdateChatAccentColor +} + +func (*UpdateChatAccentColor) UpdateType() string { + return TypeUpdateChatAccentColor +} + +// A chat's custom emoji for reply background has changed +type UpdateChatBackgroundCustomEmoji struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // The new tdentifier of a custom emoji to be shown on the reply header background + BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"` +} + +func (entity *UpdateChatBackgroundCustomEmoji) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBackgroundCustomEmoji + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBackgroundCustomEmoji) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBackgroundCustomEmoji) GetType() string { + return TypeUpdateChatBackgroundCustomEmoji +} + +func (*UpdateChatBackgroundCustomEmoji) UpdateType() string { + return TypeUpdateChatBackgroundCustomEmoji +} + // Chat permissions was changed type UpdateChatPermissions struct { meta @@ -39494,12 +41455,12 @@ func (*UpdateChatPermissions) UpdateType() string { return TypeUpdateChatPermissions } -// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +// The last message of a chat was changed type UpdateChatLastMessage struct { meta // Chat identifier ChatId int64 `json:"chat_id"` - // The new last message in the chat; may be null + // The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update LastMessage *Message `json:"last_message"` // The new chat positions in the chat lists Positions []*ChatPosition `json:"positions"` @@ -41492,12 +43453,10 @@ type UpdateStorySendFailed struct { meta // The failed to send story Story *Story `json:"story"` - // The cause of the failure; may be null if unknown - Error CanSendStoryResult `json:"error"` - // An error code - ErrorCode int32 `json:"error_code"` - // Error message - ErrorMessage string `json:"error_message"` + // The cause of the story sending failure + Error *Error `json:"error"` + // Type of the error; may be null if unknown + ErrorType CanSendStoryResult `json:"error_type"` } func (entity *UpdateStorySendFailed) MarshalJSON() ([]byte, error) { @@ -41523,9 +43482,8 @@ func (*UpdateStorySendFailed) UpdateType() string { func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) error { var tmp struct { Story *Story `json:"story"` - Error json.RawMessage `json:"error"` - ErrorCode int32 `json:"error_code"` - ErrorMessage string `json:"error_message"` + Error *Error `json:"error"` + ErrorType json.RawMessage `json:"error_type"` } err := json.Unmarshal(data, &tmp) @@ -41534,11 +43492,10 @@ func (updateStorySendFailed *UpdateStorySendFailed) UnmarshalJSON(data []byte) e } updateStorySendFailed.Story = tmp.Story - updateStorySendFailed.ErrorCode = tmp.ErrorCode - updateStorySendFailed.ErrorMessage = tmp.ErrorMessage + updateStorySendFailed.Error = tmp.Error - fieldError, _ := UnmarshalCanSendStoryResult(tmp.Error) - updateStorySendFailed.Error = fieldError + fieldErrorType, _ := UnmarshalCanSendStoryResult(tmp.ErrorType) + updateStorySendFailed.ErrorType = fieldErrorType return nil } @@ -41984,6 +43941,35 @@ func (*UpdateChatThemes) UpdateType() string { return TypeUpdateChatThemes } +// The list of supported accent colors has changed +type UpdateAccentColors struct { + meta + // Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme + Colors []*AccentColor `json:"colors"` + // The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order + AvailableAccentColorIds []int32 `json:"available_accent_color_ids"` +} + +func (entity *UpdateAccentColors) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateAccentColors + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateAccentColors) GetClass() string { + return ClassUpdate +} + +func (*UpdateAccentColors) GetType() string { + return TypeUpdateAccentColors +} + +func (*UpdateAccentColors) UpdateType() string { + return TypeUpdateAccentColors +} + // Some language pack strings have been updated type UpdateLanguagePackStrings struct { meta @@ -42982,6 +44968,35 @@ func (*UpdateNewChatJoinRequest) UpdateType() string { return TypeUpdateNewChatJoinRequest } +// A chat boost has changed; for bots only +type UpdateChatBoost struct { + meta + // Chat identifier + ChatId int64 `json:"chat_id"` + // New information about the boost + Boost *ChatBoost `json:"boost"` +} + +func (entity *UpdateChatBoost) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateChatBoost + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateChatBoost) GetClass() string { + return ClassUpdate +} + +func (*UpdateChatBoost) GetType() string { + return TypeUpdateChatBoost +} + +func (*UpdateChatBoost) UpdateType() string { + return TypeUpdateChatBoost +} + // Contains a list of updates type Updates struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index 21a0f6c..3af611e 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -582,6 +582,83 @@ func UnmarshalListOfInputChatPhoto(dataList []json.RawMessage) ([]InputChatPhoto return list, nil } +func UnmarshalPremiumGiveawayParticipantStatus(data json.RawMessage) (PremiumGiveawayParticipantStatus, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) + + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) + + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) + + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) + + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayParticipantStatus(dataList []json.RawMessage) ([]PremiumGiveawayParticipantStatus, error) { + list := []PremiumGiveawayParticipantStatus{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayParticipantStatus(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + +func UnmarshalPremiumGiveawayInfo(data json.RawMessage) (PremiumGiveawayInfo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfPremiumGiveawayInfo(dataList []json.RawMessage) ([]PremiumGiveawayInfo, error) { + list := []PremiumGiveawayInfo{} + + for _, data := range dataList { + entity, err := UnmarshalPremiumGiveawayInfo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) { var meta meta @@ -837,7 +914,7 @@ func UnmarshalListOfMessageSender(dataList []json.RawMessage) ([]MessageSender, return list, nil } -func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, error) { +func UnmarshalMessageOrigin(data json.RawMessage) (MessageOrigin, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -846,31 +923,28 @@ func UnmarshalMessageForwardOrigin(data json.RawMessage) (MessageForwardOrigin, } switch meta.Type { - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) - - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfMessageForwardOrigin(dataList []json.RawMessage) ([]MessageForwardOrigin, error) { - list := []MessageForwardOrigin{} +func UnmarshalListOfMessageOrigin(dataList []json.RawMessage) ([]MessageOrigin, error) { + list := []MessageOrigin{} for _, data := range dataList { - entity, err := UnmarshalMessageForwardOrigin(data) + entity, err := UnmarshalMessageOrigin(data) if err != nil { return nil, err } @@ -982,6 +1056,40 @@ func UnmarshalListOfMessageReplyTo(dataList []json.RawMessage) ([]MessageReplyTo return list, nil } +func UnmarshalInputMessageReplyTo(data json.RawMessage) (InputMessageReplyTo, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) + + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfInputMessageReplyTo(dataList []json.RawMessage) ([]InputMessageReplyTo, error) { + list := []InputMessageReplyTo{} + + for _, data := range dataList { + entity, err := UnmarshalInputMessageReplyTo(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalMessageSource(data json.RawMessage) (MessageSource, error) { var meta meta @@ -1883,6 +1991,9 @@ func UnmarshalInputInvoice(data json.RawMessage) (InputInvoice, error) { case TypeInputInvoiceName: return UnmarshalInputInvoiceName(data) + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2415,6 +2526,15 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageGiftedPremium: return UnmarshalMessageGiftedPremium(data) + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) + + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) + + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -2424,9 +2544,6 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) { case TypeMessageChatShared: return UnmarshalMessageChatShared(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) - case TypeMessageBotWriteAccessAllowed: return UnmarshalMessageBotWriteAccessAllowed(data) @@ -2524,6 +2641,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) { case TypeTextEntityTypePreCode: return UnmarshalTextEntityTypePreCode(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) + case TypeTextEntityTypeTextUrl: return UnmarshalTextEntityTypeTextUrl(data) @@ -2955,6 +3075,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { case TypeStoryAreaTypeVenue: return UnmarshalStoryAreaTypeVenue(data) + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -2992,6 +3115,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro case TypeInputStoryAreaTypePreviousVenue: return UnmarshalInputStoryAreaTypePreviousVenue(data) + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3116,6 +3242,43 @@ func UnmarshalListOfStoryList(dataList []json.RawMessage) ([]StoryList, error) { return list, nil } +func UnmarshalChatBoostSource(data json.RawMessage) (ChatBoostSource, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) + + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) + + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfChatBoostSource(dataList []json.RawMessage) ([]ChatBoostSource, error) { + list := []ChatBoostSource{} + + for _, data := range dataList { + entity, err := UnmarshalChatBoostSource(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error) { var meta meta @@ -3436,6 +3599,46 @@ func UnmarshalListOfSpeechRecognitionResult(dataList []json.RawMessage) ([]Speec return list, nil } +func UnmarshalBotWriteAccessAllowReason(data json.RawMessage) (BotWriteAccessAllowReason, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) + + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) + + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) + + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfBotWriteAccessAllowReason(dataList []json.RawMessage) ([]BotWriteAccessAllowReason, error) { + list := []BotWriteAccessAllowReason{} + + for _, data := range dataList { + entity, err := UnmarshalBotWriteAccessAllowReason(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) { var meta meta @@ -3716,6 +3919,12 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) { case TypeChatEventActiveUsernamesChanged: return UnmarshalChatEventActiveUsernamesChanged(data) + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) + + case TypeChatEventBackgroundCustomEmojiChanged: + return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + case TypeChatEventHasProtectedContentToggled: return UnmarshalChatEventHasProtectedContentToggled(data) @@ -3889,6 +4098,9 @@ func UnmarshalPremiumLimitType(data json.RawMessage) (PremiumLimitType, error) { case TypePremiumLimitTypeStoryCaptionLength: return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3965,6 +4177,12 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) { case TypePremiumFeatureUpgradedStories: return UnmarshalPremiumFeatureUpgradedStories(data) + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) + + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4088,6 +4306,12 @@ func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, er case TypeStorePaymentPurposeGiftedPremium: return UnmarshalStorePaymentPurposeGiftedPremium(data) + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) + + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -4107,6 +4331,40 @@ func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaym return list, nil } +func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpose, error) { + var meta meta + + err := json.Unmarshal(data, &meta) + if err != nil { + return nil, err + } + + switch meta.Type { + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) + + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) + + default: + return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) + } +} + +func UnmarshalListOfTelegramPaymentPurpose(dataList []json.RawMessage) ([]TelegramPaymentPurpose, error) { + list := []TelegramPaymentPurpose{} + + for _, data := range dataList { + entity, err := UnmarshalTelegramPaymentPurpose(data) + if err != nil { + return nil, err + } + list = append(list, entity) + } + + return list, nil +} + func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { var meta meta @@ -4297,6 +4555,9 @@ func UnmarshalCanSendStoryResult(data json.RawMessage) (CanSendStoryResult, erro case TypeCanSendStoryResultPremiumNeeded: return UnmarshalCanSendStoryResultPremiumNeeded(data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) @@ -4567,6 +4828,12 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro case TypePushMessageContentPoll: return UnmarshalPushMessageContentPoll(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) + + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) + case TypePushMessageContentScreenshotTaken: return UnmarshalPushMessageContentScreenshotTaken(data) @@ -5169,6 +5436,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) + case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) @@ -5214,6 +5484,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) { case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) @@ -5989,6 +6262,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -6211,6 +6490,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -6292,6 +6574,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -7252,6 +7537,94 @@ func UnmarshalPremiumStatePaymentOption(data json.RawMessage) (*PremiumStatePaym return &resp, err } +func UnmarshalPremiumGiftCodePaymentOption(data json.RawMessage) (*PremiumGiftCodePaymentOption, error) { + var resp PremiumGiftCodePaymentOption + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodePaymentOptions(data json.RawMessage) (*PremiumGiftCodePaymentOptions, error) { + var resp PremiumGiftCodePaymentOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiftCodeInfo(data json.RawMessage) (*PremiumGiftCodeInfo, error) { + var resp PremiumGiftCodeInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusEligible(data json.RawMessage) (*PremiumGiveawayParticipantStatusEligible, error) { + var resp PremiumGiveawayParticipantStatusEligible + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusParticipating(data json.RawMessage) (*PremiumGiveawayParticipantStatusParticipating, error) { + var resp PremiumGiveawayParticipantStatusParticipating + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data json.RawMessage) (*PremiumGiveawayParticipantStatusAlreadyWasMember, error) { + var resp PremiumGiveawayParticipantStatusAlreadyWasMember + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusAdministrator(data json.RawMessage) (*PremiumGiveawayParticipantStatusAdministrator, error) { + var resp PremiumGiveawayParticipantStatusAdministrator + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data json.RawMessage) (*PremiumGiveawayParticipantStatusDisallowedCountry, error) { + var resp PremiumGiveawayParticipantStatusDisallowedCountry + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoOngoing(data json.RawMessage) (*PremiumGiveawayInfoOngoing, error) { + var resp PremiumGiveawayInfoOngoing + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumGiveawayInfoCompleted(data json.RawMessage) (*PremiumGiveawayInfoCompleted, error) { + var resp PremiumGiveawayInfoCompleted + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalAccentColor(data json.RawMessage) (*AccentColor, error) { + var resp AccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { var resp EmojiStatus @@ -7732,40 +8105,32 @@ func UnmarshalMessageViewers(data json.RawMessage) (*MessageViewers, error) { return &resp, err } -func UnmarshalMessageForwardOriginUser(data json.RawMessage) (*MessageForwardOriginUser, error) { - var resp MessageForwardOriginUser +func UnmarshalMessageOriginUser(data json.RawMessage) (*MessageOriginUser, error) { + var resp MessageOriginUser err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginChat(data json.RawMessage) (*MessageForwardOriginChat, error) { - var resp MessageForwardOriginChat +func UnmarshalMessageOriginHiddenUser(data json.RawMessage) (*MessageOriginHiddenUser, error) { + var resp MessageOriginHiddenUser err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginHiddenUser(data json.RawMessage) (*MessageForwardOriginHiddenUser, error) { - var resp MessageForwardOriginHiddenUser +func UnmarshalMessageOriginChat(data json.RawMessage) (*MessageOriginChat, error) { + var resp MessageOriginChat err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalMessageForwardOriginChannel(data json.RawMessage) (*MessageForwardOriginChannel, error) { - var resp MessageForwardOriginChannel - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - -func UnmarshalMessageForwardOriginMessageImport(data json.RawMessage) (*MessageForwardOriginMessageImport, error) { - var resp MessageForwardOriginMessageImport +func UnmarshalMessageOriginChannel(data json.RawMessage) (*MessageOriginChannel, error) { + var resp MessageOriginChannel err := json.Unmarshal(data, &resp) @@ -7796,6 +8161,14 @@ func UnmarshalMessageForwardInfo(data json.RawMessage) (*MessageForwardInfo, err return &resp, err } +func UnmarshalMessageImportInfo(data json.RawMessage) (*MessageImportInfo, error) { + var resp MessageImportInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageReplyInfo(data json.RawMessage) (*MessageReplyInfo, error) { var resp MessageReplyInfo @@ -7860,6 +8233,22 @@ func UnmarshalMessageReplyToStory(data json.RawMessage) (*MessageReplyToStory, e return &resp, err } +func UnmarshalInputMessageReplyToMessage(data json.RawMessage) (*InputMessageReplyToMessage, error) { + var resp InputMessageReplyToMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalInputMessageReplyToStory(data json.RawMessage) (*InputMessageReplyToStory, error) { + var resp InputMessageReplyToStory + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessage(data json.RawMessage) (*Message, error) { var resp Message @@ -8668,6 +9057,14 @@ func UnmarshalForumTopics(data json.RawMessage) (*ForumTopics, error) { return &resp, err } +func UnmarshalLinkPreviewOptions(data json.RawMessage) (*LinkPreviewOptions, error) { + var resp LinkPreviewOptions + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalRichTextPlain(data json.RawMessage) (*RichTextPlain, error) { var resp RichTextPlain @@ -9340,6 +9737,14 @@ func UnmarshalInputInvoiceName(data json.RawMessage) (*InputInvoiceName, error) return &resp, err } +func UnmarshalInputInvoiceTelegram(data json.RawMessage) (*InputInvoiceTelegram, error) { + var resp InputInvoiceTelegram + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageExtendedMediaPreview(data json.RawMessage) (*MessageExtendedMediaPreview, error) { var resp MessageExtendedMediaPreview @@ -9372,6 +9777,14 @@ func UnmarshalMessageExtendedMediaUnsupported(data json.RawMessage) (*MessageExt return &resp, err } +func UnmarshalPremiumGiveawayParameters(data json.RawMessage) (*PremiumGiveawayParameters, error) { + var resp PremiumGiveawayParameters + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDatedFile(data json.RawMessage) (*DatedFile, error) { var resp DatedFile @@ -10364,6 +10777,30 @@ func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, return &resp, err } +func UnmarshalMessagePremiumGiftCode(data json.RawMessage) (*MessagePremiumGiftCode, error) { + var resp MessagePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveawayCreated(data json.RawMessage) (*MessagePremiumGiveawayCreated, error) { + var resp MessagePremiumGiveawayCreated + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalMessagePremiumGiveaway(data json.RawMessage) (*MessagePremiumGiveaway, error) { + var resp MessagePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { var resp MessageContactRegistered @@ -10388,14 +10825,6 @@ func UnmarshalMessageChatShared(data json.RawMessage) (*MessageChatShared, error return &resp, err } -func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConnected, error) { - var resp MessageWebsiteConnected - - err := json.Unmarshal(data, &resp) - - return &resp, err -} - func UnmarshalMessageBotWriteAccessAllowed(data json.RawMessage) (*MessageBotWriteAccessAllowed, error) { var resp MessageBotWriteAccessAllowed @@ -10580,6 +11009,14 @@ func UnmarshalTextEntityTypePreCode(data json.RawMessage) (*TextEntityTypePreCod return &resp, err } +func UnmarshalTextEntityTypeBlockQuote(data json.RawMessage) (*TextEntityTypeBlockQuote, error) { + var resp TextEntityTypeBlockQuote + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalTextEntityTypeTextUrl(data json.RawMessage) (*TextEntityTypeTextUrl, error) { var resp TextEntityTypeTextUrl @@ -11244,6 +11681,14 @@ func UnmarshalStoryAreaTypeVenue(data json.RawMessage) (*StoryAreaTypeVenue, err return &resp, err } +func UnmarshalStoryAreaTypeSuggestedReaction(data json.RawMessage) (*StoryAreaTypeSuggestedReaction, error) { + var resp StoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { var resp StoryArea @@ -11276,6 +11721,14 @@ func UnmarshalInputStoryAreaTypePreviousVenue(data json.RawMessage) (*InputStory return &resp, err } +func UnmarshalInputStoryAreaTypeSuggestedReaction(data json.RawMessage) (*InputStoryAreaTypeSuggestedReaction, error) { + var resp InputStoryAreaTypeSuggestedReaction + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { var resp InputStoryArea @@ -11396,6 +11849,78 @@ func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error return &resp, err } +func UnmarshalChatBoostSourceGiftCode(data json.RawMessage) (*ChatBoostSourceGiftCode, error) { + var resp ChatBoostSourceGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourceGiveaway(data json.RawMessage) (*ChatBoostSourceGiveaway, error) { + var resp ChatBoostSourceGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSourcePremium(data json.RawMessage) (*ChatBoostSourcePremium, error) { + var resp ChatBoostSourcePremium + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPrepaidPremiumGiveaway(data json.RawMessage) (*PrepaidPremiumGiveaway, error) { + var resp PrepaidPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostStatus(data json.RawMessage) (*ChatBoostStatus, error) { + var resp ChatBoostStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoost(data json.RawMessage) (*ChatBoost, error) { + var resp ChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalFoundChatBoosts(data json.RawMessage) (*FoundChatBoosts, error) { + var resp FoundChatBoosts + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlot(data json.RawMessage) (*ChatBoostSlot, error) { + var resp ChatBoostSlot + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostSlots(data json.RawMessage) (*ChatBoostSlots, error) { + var resp ChatBoostSlots + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCallDiscardReasonEmpty(data json.RawMessage) (*CallDiscardReasonEmpty, error) { var resp CallDiscardReasonEmpty @@ -11844,6 +12369,38 @@ func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error return &resp, err } +func UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data json.RawMessage) (*BotWriteAccessAllowReasonConnectedWebsite, error) { + var resp BotWriteAccessAllowReasonConnectedWebsite + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data json.RawMessage) (*BotWriteAccessAllowReasonAddedToAttachmentMenu, error) { + var resp BotWriteAccessAllowReasonAddedToAttachmentMenu + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data json.RawMessage) (*BotWriteAccessAllowReasonLaunchedWebApp, error) { + var resp BotWriteAccessAllowReasonLaunchedWebApp + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data json.RawMessage) (*BotWriteAccessAllowReasonAcceptedRequest, error) { + var resp BotWriteAccessAllowReasonAcceptedRequest + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) { var resp HttpUrl @@ -12332,6 +12889,22 @@ func UnmarshalChatEventActiveUsernamesChanged(data json.RawMessage) (*ChatEventA return &resp, err } +func UnmarshalChatEventAccentColorChanged(data json.RawMessage) (*ChatEventAccentColorChanged, error) { + var resp ChatEventAccentColorChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatEventBackgroundCustomEmojiChanged(data json.RawMessage) (*ChatEventBackgroundCustomEmojiChanged, error) { + var resp ChatEventBackgroundCustomEmojiChanged + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalChatEventHasProtectedContentToggled(data json.RawMessage) (*ChatEventHasProtectedContentToggled, error) { var resp ChatEventHasProtectedContentToggled @@ -12700,6 +13273,14 @@ func UnmarshalPremiumLimitTypeStoryCaptionLength(data json.RawMessage) (*Premium return &resp, err } +func UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data json.RawMessage) (*PremiumLimitTypeStorySuggestedReactionAreaCount, error) { + var resp PremiumLimitTypeStorySuggestedReactionAreaCount + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumFeatureIncreasedLimits(data json.RawMessage) (*PremiumFeatureIncreasedLimits, error) { var resp PremiumFeatureIncreasedLimits @@ -12828,6 +13409,22 @@ func UnmarshalPremiumFeatureUpgradedStories(data json.RawMessage) (*PremiumFeatu return &resp, err } +func UnmarshalPremiumFeatureChatBoost(data json.RawMessage) (*PremiumFeatureChatBoost, error) { + var resp PremiumFeatureChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPremiumFeatureAccentColor(data json.RawMessage) (*PremiumFeatureAccentColor, error) { + var resp PremiumFeatureAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPremiumStoryFeaturePriorityOrder(data json.RawMessage) (*PremiumStoryFeaturePriorityOrder, error) { var resp PremiumStoryFeaturePriorityOrder @@ -12964,6 +13561,38 @@ func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaym return &resp, err } +func UnmarshalStorePaymentPurposePremiumGiftCodes(data json.RawMessage) (*StorePaymentPurposePremiumGiftCodes, error) { + var resp StorePaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStorePaymentPurposePremiumGiveaway(data json.RawMessage) (*StorePaymentPurposePremiumGiveaway, error) { + var resp StorePaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiftCodes(data json.RawMessage) (*TelegramPaymentPurposePremiumGiftCodes, error) { + var resp TelegramPaymentPurposePremiumGiftCodes + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalTelegramPaymentPurposePremiumGiveaway(data json.RawMessage) (*TelegramPaymentPurposePremiumGiveaway, error) { + var resp TelegramPaymentPurposePremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { var resp DeviceTokenFirebaseCloudMessaging @@ -13180,6 +13809,14 @@ func UnmarshalCanSendStoryResultPremiumNeeded(data json.RawMessage) (*CanSendSto return &resp, err } +func UnmarshalCanSendStoryResultBoostNeeded(data json.RawMessage) (*CanSendStoryResultBoostNeeded, error) { + var resp CanSendStoryResultBoostNeeded + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data json.RawMessage) (*CanSendStoryResultActiveStoryLimitExceeded, error) { var resp CanSendStoryResultActiveStoryLimitExceeded @@ -13452,6 +14089,22 @@ func UnmarshalPushMessageContentPoll(data json.RawMessage) (*PushMessageContentP return &resp, err } +func UnmarshalPushMessageContentPremiumGiftCode(data json.RawMessage) (*PushMessageContentPremiumGiftCode, error) { + var resp PushMessageContentPremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalPushMessageContentPremiumGiveaway(data json.RawMessage) (*PushMessageContentPremiumGiveaway, error) { + var resp PushMessageContentPremiumGiveaway + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPushMessageContentScreenshotTaken(data json.RawMessage) (*PushMessageContentScreenshotTaken, error) { var resp PushMessageContentScreenshotTaken @@ -14340,6 +14993,14 @@ func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*Internal return &resp, err } +func UnmarshalInternalLinkTypeChatBoost(data json.RawMessage) (*InternalLinkTypeChatBoost, error) { + var resp InternalLinkTypeChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypeChatFolderInvite(data json.RawMessage) (*InternalLinkTypeChatFolderInvite, error) { var resp InternalLinkTypeChatFolderInvite @@ -14460,6 +15121,14 @@ func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLi return &resp, err } +func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLinkTypePremiumGiftCode, error) { + var resp InternalLinkTypePremiumGiftCode + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data json.RawMessage) (*InternalLinkTypePrivacyAndSecuritySettings, error) { var resp InternalLinkTypePrivacyAndSecuritySettings @@ -14612,6 +15281,22 @@ func UnmarshalMessageLinkInfo(data json.RawMessage) (*MessageLinkInfo, error) { return &resp, err } +func UnmarshalChatBoostLink(data json.RawMessage) (*ChatBoostLink, error) { + var resp ChatBoostLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalChatBoostLinkInfo(data json.RawMessage) (*ChatBoostLinkInfo, error) { + var resp ChatBoostLinkInfo + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalBlockListMain(data json.RawMessage) (*BlockListMain, error) { var resp BlockListMain @@ -15060,6 +15745,14 @@ func UnmarshalTopChatCategoryForwardChats(data json.RawMessage) (*TopChatCategor return &resp, err } +func UnmarshalFoundPosition(data json.RawMessage) (*FoundPosition, error) { + var resp FoundPosition + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalFoundPositions(data json.RawMessage) (*FoundPositions, error) { var resp FoundPositions @@ -15596,6 +16289,22 @@ func UnmarshalUpdateChatPhoto(data json.RawMessage) (*UpdateChatPhoto, error) { return &resp, err } +func UnmarshalUpdateChatAccentColor(data json.RawMessage) (*UpdateChatAccentColor, error) { + var resp UpdateChatAccentColor + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalUpdateChatBackgroundCustomEmoji(data json.RawMessage) (*UpdateChatBackgroundCustomEmoji, error) { + var resp UpdateChatBackgroundCustomEmoji + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateChatPermissions(data json.RawMessage) (*UpdateChatPermissions, error) { var resp UpdateChatPermissions @@ -16188,6 +16897,14 @@ func UnmarshalUpdateChatThemes(data json.RawMessage) (*UpdateChatThemes, error) return &resp, err } +func UnmarshalUpdateAccentColors(data json.RawMessage) (*UpdateAccentColors, error) { + var resp UpdateAccentColors + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateLanguagePackStrings(data json.RawMessage) (*UpdateLanguagePackStrings, error) { var resp UpdateLanguagePackStrings @@ -16404,6 +17121,14 @@ func UnmarshalUpdateNewChatJoinRequest(data json.RawMessage) (*UpdateNewChatJoin return &resp, err } +func UnmarshalUpdateChatBoost(data json.RawMessage) (*UpdateChatBoost, error) { + var resp UpdateChatBoost + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdates(data json.RawMessage) (*Updates, error) { var resp Updates @@ -16864,6 +17589,39 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumStatePaymentOption: return UnmarshalPremiumStatePaymentOption(data) + case TypePremiumGiftCodePaymentOption: + return UnmarshalPremiumGiftCodePaymentOption(data) + + case TypePremiumGiftCodePaymentOptions: + return UnmarshalPremiumGiftCodePaymentOptions(data) + + case TypePremiumGiftCodeInfo: + return UnmarshalPremiumGiftCodeInfo(data) + + case TypePremiumGiveawayParticipantStatusEligible: + return UnmarshalPremiumGiveawayParticipantStatusEligible(data) + + case TypePremiumGiveawayParticipantStatusParticipating: + return UnmarshalPremiumGiveawayParticipantStatusParticipating(data) + + case TypePremiumGiveawayParticipantStatusAlreadyWasMember: + return UnmarshalPremiumGiveawayParticipantStatusAlreadyWasMember(data) + + case TypePremiumGiveawayParticipantStatusAdministrator: + return UnmarshalPremiumGiveawayParticipantStatusAdministrator(data) + + case TypePremiumGiveawayParticipantStatusDisallowedCountry: + return UnmarshalPremiumGiveawayParticipantStatusDisallowedCountry(data) + + case TypePremiumGiveawayInfoOngoing: + return UnmarshalPremiumGiveawayInfoOngoing(data) + + case TypePremiumGiveawayInfoCompleted: + return UnmarshalPremiumGiveawayInfoCompleted(data) + + case TypeAccentColor: + return UnmarshalAccentColor(data) + case TypeEmojiStatus: return UnmarshalEmojiStatus(data) @@ -17044,20 +17802,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageViewers: return UnmarshalMessageViewers(data) - case TypeMessageForwardOriginUser: - return UnmarshalMessageForwardOriginUser(data) + case TypeMessageOriginUser: + return UnmarshalMessageOriginUser(data) - case TypeMessageForwardOriginChat: - return UnmarshalMessageForwardOriginChat(data) + case TypeMessageOriginHiddenUser: + return UnmarshalMessageOriginHiddenUser(data) - case TypeMessageForwardOriginHiddenUser: - return UnmarshalMessageForwardOriginHiddenUser(data) + case TypeMessageOriginChat: + return UnmarshalMessageOriginChat(data) - case TypeMessageForwardOriginChannel: - return UnmarshalMessageForwardOriginChannel(data) - - case TypeMessageForwardOriginMessageImport: - return UnmarshalMessageForwardOriginMessageImport(data) + case TypeMessageOriginChannel: + return UnmarshalMessageOriginChannel(data) case TypeReactionTypeEmoji: return UnmarshalReactionTypeEmoji(data) @@ -17068,6 +17823,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageForwardInfo: return UnmarshalMessageForwardInfo(data) + case TypeMessageImportInfo: + return UnmarshalMessageImportInfo(data) + case TypeMessageReplyInfo: return UnmarshalMessageReplyInfo(data) @@ -17092,6 +17850,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageReplyToStory: return UnmarshalMessageReplyToStory(data) + case TypeInputMessageReplyToMessage: + return UnmarshalInputMessageReplyToMessage(data) + + case TypeInputMessageReplyToStory: + return UnmarshalInputMessageReplyToStory(data) + case TypeMessage: return UnmarshalMessage(data) @@ -17395,6 +18159,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeForumTopics: return UnmarshalForumTopics(data) + case TypeLinkPreviewOptions: + return UnmarshalLinkPreviewOptions(data) + case TypeRichTextPlain: return UnmarshalRichTextPlain(data) @@ -17647,6 +18414,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputInvoiceName: return UnmarshalInputInvoiceName(data) + case TypeInputInvoiceTelegram: + return UnmarshalInputInvoiceTelegram(data) + case TypeMessageExtendedMediaPreview: return UnmarshalMessageExtendedMediaPreview(data) @@ -17659,6 +18429,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageExtendedMediaUnsupported: return UnmarshalMessageExtendedMediaUnsupported(data) + case TypePremiumGiveawayParameters: + return UnmarshalPremiumGiveawayParameters(data) + case TypeDatedFile: return UnmarshalDatedFile(data) @@ -18031,6 +18804,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageGiftedPremium: return UnmarshalMessageGiftedPremium(data) + case TypeMessagePremiumGiftCode: + return UnmarshalMessagePremiumGiftCode(data) + + case TypeMessagePremiumGiveawayCreated: + return UnmarshalMessagePremiumGiveawayCreated(data) + + case TypeMessagePremiumGiveaway: + return UnmarshalMessagePremiumGiveaway(data) + case TypeMessageContactRegistered: return UnmarshalMessageContactRegistered(data) @@ -18040,9 +18822,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageChatShared: return UnmarshalMessageChatShared(data) - case TypeMessageWebsiteConnected: - return UnmarshalMessageWebsiteConnected(data) - case TypeMessageBotWriteAccessAllowed: return UnmarshalMessageBotWriteAccessAllowed(data) @@ -18112,6 +18891,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTextEntityTypePreCode: return UnmarshalTextEntityTypePreCode(data) + case TypeTextEntityTypeBlockQuote: + return UnmarshalTextEntityTypeBlockQuote(data) + case TypeTextEntityTypeTextUrl: return UnmarshalTextEntityTypeTextUrl(data) @@ -18361,6 +19143,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryAreaTypeVenue: return UnmarshalStoryAreaTypeVenue(data) + case TypeStoryAreaTypeSuggestedReaction: + return UnmarshalStoryAreaTypeSuggestedReaction(data) + case TypeStoryArea: return UnmarshalStoryArea(data) @@ -18373,6 +19158,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputStoryAreaTypePreviousVenue: return UnmarshalInputStoryAreaTypePreviousVenue(data) + case TypeInputStoryAreaTypeSuggestedReaction: + return UnmarshalInputStoryAreaTypeSuggestedReaction(data) + case TypeInputStoryArea: return UnmarshalInputStoryArea(data) @@ -18418,6 +19206,33 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatActiveStories: return UnmarshalChatActiveStories(data) + case TypeChatBoostSourceGiftCode: + return UnmarshalChatBoostSourceGiftCode(data) + + case TypeChatBoostSourceGiveaway: + return UnmarshalChatBoostSourceGiveaway(data) + + case TypeChatBoostSourcePremium: + return UnmarshalChatBoostSourcePremium(data) + + case TypePrepaidPremiumGiveaway: + return UnmarshalPrepaidPremiumGiveaway(data) + + case TypeChatBoostStatus: + return UnmarshalChatBoostStatus(data) + + case TypeChatBoost: + return UnmarshalChatBoost(data) + + case TypeFoundChatBoosts: + return UnmarshalFoundChatBoosts(data) + + case TypeChatBoostSlot: + return UnmarshalChatBoostSlot(data) + + case TypeChatBoostSlots: + return UnmarshalChatBoostSlots(data) + case TypeCallDiscardReasonEmpty: return UnmarshalCallDiscardReasonEmpty(data) @@ -18586,6 +19401,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeSentWebAppMessage: return UnmarshalSentWebAppMessage(data) + case TypeBotWriteAccessAllowReasonConnectedWebsite: + return UnmarshalBotWriteAccessAllowReasonConnectedWebsite(data) + + case TypeBotWriteAccessAllowReasonAddedToAttachmentMenu: + return UnmarshalBotWriteAccessAllowReasonAddedToAttachmentMenu(data) + + case TypeBotWriteAccessAllowReasonLaunchedWebApp: + return UnmarshalBotWriteAccessAllowReasonLaunchedWebApp(data) + + case TypeBotWriteAccessAllowReasonAcceptedRequest: + return UnmarshalBotWriteAccessAllowReasonAcceptedRequest(data) + case TypeHttpUrl: return UnmarshalHttpUrl(data) @@ -18769,6 +19596,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatEventActiveUsernamesChanged: return UnmarshalChatEventActiveUsernamesChanged(data) + case TypeChatEventAccentColorChanged: + return UnmarshalChatEventAccentColorChanged(data) + + case TypeChatEventBackgroundCustomEmojiChanged: + return UnmarshalChatEventBackgroundCustomEmojiChanged(data) + case TypeChatEventHasProtectedContentToggled: return UnmarshalChatEventHasProtectedContentToggled(data) @@ -18907,6 +19740,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumLimitTypeStoryCaptionLength: return UnmarshalPremiumLimitTypeStoryCaptionLength(data) + case TypePremiumLimitTypeStorySuggestedReactionAreaCount: + return UnmarshalPremiumLimitTypeStorySuggestedReactionAreaCount(data) + case TypePremiumFeatureIncreasedLimits: return UnmarshalPremiumFeatureIncreasedLimits(data) @@ -18955,6 +19791,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePremiumFeatureUpgradedStories: return UnmarshalPremiumFeatureUpgradedStories(data) + case TypePremiumFeatureChatBoost: + return UnmarshalPremiumFeatureChatBoost(data) + + case TypePremiumFeatureAccentColor: + return UnmarshalPremiumFeatureAccentColor(data) + case TypePremiumStoryFeaturePriorityOrder: return UnmarshalPremiumStoryFeaturePriorityOrder(data) @@ -19006,6 +19848,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStorePaymentPurposeGiftedPremium: return UnmarshalStorePaymentPurposeGiftedPremium(data) + case TypeStorePaymentPurposePremiumGiftCodes: + return UnmarshalStorePaymentPurposePremiumGiftCodes(data) + + case TypeStorePaymentPurposePremiumGiveaway: + return UnmarshalStorePaymentPurposePremiumGiveaway(data) + + case TypeTelegramPaymentPurposePremiumGiftCodes: + return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data) + + case TypeTelegramPaymentPurposePremiumGiveaway: + return UnmarshalTelegramPaymentPurposePremiumGiveaway(data) + case TypeDeviceTokenFirebaseCloudMessaging: return UnmarshalDeviceTokenFirebaseCloudMessaging(data) @@ -19087,6 +19941,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeCanSendStoryResultPremiumNeeded: return UnmarshalCanSendStoryResultPremiumNeeded(data) + case TypeCanSendStoryResultBoostNeeded: + return UnmarshalCanSendStoryResultBoostNeeded(data) + case TypeCanSendStoryResultActiveStoryLimitExceeded: return UnmarshalCanSendStoryResultActiveStoryLimitExceeded(data) @@ -19189,6 +20046,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypePushMessageContentPoll: return UnmarshalPushMessageContentPoll(data) + case TypePushMessageContentPremiumGiftCode: + return UnmarshalPushMessageContentPremiumGiftCode(data) + + case TypePushMessageContentPremiumGiveaway: + return UnmarshalPushMessageContentPremiumGiveaway(data) + case TypePushMessageContentScreenshotTaken: return UnmarshalPushMessageContentScreenshotTaken(data) @@ -19522,6 +20385,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypeChangePhoneNumber: return UnmarshalInternalLinkTypeChangePhoneNumber(data) + case TypeInternalLinkTypeChatBoost: + return UnmarshalInternalLinkTypeChatBoost(data) + case TypeInternalLinkTypeChatFolderInvite: return UnmarshalInternalLinkTypeChatFolderInvite(data) @@ -19567,6 +20433,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInternalLinkTypePremiumFeatures: return UnmarshalInternalLinkTypePremiumFeatures(data) + case TypeInternalLinkTypePremiumGiftCode: + return UnmarshalInternalLinkTypePremiumGiftCode(data) + case TypeInternalLinkTypePrivacyAndSecuritySettings: return UnmarshalInternalLinkTypePrivacyAndSecuritySettings(data) @@ -19624,6 +20493,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeMessageLinkInfo: return UnmarshalMessageLinkInfo(data) + case TypeChatBoostLink: + return UnmarshalChatBoostLink(data) + + case TypeChatBoostLinkInfo: + return UnmarshalChatBoostLinkInfo(data) + case TypeBlockListMain: return UnmarshalBlockListMain(data) @@ -19792,6 +20667,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeTopChatCategoryForwardChats: return UnmarshalTopChatCategoryForwardChats(data) + case TypeFoundPosition: + return UnmarshalFoundPosition(data) + case TypeFoundPositions: return UnmarshalFoundPositions(data) @@ -19993,6 +20871,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatPhoto: return UnmarshalUpdateChatPhoto(data) + case TypeUpdateChatAccentColor: + return UnmarshalUpdateChatAccentColor(data) + + case TypeUpdateChatBackgroundCustomEmoji: + return UnmarshalUpdateChatBackgroundCustomEmoji(data) + case TypeUpdateChatPermissions: return UnmarshalUpdateChatPermissions(data) @@ -20215,6 +21099,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatThemes: return UnmarshalUpdateChatThemes(data) + case TypeUpdateAccentColors: + return UnmarshalUpdateAccentColors(data) + case TypeUpdateLanguagePackStrings: return UnmarshalUpdateLanguagePackStrings(data) @@ -20296,6 +21183,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewChatJoinRequest: return UnmarshalUpdateNewChatJoinRequest(data) + case TypeUpdateChatBoost: + return UnmarshalUpdateChatBoost(data) + case TypeUpdates: return UnmarshalUpdates(data) diff --git a/data/td_api.tl b/data/td_api.tl index df470f6..b14df9a 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -105,7 +105,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. BlockQuote entities can't contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; @@ -633,11 +633,11 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; //@description Describes actions that a user is allowed to take in a chat -//@can_send_basic_messages True, if the user can send text messages, contacts, invoices, locations, and venues +//@can_send_basic_messages True, if the user can send text messages, contacts, giveaways, invoices, locations, and venues //@can_send_audios True, if the user can send music files //@can_send_documents True, if the user can send documents -//@can_send_photos True, if the user can send audio photos -//@can_send_videos True, if the user can send audio videos +//@can_send_photos True, if the user can send photos +//@can_send_videos True, if the user can send videos //@can_send_video_notes True, if the user can send video notes //@can_send_voice_notes True, if the user can send voice notes //@can_send_polls True, if the user can send polls @@ -653,19 +653,22 @@ inputChatPhotoSticker sticker:chatPhotoSticker = InputChatPhoto; 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_manage_topics:Bool = ChatPermissions; //@description Describes rights of the administrator -//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only +//@can_manage_chat True, if the administrator can get chat event log, get chat boosts in channels, get channel members, report supergroup spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only //@can_change_info True, if the administrator can change the chat title, photo, and other settings -//@can_post_messages True, if the administrator can create channel posts; applicable to channels only +//@can_post_messages True, if the administrator can create channel posts or view channel statistics; applicable to channels only //@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only //@can_delete_messages True, if the administrator can delete messages of other users //@can_invite_users True, if the administrator can invite new users to the chat -//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members; always true for channels +//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only //@can_manage_topics True, if the administrator can manage topics; applicable to forum supergroups only //@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them //@can_manage_video_chats True, if the administrator can manage video chats +//@can_post_stories True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only +//@can_edit_stories True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only +//@can_delete_stories True, if the administrator can delete stories posted by other users; applicable to channels only //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; +chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; //@description Describes an option for buying Telegram Premium to a user @@ -684,6 +687,72 @@ premiumPaymentOption currency:string amount:int53 discount_percentage:int32 mont //@last_transaction_id Identifier of the last in-store transaction for the currently used option premiumStatePaymentOption payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; +//@description Describes an option for creating Telegram Premium gift codes +//@currency ISO 4217 currency code for Telegram Premium gift code payment +//@amount The amount to pay, in the smallest units of the currency +//@user_count Number of users which will be able to activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active +//@store_product_id Identifier of the store product associated with the option; may be empty if none +//@store_product_quantity Number of times the store product must be paid +premiumGiftCodePaymentOption currency:string amount:int53 user_count:int32 month_count:int32 store_product_id:string store_product_quantity:int32 = PremiumGiftCodePaymentOption; + +//@description Contains a list of options for creating Telegram Premium gift codes @options The list of options +premiumGiftCodePaymentOptions options:vector = PremiumGiftCodePaymentOptions; + +//@description Contains information about a Telegram Premium gift code +//@creator_id Identifier of a chat or a user that created the gift code +//@creation_date Point in time (Unix timestamp) when the code was created +//@is_from_giveaway True, if the gift code was created for a giveaway +//@giveaway_message_id Identifier of the corresponding giveaway message; can be 0 or an identifier of a deleted message +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@user_id Identifier of a user for which the code was created; 0 if none +//@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; + + +//@class PremiumGiveawayParticipantStatus @description Contains information about status of a user in a Telegram Premium giveaway + +//@description The user is eligible for the giveaway +premiumGiveawayParticipantStatusEligible = PremiumGiveawayParticipantStatus; + +//@description The user participates in the giveaway +premiumGiveawayParticipantStatusParticipating = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they have already been member of the chat +//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat +premiumGiveawayParticipantStatusAlreadyWasMember joined_chat_date:int32 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they are an administrator in one of the chats that created the giveaway @chat_id Identifier of the chat administered by the user +premiumGiveawayParticipantStatusAdministrator chat_id:int53 = PremiumGiveawayParticipantStatus; + +//@description The user can't participate in the giveaway, because they phone number is from a disallowed country @user_country_code A two-letter ISO 3166-1 alpha-2 country code of the user's country +premiumGiveawayParticipantStatusDisallowedCountry user_country_code:string = PremiumGiveawayParticipantStatus; + + +//@class PremiumGiveawayInfo @description Contains information about Telegram Premium giveaway + +//@description Describes an ongoing giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@status Status of the current user in the giveaway +//@is_ended True, if the giveaway has ended and results are being prepared +premiumGiveawayInfoOngoing creation_date:int32 status:PremiumGiveawayParticipantStatus is_ended:Bool = PremiumGiveawayInfo; + +//@description Describes a completed giveaway +//@creation_date Point in time (Unix timestamp) when the giveaway was created +//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway +//@was_refunded True, if the giveaway was canceled and was fully refunded +//@winner_count Number of winners in the giveaway +//@activation_count Number of winners, which activated their gift codes +//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway +premiumGiveawayInfoCompleted creation_date:int32 actual_winners_selection_date:int32 was_refunded:Bool winner_count:int32 activation_count:int32 gift_code:string = PremiumGiveawayInfo; + + +//@description Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews +//@id Accent color identifier +//@built_in_accent_color_id Identifier of a built-in color to use in places, where only one color is needed; 0-6 +//@light_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes +//@dark_theme_colors The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes +accentColor id:int32 built_in_accent_color_id:int32 light_theme_colors:vector dark_theme_colors:vector = AccentColor; //@description Describes a custom emoji to be shown instead of the Telegram Premium badge //@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format @@ -710,6 +779,8 @@ usernames active_usernames:vector disabled_usernames:vector edit //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null +//@accent_color_id Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none. For Telegram Premium users only //@emoji_status Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only //@is_contact The user is a contact of the current user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user @@ -726,7 +797,7 @@ usernames active_usernames:vector disabled_usernames:vector edit //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -926,6 +997,7 @@ inviteLinkChatTypeChannel = InviteLinkChatType; //@type Type of the chat //@title Title of the chat //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@param_description Chat description //@member_count Number of members in the chat //@member_user_ids User identifiers of some chat members that may be known to the current user @@ -934,7 +1006,7 @@ inviteLinkChatTypeChannel = InviteLinkChatType; //@is_verified True, if the chat is verified //@is_scam True, if many users reported this chat as a scam //@is_fake True, if many users reported this chat as a fake account -chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; +chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo; //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user @@ -991,7 +1063,9 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@is_scam True, if many users reported this supergroup or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +//@has_active_stories True, if the channel has non-expired stories available to the current user +//@has_unread_active_stories True, if the channel has unread non-expired stories available to the current user +supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; //@description Contains full information about a supergroup or channel //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo @@ -1013,13 +1087,14 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat //@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 //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators +//@has_pinned_stories True, if the channel has pinned stories //@sticker_set_id Identifier of the supergroup sticker set; 0 if none //@location Location to which the supergroup is connected; may be null if none //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@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_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -1073,27 +1148,24 @@ messageViewer user_id:int53 view_date:int32 = MessageViewer; messageViewers viewers:vector = MessageViewers; -//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message +//@class MessageOrigin @description Contains information about the origin of a message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message -messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin; +messageOriginUser sender_user_id:int53 = MessageOrigin; + +//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender +messageOriginHiddenUser sender_name:string = MessageOrigin; //@description The message was originally sent on behalf of a chat //@sender_chat_id Identifier of the chat that originally sent the message //@author_signature For messages originally sent by an anonymous chat administrator, original message author signature -messageForwardOriginChat sender_chat_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was originally sent by a user, which is hidden by their privacy settings @sender_name Name of the sender -messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin; +messageOriginChat sender_chat_id:int53 author_signature:string = MessageOrigin; //@description The message was originally a post in a channel -//@chat_id Identifier of the chat from which the message was originally forwarded +//@chat_id Identifier of the channel chat to which the message was originally sent //@message_id Message identifier of the original message //@author_signature Original post author signature -messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin; - -//@description The message was imported from an exported message history @sender_name Name of the sender -messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin; +messageOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageOrigin; //@class ReactionType @description Describes type of message reaction @@ -1106,12 +1178,17 @@ reactionTypeCustomEmoji custom_emoji_id:int64 = ReactionType; //@description Contains information about a forwarded message -//@origin Origin of a forwarded message +//@origin Origin of the forwarded message //@date Point in time (Unix timestamp) when the message was originally sent //@public_service_announcement_type The type of a public service announcement for the forwarded message //@from_chat_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown //@from_message_id For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown -messageForwardInfo origin:MessageForwardOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; +messageForwardInfo origin:MessageOrigin date:int32 public_service_announcement_type:string from_chat_id:int53 from_message_id:int53 = MessageForwardInfo; + +//@description Contains information about a message created with importMessages +//@sender_name Name of the original sender +//@date Point in time (Unix timestamp) when the message was originally sent +messageImportInfo sender_name:string date:int32 = MessageImportInfo; //@description Contains information about replies to a message //@reply_count Number of times the message was directly or indirectly replied @@ -1125,8 +1202,10 @@ messageReplyInfo reply_count:int32 recent_replier_ids:vector last //@type Type of the reaction //@total_count Number of times the reaction was added //@is_chosen True, if the reaction is chosen by the current user +//@used_sender_id Identifier of the message sender used by the current user to add the reaction; null if unknown or the reaction isn't chosen //@recent_sender_ids Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats -messageReaction type:ReactionType total_count:int32 is_chosen:Bool recent_sender_ids:vector = MessageReaction; +messageReaction type:ReactionType total_count:int32 is_chosen:Bool used_sender_id:MessageSender recent_sender_ids:vector = MessageReaction; + //@description Contains information about interactions with a message //@view_count Number of times the message was viewed @@ -1148,25 +1227,46 @@ unreadReaction type:ReactionType sender_id:MessageSender is_big:Bool = UnreadRea messageSendingStatePending sending_id:int32 = MessageSendingState; //@description The message failed to be sent -//@error_code An error code; 0 if unknown -//@error_message Error message +//@error The cause of the message sending failure //@can_retry True, if the message can be re-sent //@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 //@retry_after Time left before the message can be re-sent, in seconds. No update is sent when this field changes -messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool need_another_sender:Bool retry_after:double = MessageSendingState; +messageSendingStateFailed error:error can_retry:Bool need_another_sender:Bool need_another_reply_quote:Bool need_drop_reply:Bool retry_after:double = MessageSendingState; //@class MessageReplyTo @description Contains information about the message or the story a message is replying to -//@description Describes a replied message -//@chat_id The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats -//@message_id The identifier of the replied message -messageReplyToMessage chat_id:int53 message_id:int53 = MessageReplyTo; +//@description Describes a message replied by a given message +//@chat_id The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat +//@message_id The identifier of the message; may be 0 if the replied message is in unknown chat +//@quote Manually or automatically chosen quote from the replied message; may be null if none. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the quote +//@is_quote_manual True, if the quote was manually chosen by the message sender +//@origin Information about origin of the message if the message was replied from another chat; may be null for messages from the same chat +//@origin_send_date Point in time (Unix timestamp) when the message was sent if the message was replied from another chat; 0 for messages from the same chat +//@content Media content of the message if the message was replied from another chat; may be null for messages from the same chat and messages without media. +//-Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, messageDocument, messageGame, messageInvoice, messageLocation, +//-messagePhoto, messagePoll, messagePremiumGiveaway, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote +messageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText is_quote_manual:Bool origin:MessageOrigin origin_send_date:int32 content:MessageContent = MessageReplyTo; -//@description Describes a replied story @story_sender_chat_id The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the replied story +//@description Describes a story replied by a given message @story_sender_chat_id The identifier of the sender of the story @story_id The identifier of the story 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 +//@chat_id The identifier of the chat to which the message to be replied belongs; pass 0 if the message to be replied is in the same chat. Must always be 0 for replies in secret chats. A message can be replied in another chat only if message.can_be_replied_in_another_chat +//@message_id The identifier of the message to be replied in the same or the specified chat +//@quote Manually chosen quote from the message to be replied; pass null if none; 0-getOption("message_reply_quote_length_max") characters. Must always be null for replies in secret chats. +//-Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote +inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:formattedText = InputMessageReplyTo; + +//@description Describes a story to be replied @story_sender_chat_id The identifier of the sender of the story. Currently, stories can be replied only in the sender's chat @story_id The identifier of the story +inputMessageReplyToStory story_sender_chat_id:int53 story_id:int32 = InputMessageReplyTo; + + //@description Describes a message //@id Message identifier; unique for the chat to which the message belongs //@sender_id Identifier of the sender of the message @@ -1177,6 +1277,7 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@is_pinned True, if the message is pinned //@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 //@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 @@ -1193,12 +1294,13 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited //@forward_info Information about the initial message sender; may be null if none or unknown +//@import_info Information about the initial message for messages created with importMessages; may be null if the message isn't imported //@interaction_info Information about interactions with the message; may be null if none //@unread_reactions Information about unread reactions added to the message //@reply_to Information about the message or the story this message is replying to; may be null if none //@message_thread_id If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs //@self_destruct_type The message's self-destruct type; may be null if none -//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-desctruction isn't scheduled yet +//@self_destruct_in Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn't scheduled yet //@auto_delete_in Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never //@via_bot_user_id If non-zero, the user identifier of the bot through which this message was sent //@author_signature For channel posts and anonymous group messages, optional author signature @@ -1206,7 +1308,7 @@ messageReplyToStory story_sender_chat_id:int53 story_id:int32 = MessageReplyTo; //@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 can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_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_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 reply_to:MessageReplyTo message_thread_id:int53 self_destruct_type:MessageSelfDestructType self_destruct_in:double auto_delete_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -1362,10 +1464,10 @@ scopeNotificationSettings mute_for:int32 sound_id:int64 show_preview:Bool use_de //@description Contains information about a message draft -//@reply_to_message_id Identifier of the replied message; 0 if none +//@reply_to Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none //@date Point in time (Unix timestamp) when the draft was created //@input_message_text Content of the message draft; must be of the type inputMessageText -draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessageContent = DraftMessage; +draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; //@class ChatType @description Describes the type of a chat @@ -1493,6 +1595,8 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@type Type of the chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background in replies to messages sent by the chat; 0 if none //@permissions Actions that non-administrator chat members are allowed to take in the chat //@last_message Last message in the chat; may be null if none or unknown //@positions Positions of the chat in chat lists @@ -1522,7 +1626,7 @@ videoChat group_call_id:int32 has_participants:Bool default_participant_id:Messa //@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat //@draft_message A draft of a message in the chat; may be null if none //@client_data Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used -chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; +chat id:int53 type:ChatType title:string photo:chatPhotoInfo accent_color_id:int32 background_custom_emoji_id:int64 permissions:chatPermissions last_message:message positions:vector message_sender_id:MessageSender block_list:BlockList has_protected_content:Bool is_translatable:Bool is_marked_as_unread:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings available_reactions:ChatAvailableReactions message_auto_delete_time:int32 background:chatBackground theme_name:string action_bar:ChatActionBar video_chat:videoChat pending_join_requests:chatJoinRequestsInfo reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat; //@description Represents a list of chats @total_count Approximate total number of chats found @chat_ids List of chat identifiers chats total_count:int32 chat_ids:vector = Chats; @@ -1692,10 +1796,9 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 reque //@description Contains information about a Web App found by its short name //@web_app The Web App -//@supports_settings True, if the app supports "settings_button_pressed" event //@request_write_access True, if the user must be asked for the permission to the bot to send them messages //@skip_confirmation True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden -foundWebApp web_app:webApp supports_settings:Bool request_write_access:Bool skip_confirmation:Bool = FoundWebApp; +foundWebApp web_app:webApp request_write_access:Bool skip_confirmation:Bool = FoundWebApp; //@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; @@ -1748,6 +1851,15 @@ forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count: forumTopics total_count:int32 topics:vector next_offset_date:int32 next_offset_message_id:int53 next_offset_message_thread_id:int53 = ForumTopics; +//@description Options to be used for generation of a link preview +//@is_disabled True, if link preview must be disabled +//@url URL to use for link preview. If empty, then the first URL found in the message text will be used +//@force_small_media True, if shown media preview must be small; ignored in secret chats or if the URL isn't explicitly specified +//@force_large_media True, if shown media preview must be large; ignored in secret chats or if the URL isn't explicitly specified +//@show_above_text True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats +linkPreviewOptions is_disabled:Bool url:string force_small_media:Bool force_large_media:Bool show_above_text:Bool = LinkPreviewOptions; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -1966,8 +2078,9 @@ pageBlockSlideshow page_blocks:vector caption:pageBlockCaption = Page //@description A link to a chat //@title Chat title //@photo Chat photo; may be null +//@accent_color_id Identifier of the accent color for chat title and background of chat photo //@username Chat username by which all other information about the chat can be resolved -pageBlockChatLink title:string photo:chatPhotoInfo username:string = PageBlock; +pageBlockChatLink title:string photo:chatPhotoInfo accent_color_id:int32 username:string = PageBlock; //@description A table //@caption Table caption @@ -2006,7 +2119,7 @@ pageBlockMap location:location zoom:int32 width:int32 height:int32 caption:pageB webPageInstantView page_blocks:vector view_count:int32 version:int32 is_rtl:Bool is_full:Bool feedback_link:InternalLinkType = WebPageInstantView; -//@description Describes a web page preview +//@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 @@ -2020,6 +2133,10 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@embed_height Height of the embedded preview //@duration Duration of the content, in seconds //@author Author of the content +//@has_large_media True, if the preview has large media and its appearance can be changed +//@show_large_media True, if large media preview must be shown +//@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 @@ -2030,7 +2147,7 @@ webPageInstantView page_blocks:vector view_count:int32 version:int32 //@story_sender_chat_id The identifier of the sender of the previewed story; 0 if none //@story_id The identifier of the previewed story; 0 if none //@instant_view_version Version of web page instant view (currently, can be 1 or 2); 0 if none -webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string animation:animation audio:audio document:document sticker:sticker video:video video_note:videoNote voice_note:voiceNote story_sender_chat_id:int53 story_id:int32 instant_view_version:int32 = WebPage; +webPage url:string display_url:string type:string site_name:string title:string description:formattedText photo:photo embed_url:string embed_type:string embed_width:int32 embed_height:int32 duration:int32 author:string 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 instant_view_version:int32 = WebPage; //@description Contains information about a country @@ -2072,12 +2189,18 @@ address country_code:string state:string city:string street_line1:string street_ //@description Contains parameters of the application theme //@background_color A color of the background in the RGB24 format //@secondary_background_color A secondary color for the background in the RGB24 format +//@header_background_color A color of the header background in the RGB24 format +//@section_background_color A color of the section background in the RGB24 format //@text_color A color of text in the RGB24 format +//@accent_text_color An accent color of the text in the RGB24 format +//@section_header_text_color A color of text on the section headers in the RGB24 format +//@subtitle_text_color A color of the subtitle text in the RGB24 format +//@destructive_text_color A color of the text for destructive actions in the RGB24 format //@hint_color A color of hints in the RGB24 format //@link_color A color of links in the RGB24 format //@button_color A color of the buttons in the RGB24 format //@button_text_color A color of text on the buttons in the RGB24 format -themeParameters background_color:int32 secondary_background_color:int32 text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; +themeParameters background_color:int32 secondary_background_color:int32 header_background_color:int32 section_background_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") @label Label for this portion of the product price @amount Currency amount in the smallest units of the currency @@ -2089,6 +2212,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency //@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency //@recurring_payment_terms_of_service_url An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay +//@terms_of_service_url An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay //@is_test True, if the payment is a test payment //@need_name True, if the user's name is needed for payment //@need_phone_number True, if the user's phone number is needed for payment @@ -2097,7 +2221,7 @@ labeledPricePart label:string amount:int53 = LabeledPricePart; //@send_phone_number_to_provider True, if the user's phone number will be sent to the provider //@send_email_address_to_provider True, if the user's email address will be sent to the provider //@is_flexible True, if the total price depends on the shipping method -invoice currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; +invoice currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; //@description Order information //@name Name of the user @@ -2196,6 +2320,9 @@ inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; //@description An invoice from a link of the type internalLinkTypeInvoice @name Name of the invoice inputInvoiceName name:string = InputInvoice; +//@description An invoice for a payment toward Telegram; must not be used in the in-store apps @purpose Transaction purpose +inputInvoiceTelegram purpose:TelegramPaymentPurpose = InputInvoice; + //@class MessageExtendedMedia @description Describes a media, which is attached to an invoice @@ -2217,6 +2344,15 @@ messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMed messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; +//@description Describes parameters of a Telegram Premium giveaway +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription +//@additional_chat_ids Identifiers of other channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats +//@winners_selection_date Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways +//@only_new_members True, if only new subscribers of the chats will be eligible for the giveaway +//@country_codes The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. +//-There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought on Fragment can participate in any giveaway and the country code "FT" must not be specified in the list +premiumGiveawayParameters boosted_chat_id:int53 additional_chat_ids:vector winners_selection_date:int32 only_new_members:Bool country_codes:vector = PremiumGiveawayParameters; + //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded datedFile file:file date:int32 = DatedFile; @@ -2500,8 +2636,11 @@ inputPassportElementError type:PassportElementType message:string source:InputPa //@class MessageContent @description Contains the content of a message -//@description A text message @text Text of the message @web_page A preview of the web page that's mentioned in the text; may be null -messageText text:formattedText web_page:webPage = MessageContent; +//@description A text message +//@text Text of the message +//@web_page A link preview attached to the message; may be null +//@link_preview_options Options which was 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; //@description An animation message (GIF-style). //@animation The animation description @@ -2714,6 +2853,25 @@ messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool //@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; +//@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 +//@is_from_giveaway True, if the gift code was created for a giveaway +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@sticker A sticker to be shown in the message; may be null if unknown +//@code The gift code +messagePremiumGiftCode creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool month_count:int32 sticker:sticker code:string = MessageContent; + +//@description A Telegram Premium giveaway was created for the chat +messagePremiumGiveawayCreated = MessageContent; + +//@description A Telegram Premium giveaway +//@parameters Giveaway parameters +//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@sticker A sticker to be shown in the message; may be null if unknown +messagePremiumGiveaway parameters:premiumGiveawayParameters winner_count:int32 month_count:int32 sticker:sticker = MessageContent; + //@description A contact has registered with Telegram messageContactRegistered = MessageContent; @@ -2723,13 +2881,8 @@ messageUserShared user_id:int53 button_id:int32 = MessageContent; //@description The current user shared a chat, which was requested by the bot @chat_id Identifier of the shared chat @button_id Identifier of the keyboard button with the request messageChatShared chat_id:int53 button_id:int32 = MessageContent; -//@description The current user has connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website -messageWebsiteConnected domain_name:string = MessageContent; - -//@description The user allowed the bot to send messages -//@web_app Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu -//@by_request True, if user allowed the bot to send messages by an explicit call to allowBotToSendMessages -messageBotWriteAccessAllowed web_app:webApp by_request:Bool = MessageContent; +//@description The user allowed the bot to send messages @reason The reason why the bot was allowed to write messages +messageBotWriteAccessAllowed reason:BotWriteAccessAllowReason = MessageContent; //@description Data from a Web App has been sent to a bot @button_text Text of the keyboardButtonTypeWebApp button, which opened the Web App messageWebAppDataSent button_text:string = MessageContent; @@ -2800,6 +2953,9 @@ textEntityTypePre = TextEntityType; //@description Text that must be formatted as if inside pre, and code HTML tags @language Programming language of the code; as defined by the sender textEntityTypePreCode language:string = TextEntityType; +//@description Text that must be formatted as if inside a blockquote HTML tag +textEntityTypeBlockQuote = TextEntityType; + //@description A text description shown instead of a raw URL @url HTTP or tg:// URL to be opened when the link is clicked textEntityTypeTextUrl url:string = TextEntityType; @@ -2809,7 +2965,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 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 web page preview of the current message, or in the same places in the replied message textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; @@ -2845,9 +3001,10 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@update_order_of_installed_sticker_sets Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum //@scheduling_state Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled //@sending_id Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates -messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 = MessageSendOptions; +//@only_preview Pass true to get a fake message instead of actually sending them +messageSendOptions disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, and messages with messageInvoice or messagePremiumGiveaway content can't be copied //@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local //@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false //@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false @@ -2857,10 +3014,10 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText //@class InputMessageContent @description The content of a message to send //@description A text message -//@text Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually -//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled +//@text Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually +//@link_preview_options Options to be used for generation of a link preview; pass null to use default link preview options //@clear_draft True, if a chat message draft must be deleted -inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; +inputMessageText text:formattedText link_preview_options:linkPreviewOptions clear_draft:Bool = InputMessageContent; //@description An animation message (GIF-style). //@animation Animation file to be sent @@ -2987,7 +3144,7 @@ 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 +//@message_id Identifier of the message to forward. A message can be forwarded only if message.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; @@ -3133,10 +3290,11 @@ emojis emojis:vector = Emojis; //@is_official True, if the sticker set is official //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set @@ -3149,10 +3307,11 @@ stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outli //@is_official True, if the sticker set is official //@sticker_format Format of the stickers in the set //@sticker_type Type of the stickers in the set +//@needs_repainting True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType needs_repainting:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets stickerSets total_count:int32 sets:vector = StickerSets; @@ -3202,7 +3361,7 @@ storyViewers total_count:int32 total_reaction_count:int32 viewers:vector = StoryInteractionInfo; +storyInteractionInfo view_count:int32 forward_count:int32 reaction_count:int32 recent_viewer_user_ids:vector = StoryInteractionInfo; //@description Represents a story //@id Unique story identifier among stories of the given sender @@ -3307,8 +3480,11 @@ storyInteractionInfo view_count:int32 reaction_count:int32 recent_viewer_user_id //@is_edited True, if the story was edited //@is_pinned True, if the story is saved in the sender's profile and will be available there after expiration //@is_visible_only_for_self True, if the story is visible only for the current user +//@can_be_deleted True, if the story can be deleted +//@can_be_edited True, if the story can be edited //@can_be_forwarded True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden //@can_be_replied True, if the story can be replied in the chat with the story sender +//@can_toggle_is_pinned True, if the story's is_pinned value can be changed //@can_get_viewers True, if users viewed the story can be received through getStoryViewers //@has_expired_viewers True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago //@interaction_info Information about interactions with the story; may be null if the story isn't owned or there were no interactions @@ -3317,7 +3493,7 @@ storyInteractionInfo view_count:int32 reaction_count:int32 recent_viewer_user_id //@content Content of the story //@areas Clickable areas to be shown on the story content //@caption Caption of the story -story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_forwarded:Bool can_be_replied:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; +story id:int32 sender_chat_id:int53 date:int32 is_being_sent:Bool is_being_edited:Bool is_edited:Bool is_pinned:Bool is_visible_only_for_self:Bool can_be_deleted:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_replied:Bool can_toggle_is_pinned:Bool can_get_viewers:Bool has_expired_viewers:Bool interaction_info:storyInteractionInfo chosen_reaction_type:ReactionType privacy_settings:StoryPrivacySettings content:StoryContent areas:vector caption:formattedText = Story; //@description Represents a list of stories @total_count Approximate total number of stories found @stories The list of stories stories total_count:int32 stories:vector = Stories; @@ -3337,6 +3513,68 @@ storyInfo story_id:int32 date:int32 is_for_close_friends:Bool = StoryInfo; chatActiveStories chat_id:int53 list:StoryList order:int53 max_read_story_id:int32 stories:vector = ChatActiveStories; +//@class ChatBoostSource @description Describes source of a chat boost + +//@description The chat created a Telegram Premium gift code for a user +//@user_id Identifier of a user, for which the gift code was created +//@gift_code The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed +chatBoostSourceGiftCode user_id:int53 gift_code:string = ChatBoostSource; + +//@description The chat created a Telegram Premium giveaway +//@user_id Identifier of a user that won in the giveaway; 0 if none +//@gift_code The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise +//@giveaway_message_id Identifier of the corresponding giveaway message; can be an identifier of a deleted message +//@is_unclaimed True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, because there were not enough participants +chatBoostSourceGiveaway user_id:int53 gift_code:string giveaway_message_id:int53 is_unclaimed:Bool = ChatBoostSource; + +//@description A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat +//@user_id Identifier of the user +chatBoostSourcePremium user_id:int53 = ChatBoostSource; + + +//@description Describes a prepaid Telegram Premium giveaway +//@id Unique identifier of the prepaid giveaway +//@winner_count Number of users which will receive Telegram Premium subscription gift codes +//@month_count Number of month the Telegram Premium subscription will be active after code activation +//@payment_date Point in time (Unix timestamp) when the giveaway was paid +prepaidPremiumGiveaway id:int64 winner_count:int32 month_count:int32 payment_date:int32 = PrepaidPremiumGiveaway; + +//@description Describes current boost status of a chat +//@boost_url An HTTP URL, which can be used to boost the chat +//@applied_slot_ids Identifiers of boost slots of the current user applied to the chat +//@level Current boost level of the chat +//@gift_code_boost_count The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn't an administrator in the chat +//@boost_count The number of boosts received by the chat +//@current_level_boost_count The number of boosts added to reach the current level +//@next_level_boost_count The number of boosts needed to reach the next level; 0 if the next level isn't available +//@premium_member_count Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@premium_member_percentage A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat +//@prepaid_giveaways The list of prepaid giveaways available for the chat; only for chat administrators +chatBoostStatus boost_url:string applied_slot_ids:vector level:int32 gift_code_boost_count:int32 boost_count:int32 current_level_boost_count:int32 next_level_boost_count:int32 premium_member_count:int32 premium_member_percentage:double prepaid_giveaways:vector = ChatBoostStatus; + +//@description Describes a boost applied to a chat +//@id Unique identifier of the boost +//@count The number of identical boosts applied +//@source Source of the boost +//@start_date Point in time (Unix timestamp) when the chat was boosted +//@expiration_date Point in time (Unix timestamp) when the boost will expire +chatBoost id:string count:int32 source:ChatBoostSource start_date:int32 expiration_date:int32 = ChatBoost; + +//@description Contains a list of boosts applied to a chat @total_count Total number of boosts applied to the chat @boosts List of boosts @next_offset The offset for the next request. If empty, there are no more results +foundChatBoosts total_count:int32 boosts:vector next_offset:string = FoundChatBoosts; + +//@description Describes a slot for chat boost +//@slot_id Unique identifier of the slot +//@currently_boosted_chat_id Identifier of the currently boosted chat; 0 if none +//@start_date Point in time (Unix timestamp) when the chat was boosted; 0 if none +//@expiration_date Point in time (Unix timestamp) when the boost will expire +//@cooldown_until_date Point in time (Unix timestamp) after which the boost can be used for another chat +chatBoostSlot slot_id:int32 currently_boosted_chat_id:int53 start_date:int32 expiration_date:int32 cooldown_until_date:int32 = ChatBoostSlot; + +//@description Contains a list of chat boost slots @slots List of boost slots +chatBoostSlots slots:vector = ChatBoostSlots; + + //@class CallDiscardReason @description Describes the reason why a call was discarded //@description The call wasn't discarded, or the reason is unknown @@ -3414,7 +3652,7 @@ callStateReady protocol:callProtocol servers:vector config:string en callStateHangingUp = CallState; //@description The call has ended successfully -//@reason The reason, why the call has ended +//@reason The reason why the call has ended //@need_rating True, if the call rating must be sent to the server //@need_debug_information True, if the call debug information must be sent to the server //@need_log True, if the call log must be sent to the server @@ -3565,8 +3803,12 @@ firebaseAuthenticationSettingsIos device_token:string is_app_sandbox:Bool = Fire phoneNumberAuthenticationSettings allow_flash_call:Bool allow_missed_call:Bool is_current_phone_number:Bool allow_sms_retriever_api:Bool firebase_authentication_settings:FirebaseAuthenticationSettings authentication_tokens:vector = PhoneNumberAuthenticationSettings; -//@description Represents a reaction applied to a message @type Type of the reaction @sender_id Identifier of the chat member, applied the reaction @date Point in time (Unix timestamp) when the reaction was added -addedReaction type:ReactionType sender_id:MessageSender date:int32 = AddedReaction; +//@description Represents a reaction applied to a message +//@type Type of the reaction +//@sender_id Identifier of the chat member, applied the reaction +//@is_outgoing True, if the reaction was added by the current user +//@date Point in time (Unix timestamp) when the reaction was added +addedReaction type:ReactionType sender_id:MessageSender is_outgoing:Bool date:int32 = AddedReaction; //@description Represents a list of reactions added to a message @total_count The total number of found reactions @reactions The list of added reactions @next_offset The offset for the next request. If empty, there are no more results addedReactions total_count:int32 reactions:vector next_offset:string = AddedReactions; @@ -3641,7 +3883,6 @@ attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotCol //@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots //@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats //@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats -//@supports_settings True, if the bot supports "settings_button_pressed" event //@request_write_access True, if the user must be asked for the permission to send messages to the bot //@is_added True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed //@show_in_attachment_menu True, if the bot must be shown in the attachment menu @@ -3659,12 +3900,27 @@ attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotCol //@macos_side_menu_icon Icon for the bot in PNG format for the official macOS app side menu; may be null //@icon_color Color to highlight selected icon of the bot if appropriate; may be null //@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null -attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; +attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot; //@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known sentWebAppMessage inline_message_id:string = SentWebAppMessage; +//@class BotWriteAccessAllowReason @description Describes a reason why a bot was allowed to write messages to the current user + +//@description The user connected a website by logging in using Telegram Login Widget on it @domain_name Domain name of the connected website +botWriteAccessAllowReasonConnectedWebsite domain_name:string = BotWriteAccessAllowReason; + +//@description The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu +botWriteAccessAllowReasonAddedToAttachmentMenu = BotWriteAccessAllowReason; + +//@description The user launched a Web App using getWebAppLinkUrl @web_app Information about the Web App +botWriteAccessAllowReasonLaunchedWebApp web_app:webApp = BotWriteAccessAllowReason; + +//@description The user accepted bot's request to send messages with allowBotToSendMessages +botWriteAccessAllowReasonAcceptedRequest = BotWriteAccessAllowReason; + + //@description Contains an HTTP URL @url The URL httpUrl url:string = HttpUrl; @@ -4010,6 +4266,12 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi //@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames chatEventActiveUsernamesChanged old_usernames:vector new_usernames:vector = ChatEventAction; +//@description The chat accent color was changed @old_accent_color_id Previous identifier of chat accent color @new_accent_color_id New identifier of chat accent color +chatEventAccentColorChanged old_accent_color_id:int32 new_accent_color_id:int32 = ChatEventAction; + +//@description The chat's custom emoji for reply background was changed @old_background_custom_emoji_id Previous identifier of the custom emoji; 0 if none @new_background_custom_emoji_id New identifier of the custom emoji; 0 if none +chatEventBackgroundCustomEmojiChanged old_background_custom_emoji_id:int64 new_background_custom_emoji_id:int64 = ChatEventAction; + //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; @@ -4191,6 +4453,9 @@ premiumLimitTypeMonthlySentStoryCount = PremiumLimitType; //@description The maximum length of captions of sent stories premiumLimitTypeStoryCaptionLength = PremiumLimitType; +//@description The maximum number of suggested reaction areas on a story +premiumLimitTypeStorySuggestedReactionAreaCount = PremiumLimitType; + //@class PremiumFeature @description Describes a feature available to Premium users @@ -4242,10 +4507,16 @@ premiumFeatureRealTimeChatTranslation = PremiumFeature; //@description Allowed to use many additional features for stories premiumFeatureUpgradedStories = PremiumFeature; +//@description The ability to boost chats +premiumFeatureChatBoost = PremiumFeature; + +//@description The ability to choose accent color +premiumFeatureAccentColor = PremiumFeature; + //@class PremiumStoryFeature @description Describes a story feature available to Premium users -//@description User stories are displayed before stories of non-premium contacts +//@description User stories are displayed before stories of non-premium contacts and channels premiumStoryFeaturePriorityOrder = PremiumStoryFeature; //@description The ability to hide the fact that the user viewed other's stories @@ -4304,12 +4575,44 @@ premiumState state:formattedText payment_options:vector = StorePaymentPurpose; + +//@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +storePaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency:string amount:int53 = StorePaymentPurpose; + + +//@class TelegramPaymentPurpose @description Describes a purpose of a payment toward Telegram + +//@description The user creating Telegram Premium gift codes for other users +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@user_ids Identifiers of the users which can activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiftCodes boosted_chat_id:int53 currency:string amount:int53 user_ids:vector month_count:int32 = TelegramPaymentPurpose; + +//@description The user creating a Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@parameters Giveaway parameters +//@currency ISO 4217 currency code of the payment currency +//@amount Paid amount, in the smallest units of the currency +//@winner_count Number of users which will be able to activate the gift codes +//@month_count Number of month the Telegram Premium subscription will be active for the users +telegramPaymentPurposePremiumGiveaway parameters:premiumGiveawayParameters currency:string amount:int53 winner_count:int32 month_count:int32 = TelegramPaymentPurpose; + //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org @@ -4423,7 +4726,7 @@ chatTheme name:string light_settings:themeSettings dark_settings:themeSettings = hashtags hashtags:vector = Hashtags; -//@class CanSendStoryResult @description Represents result of checking whether the current user can send a story +//@class CanSendStoryResult @description Represents result of checking whether the current user can send a story in the specific chat //@description A story can be sent canSendStoryResultOk = CanSendStoryResult; @@ -4431,6 +4734,9 @@ canSendStoryResultOk = CanSendStoryResult; //@description The user must subscribe to Telegram Premium to be able to post stories canSendStoryResultPremiumNeeded = CanSendStoryResult; +//@description The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat +canSendStoryResultBoostNeeded = CanSendStoryResult; + //@description The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire canSendStoryResultActiveStoryLimitExceeded = CanSendStoryResult; @@ -4558,6 +4864,15 @@ pushMessageContentPhoto photo:photo caption:string is_secret:Bool is_pinned:Bool //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentPoll question:string is_regular:Bool is_pinned:Bool = PushMessageContent; +//@description A message with a Telegram Premium gift code created for the user @month_count Number of month the Telegram Premium subscription will be active after code activation +pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent; + +//@description A message with a Telegram Premium giveaway +//@winner_count Number of users which will receive Telegram Premium subscription gift codes; 0 for pinned message +//@month_count Number of month the Telegram Premium subscription will be active after code activation; 0 for pinned message +//@is_pinned True, if the message is a pinned message with the specified content +pushMessageContentPremiumGiveaway winner_count:int32 month_count:int32 is_pinned:Bool = PushMessageContent; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken = PushMessageContent; @@ -4649,7 +4964,7 @@ notificationTypeNewSecretChat = NotificationType; notificationTypeNewCall call_id:int32 = NotificationType; //@description New message was received through a push notification -//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to reply +//@message_id The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat //@sender_id Identifier of the sender of the message. Corresponding user or chat may be inaccessible //@sender_name Name of the sender //@is_outgoing True, if the message is outgoing @@ -5026,6 +5341,12 @@ internalLinkTypeBotStartInGroup bot_username:string start_parameter:string admin //@description The link is a link to the change phone number section of the app internalLinkTypeChangePhoneNumber = InternalLinkType; +//@description The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. +//-If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. +//-If the user wants to boost the chat and the chat can be boosted, then call boostChat +//@url URL to be passed to getChatBoostLinkInfo +internalLinkTypeChatBoost url:string = InternalLinkType; + //@description The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link @invite_link Internal representation of the invite link internalLinkTypeChatFolderInvite invite_link:string = InternalLinkType; @@ -5083,6 +5404,10 @@ internalLinkTypePhoneNumberConfirmation hash:string phone_number:string = Intern //@description The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link @referrer Referrer specified in the link internalLinkTypePremiumFeatures referrer:string = InternalLinkType; +//@description The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode +//@code The Telegram Premium gift code +internalLinkTypePremiumGiftCode code:string = InternalLinkType; + //@description The link is a link to the privacy and security section of the app settings internalLinkTypePrivacyAndSecuritySettings = InternalLinkType; @@ -5150,7 +5475,7 @@ internalLinkTypeVideoChat chat_username:string invite_hash:string is_live_stream //@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 //-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 +//-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 @@ -5165,11 +5490,20 @@ 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 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 web page 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; +//@description Contains an HTTPS link to boost a chat @link The link @is_public True, if the link will work for non-members of the chat +chatBoostLink link:string is_public:Bool = ChatBoostLink; + +//@description Contains information about a link to boost a chat +//@is_public True, if the link will work for non-members of the chat +//@chat_id Identifier of the chat to which the link points; 0 if the chat isn't found +chatBoostLinkInfo is_public:Bool chat_id:int53 = ChatBoostLinkInfo; + + //@class BlockList @description Describes a type of a block list //@description The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions @@ -5408,6 +5742,9 @@ topChatCategoryCalls = TopChatCategory; topChatCategoryForwardChats = TopChatCategory; +//@description Contains 0-based match position @position The position of the match +foundPosition position:int32 = FoundPosition; + //@description Contains 0-based positions of matched objects @total_count Total number of matched objects @positions The positions of the matched objects foundPositions total_count:int32 positions:vector = FoundPositions; @@ -5596,7 +5933,7 @@ chatStatisticsSupergroup period:dateRange member_count:statisticalValue message_ //@member_count Number of members in the chat //@mean_view_count Mean number of times the recently sent messages was viewed //@mean_share_count Mean number of times the recently sent messages was shared -//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat +//@enabled_notifications_percentage A percentage of users with enabled notifications for the chat; 0-100 //@member_count_graph A graph containing number of members in the chat //@join_graph A graph containing number of members joined and left the chat //@mute_graph A graph containing number of members muted and unmuted the chat @@ -5671,9 +6008,8 @@ updateMessageSendSucceeded message:message old_message_id:int53 = Update; //@description A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update //@message The failed to send message //@old_message_id The previous temporary message identifier -//@error_code An error code -//@error_message Error message -updateMessageSendFailed message:message old_message_id:int53 error_code:int32 error_message:string = Update; +//@error The cause of the message sending failure +updateMessageSendFailed message:message old_message_id:int53 error:error = Update; //@description The message content has changed @chat_id Chat identifier @message_id Message identifier @new_content New message content updateMessageContent chat_id:int53 message_id:int53 new_content:MessageContent = Update; @@ -5718,12 +6054,18 @@ updateChatTitle chat_id:int53 title:string = Update; //@description A chat photo was changed @chat_id Chat identifier @photo The new chat photo; may be null updateChatPhoto chat_id:int53 photo:chatPhotoInfo = Update; +//@description A chat accent color has changed @chat_id Chat identifier @accent_color_id The new chat accent color identifier +updateChatAccentColor chat_id:int53 accent_color_id:int32 = Update; + +//@description A chat's custom emoji for reply background has changed @chat_id Chat identifier @background_custom_emoji_id The new tdentifier of a custom emoji to be shown on the reply header background +updateChatBackgroundCustomEmoji chat_id:int53 background_custom_emoji_id:int64 = Update; + //@description Chat permissions was changed @chat_id Chat identifier @permissions The new chat permissions updateChatPermissions chat_id:int53 permissions:chatPermissions = Update; -//@description The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case +//@description The last message of a chat was changed //@chat_id Chat identifier -//@last_message The new last message in the chat; may be null +//@last_message The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update //@positions The new chat positions in the chat lists updateChatLastMessage chat_id:int53 last_message:message positions:vector = Update; @@ -5955,10 +6297,9 @@ updateStorySendSucceeded story:story old_story_id:int32 = Update; //@description A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update //@story The failed to send story -//@error The cause of the failure; may be null if unknown -//@error_code An error code -//@error_message Error message -updateStorySendFailed story:story error:CanSendStoryResult error_code:int32 error_message:string = Update; +//@error The cause of the story sending failure +//@error_type Type of the error; may be null if unknown +updateStorySendFailed story:story error:error error_type:CanSendStoryResult = Update; //@description The list of active stories posted by a specific chat has changed //@active_stories The new list of active stories @@ -6002,6 +6343,12 @@ updateSelectedBackground for_dark_theme:Bool background:background = Update; //@description The list of available chat themes has changed @chat_themes The new list of chat themes updateChatThemes chat_themes:vector = Update; +//@description The list of supported accent colors has changed +//@colors Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported +//-and aren't included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme +//@available_accent_color_ids The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specififed order +updateAccentColors colors:vector available_accent_color_ids:vector = Update; + //@description Some language pack strings have been updated @localization_target Localization target to which the language pack belongs @language_pack_id Identifier of the updated language pack @strings List of changed language pack strings; empty if all strings have changed updateLanguagePackStrings localization_target:string language_pack_id:string strings:vector = Update; @@ -6133,6 +6480,11 @@ updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatIn //@invite_link The invite link, which was used to send join request; may be null updateNewChatJoinRequest chat_id:int53 request:chatJoinRequest user_chat_id:int53 invite_link:chatInviteLink = Update; +//@description A chat boost has changed; for bots only +//@chat_id Chat identifier +//@boost New information about the boost +updateChatBoost chat_id:int53 boost:chatBoost = Update; + //@description Contains a list of updates @updates List of updates updates updates:vector = Updates; @@ -6604,13 +6956,6 @@ getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilte //@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 getChatScheduledMessages chat_id:int53 = Messages; -//@description Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages 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 -//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; - //@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat getChatSponsoredMessages chat_id:int53 = SponsoredMessages; @@ -6630,7 +6975,7 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = //@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 //@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 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 web page 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; @@ -6682,20 +7027,19 @@ setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; //@description Sends a message. Returns the sent message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@reply_markup Markup for replying to the message; pass null if none; for bots only //@input_message_content The content of the message to be sent -sendMessage chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; +sendMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions reply_markup:ReplyMarkup input_message_content:InputMessageContent = Message; //@description Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the messages will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the messages; pass null to use default options //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album -//@only_preview Pass true to get fake messages instead of actually sending them -sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions input_message_contents:vector only_preview:Bool = Messages; +sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions input_message_contents:vector = Messages; //@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message //@bot_user_id Identifier of the bot @@ -6706,29 +7050,29 @@ sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message; //@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message //@chat_id Target chat //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@options Options to be used to send the message; pass null to use default options //@query_id Identifier of the inline query //@result_id Identifier of the inline query result //@hide_via_bot Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username") -sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:MessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; +sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to:InputMessageReplyTo options:messageSendOptions query_id:int64 result_id:string hide_via_bot:Bool = Message; //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages //@message_thread_id If not 0, a 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 +//@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 //@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 -//@only_preview Pass true to get fake messages instead of actually forwarding them -forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; +forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message //@chat_id Identifier of the chat to send messages //@message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order -resendMessages chat_id:int53 message_ids:vector = Messages; +//@quote New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false +resendMessages chat_id:int53 message_ids:vector quote:formattedText = Messages; //@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier sendChatScreenshotTakenNotification chat_id:int53 = Ok; @@ -6736,10 +7080,10 @@ sendChatScreenshotTakenNotification chat_id:int53 = Ok; //@description Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message //@chat_id Target chat //@sender_id Identifier of the sender of the message -//@reply_to Identifier of the replied message or story; pass null if none +//@reply_to Information about the message or story to be replied; pass null if none //@disable_notification Pass true to disable notification for the message //@input_message_content The content of the message to be added -addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:MessageReplyTo disable_notification:Bool input_message_content:InputMessageContent = Message; +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 deleteMessages chat_id:int53 message_ids:vector revoke:Bool = Ok; @@ -6935,10 +7279,16 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy setDefaultReactionType reaction_type:ReactionType = Ok; +//@description Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if the quote is not found. Can be called synchronously +//@text Text in which to search for the quote +//@quote Quote to search for +//@quote_position Approximate quote position in UTF-16 code units +searchQuote text:formattedText quote:formattedText quote_position:int32 = FoundPosition; + //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entities getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously @@ -6988,7 +7338,7 @@ setPollAnswer chat_id:int53 message_id:int53 option_ids: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 set +//@description Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set //@chat_id Identifier of the chat to which the poll belongs //@message_id Identifier of the message containing the poll //@reply_markup The new message reply markup; pass null if none; for bots only @@ -7087,8 +7437,8 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, a message thread identifier in which the message will be sent -//@reply_to Identifier of the replied message or story for the message sent by the Web App; pass null if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:MessageReplyTo = WebAppInfo; +//@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; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -7231,7 +7581,7 @@ createNewBasicGroupChat user_ids:vector title:string message_auto_delete_ //@param_description Chat description; 0-255 characters //@location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat //@message_auto_delete_time Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically -//@for_import Pass true to create a supergroup for importing messages using importMessage +//@for_import Pass true to create a supergroup for importing messages using importMessages createNewSupergroupChat title:string is_forum:Bool is_channel:Bool description:string location:chatLocation message_auto_delete_time:int32 for_import:Bool = Chat; //@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user @@ -7329,6 +7679,12 @@ setChatTitle chat_id:int53 title:string = Ok; //@photo New chat photo; pass null to delete the chat photo setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok; +//@description Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right +//@chat_id Chat identifier +//@accent_color_id Identifier of the accent color to use +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + //@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels //-Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram). //@chat_id Chat identifier @@ -7516,10 +7872,14 @@ readChatList chat_list:ChatList = Ok; //@only_local Pass true to get only locally available information without sending network requests getStory story_sender_chat_id:int53 story_id:int32 only_local:Bool = Story; -//@description Checks whether the current user can send a story -canSendStory = CanSendStoryResult; +//@description Returns 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 Sends a new story. Returns a temporary story +//@description Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats @chat_id Chat identifier +canSendStory chat_id:int53 = CanSendStoryResult; + +//@description Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story +//@chat_id Identifier of the chat that will post the story //@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 @@ -7527,23 +7887,32 @@ canSendStory = CanSendStoryResult; //@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 //@is_pinned Pass true to keep the story accessible after expiration //@protect_content Pass true if the content of the story must be protected from forwarding and screenshotting -sendStory content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; +sendStory chat_id:int53 content:InputStoryContent areas:inputStoryAreas caption:formattedText privacy_settings:StoryPrivacySettings active_period:int32 is_pinned:Bool protect_content:Bool = Story; -//@description Changes content and caption of a previously sent story +//@description Changes content and caption of a story. Can be called only if story.can_be_edited == true +//@story_sender_chat_id Identifier of the chat that posted the story //@story_id Identifier of the story to edit //@content New content of the story; pass null to keep the current content //@areas New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed //@caption New story caption; pass null to keep the current caption -editStory story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; +editStory story_sender_chat_id:int53 story_id:int32 content:InputStoryContent areas:inputStoryAreas caption:formattedText = Ok; -//@description Changes privacy settings of a previously sent story @story_id Identifier of the story @privacy_settings The new privacy settigs for the story -setStoryPrivacySettings story_id:int32 privacy_settings:StoryPrivacySettings = Ok; +//@description Changes privacy settings of a story. Can be called only if story.can_be_edited == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story +//@privacy_settings The new privacy settigs for the story +setStoryPrivacySettings story_sender_chat_id:int53 story_id:int32 privacy_settings:StoryPrivacySettings = Ok; -//@description Toggles whether a story is accessible after expiration @story_id Identifier of the story @is_pinned Pass true to make the story accessible after expiration; pass false to make it private -toggleStoryIsPinned story_id:int32 is_pinned:Bool = Ok; +//@description Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story +//@is_pinned Pass true to make the story accessible after expiration; pass false to make it private +toggleStoryIsPinned story_sender_chat_id:int53 story_id:int32 is_pinned:Bool = Ok; -//@description Deletes a previously sent story @story_id Identifier of the story to delete -deleteStory story_id:int32 = Ok; +//@description Deletes a previously sent story. Can be called only if story.can_be_deleted == true +//@story_sender_chat_id Identifier of the chat that posted the story +//@story_id Identifier of the story to delete +deleteStory story_sender_chat_id:int53 story_id:int32 = Ok; //@description Returns list of chats with non-default notification settings for stories getStoryNotificationSettingsExceptions = Chats; @@ -7567,12 +7936,13 @@ getChatActiveStories chat_id:int53 = ChatActiveStories; //-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit getChatPinnedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; -//@description Returns the list of all stories of the current user. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). -//-For optimal performance, the number of returned stories is chosen by TDLib +//@description Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats. +//-The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib +//@chat_id Chat identifier //@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story //@limit The maximum number of stories to be returned //-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit -getArchivedStories from_story_id:int32 limit:int32 = Stories; +getChatArchivedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories; //@description Informs TDLib that a story is opened and is being viewed by the user //@story_sender_chat_id The identifier of the sender of the opened story @@ -7594,7 +7964,7 @@ getStoryAvailableReactions row_size:int32 = AvailableReactions; //@update_recent_reactions Pass true if the reaction needs to be added to recent reactions setStoryReaction story_sender_chat_id:int53 story_id:int32 reaction_type:ReactionType update_recent_reactions:Bool = Ok; -//@description Returns viewers of a story. The method can be called if story.can_get_viewers == true +//@description Returns viewers of a story. The method can be called only for stories posted on behalf of the current user //@story_id Story identifier //@query Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers //@only_contacts Pass true to get only contacts; pass false to get all relevant viewers @@ -7615,6 +7985,34 @@ reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:s activateStoryStealthMode = Ok; +//@description Returns the list of available chat boost slots for the current user +getAvailableChatBoostSlots = ChatBoostSlots; + +//@description Returns the current boost status for a channel chat @chat_id Identifier of the channel chat +getChatBoostStatus chat_id:int53 = ChatBoostStatus; + +//@description Boosts a chat and returns the list of available chat boost slots for the current user after the boost @chat_id Identifier of the chat @slot_ids Identifiers of boost slots of the current user from which to apply boosts to the chat +boostChat chat_id:int53 slot_ids:vector = ChatBoostSlots; + +//@description Returns an HTTPS link to boost the specified channel chat @chat_id Identifier of the chat +getChatBoostLink chat_id:int53 = ChatBoostLink; + +//@description Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost @url The link to boost a chat +getChatBoostLinkInfo url:string = ChatBoostLinkInfo; + +//@description Returns list of boosts applied to a chat; requires administrator rights in the channel chat +//@chat_id Identifier of the chat +//@only_gift_codes Pass true to receive only boosts received from gift codes and giveaways created by the chat +//@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 boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit +getChatBoosts chat_id:int53 only_gift_codes:Bool offset:string limit:int32 = FoundChatBoosts; + +//@description Returns list of boosts applied to a chat by a given user; requires administrator rights in the channel chat; for bots only +//@chat_id Identifier of the chat +//@user_id Identifier of the user +getUserChatBoosts chat_id:int53 user_id:int53 = FoundChatBoosts; + + //@description Returns information about a bot that can be added to attachment or side menu @bot_user_id Bot's user identifier getAttachmentMenuBot bot_user_id:int53 = AttachmentMenuBot; @@ -7912,7 +8310,7 @@ setGroupCallTitle group_call_id:int32 title:string = Ok; //@mute_new_participants New value of the mute_new_participants setting toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok; -//@description Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats +//@description Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats //@group_call_id Group call identifier //@user_ids User identifiers. At most 10 users can be invited simultaneously inviteGroupCallParticipants group_call_id:int32 user_ids:vector = Ok; @@ -8174,6 +8572,9 @@ getDefaultChatPhotoCustomEmojiStickers = Stickers; //@description Returns default list of custom emoji stickers for placing on a profile photo getDefaultProfilePhotoCustomEmojiStickers = Stickers; +//@description Returns default list of custom emoji stickers for reply background +getDefaultBackgroundCustomEmojiStickers = Stickers; + //@description Returns saved animations getSavedAnimations = Animations; @@ -8197,8 +8598,10 @@ searchHashtags prefix:string limit:int32 = Hashtags; removeRecentHashtag hashtag:string = Ok; -//@description Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview @text Message text with formatting -getWebPagePreview text:formattedText = WebPage; +//@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; //@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; @@ -8212,6 +8615,11 @@ setProfilePhoto photo:InputChatPhoto is_public:Bool = Ok; //@description Deletes a profile photo @profile_photo_id Identifier of the profile photo to delete deleteProfilePhoto profile_photo_id:int64 = Ok; +//@description Changes accent color and background custom emoji for the current user; for Telegram Premium users only +//@accent_color_id Identifier of the accent color to use +//@background_custom_emoji_id Identifier of a custom emoji to be shown on the reply header background; 0 if none +setAccentColor accent_color_id:int32 background_custom_emoji_id:int64 = Ok; + //@description Changes the first and last name of the current user @first_name The new value of the first name for the current user; 1-64 characters @last_name The new value of the optional last name for the current user; 0-64 characters setName first_name:string last_name:string = Ok; @@ -8456,7 +8864,7 @@ closeSecretChat secret_chat_id:int32 = Ok; getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector = ChatEvents; -//@description Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy +//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy //@input_invoice The invoice //@theme Preferred payment form theme; pass null to use the default theme getPaymentForm input_invoice:InputInvoice theme:themeParameters = PaymentForm; @@ -8637,6 +9045,13 @@ 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 getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics; +//@description Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages 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 +//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; + //@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise getStatisticalGraph chat_id:int53 token:string x:int53 = StatisticalGraph; @@ -8877,6 +9292,26 @@ clickPremiumSubscriptionButton = Ok; //@description Returns state of Telegram Premium subscription and promotion videos for Premium features getPremiumState = PremiumState; +//@description Returns available options for Telegram Premium gift code or giveaway creation +//@boosted_chat_id Identifier of the channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none +getPremiumGiftCodePaymentOptions boosted_chat_id:int53 = PremiumGiftCodePaymentOptions; + +//@description Return information about a Telegram Premium gift code @code The code to check +checkPremiumGiftCode code:string = PremiumGiftCodeInfo; + +//@description Applies a Telegram Premium gift code @code The code to apply +applyPremiumGiftCode code:string = Ok; + +//@description Launches a prepaid Telegram Premium giveaway for subscribers of channel chats; requires can_post_messages rights in the channels +//@giveaway_id Unique identifier of the prepaid giveaway +//@parameters Giveaway parameters +launchPrepaidPremiumGiveaway giveaway_id:int64 parameters:premiumGiveawayParameters = Ok; + +//@description Returns information about a Telegram Premium giveaway +//@chat_id Identifier of the channel chat which started the giveaway +//@message_id Identifier of the giveaway message in the chat +getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; + //@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose canPurchasePremium purpose:StorePaymentPurpose = Ok; diff --git a/example/bot/Bot.go b/example/bot/Bot.go index d4513ba..8880ff0 100644 --- a/example/bot/Bot.go +++ b/example/bot/Bot.go @@ -87,7 +87,7 @@ func main() { }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, }, diff --git a/example/command/ReplyCommand.go b/example/command/ReplyCommand.go index f88c2f5..5d898d6 100644 --- a/example/command/ReplyCommand.go +++ b/example/command/ReplyCommand.go @@ -98,7 +98,7 @@ func main() { }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, }, @@ -113,7 +113,7 @@ func main() { case "/repeat": m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, }, diff --git a/example/media/Photo_or_Album.go b/example/media/Photo_or_Album.go index e44c35d..fe153bf 100644 --- a/example/media/Photo_or_Album.go +++ b/example/media/Photo_or_Album.go @@ -98,7 +98,7 @@ func main() { }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, }, @@ -120,7 +120,7 @@ func main() { }) m, err := client.SendMessageAlbum(&tdlib.SendMessageAlbumRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, }, diff --git a/example/pending/PendingUpdate.go b/example/pending/PendingUpdate.go index 738f506..3256a6d 100644 --- a/example/pending/PendingUpdate.go +++ b/example/pending/PendingUpdate.go @@ -92,7 +92,7 @@ func main() { }) m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, - ReplyTo: &tdlib.MessageReplyToMessage{ + ReplyTo: &tdlib.InputMessageReplyToMessage{ ChatId: chatId, MessageId: msgId, },