From fefab36108c5eb73c6947b8c4166f353f6466e8c Mon Sep 17 00:00:00 2001 From: c0re100 Date: Wed, 19 Jun 2024 14:42:06 +0800 Subject: [PATCH] Update to TDLib 1.8.31 --- client/function.go | 485 +++++++++++++++++++-- client/type.go | 649 +++++++++++++++++++++++------ client/unmarshaler.go | 252 ++++++++--- data/td_api.tl | 261 +++++++++--- example/bot/Bot.go | 1 - example/command/ReplyCommand.go | 2 - example/event/CustomEventFilter.go | 28 +- example/media/Photo_or_Album.go | 2 - example/pending/PendingUpdate.go | 1 - 9 files changed, 1378 insertions(+), 303 deletions(-) diff --git a/client/function.go b/client/function.go index 7f73bb1..8ccd60b 100755 --- a/client/function.go +++ b/client/function.go @@ -2877,23 +2877,23 @@ func (client *Client) SearchOutgoingDocumentMessages(req *SearchOutgoingDocument return UnmarshalFoundMessages(result.Data) } -type SearchPublicHashtagMessagesRequest struct { - // Hashtag to search for - Hashtag string `json:"hashtag"` +type SearchPublicMessagesByTagRequest struct { + // Hashtag or cashtag to search for + Tag string `json:"tag"` // 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; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit Limit int32 `json:"limit"` } -// Searches for public channel posts with the given hashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -func (client *Client) SearchPublicHashtagMessages(req *SearchPublicHashtagMessagesRequest) (*FoundMessages, error) { +// Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchPublicMessagesByTag(req *SearchPublicMessagesByTagRequest) (*FoundMessages, error) { result, err := client.Send(Request{ meta: meta{ - Type: "searchPublicHashtagMessages", + Type: "searchPublicMessagesByTag", }, Data: map[string]interface{}{ - "hashtag": req.Hashtag, + "tag": req.Tag, "offset": req.Offset, "limit": req.Limit, }, @@ -2909,21 +2909,120 @@ func (client *Client) SearchPublicHashtagMessages(req *SearchPublicHashtagMessag return UnmarshalFoundMessages(result.Data) } -type GetSearchedForHashtagsRequest struct { - // Prefix of hashtags to return - Prefix string `json:"prefix"` - // The maximum number of hashtags to be returned +type SearchPublicStoriesByTagRequest struct { + // Hashtag or cashtag to search for + Tag string `json:"tag"` + // 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 stories to be returned; up to 100. 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 recently searched for hashtags by their prefix -func (client *Client) GetSearchedForHashtags(req *GetSearchedForHashtagsRequest) (*Hashtags, error) { +// Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchPublicStoriesByTag(req *SearchPublicStoriesByTagRequest) (*FoundStories, error) { result, err := client.Send(Request{ meta: meta{ - Type: "getSearchedForHashtags", + Type: "searchPublicStoriesByTag", }, Data: map[string]interface{}{ - "prefix": req.Prefix, + "tag": req.Tag, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundStories(result.Data) +} + +type SearchPublicStoriesByLocationRequest struct { + // Address of the location + Address *LocationAddress `json:"address"` + // 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 stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Searches for public stories by the given address location. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchPublicStoriesByLocation(req *SearchPublicStoriesByLocationRequest) (*FoundStories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchPublicStoriesByLocation", + }, + Data: map[string]interface{}{ + "address": req.Address, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundStories(result.Data) +} + +type SearchPublicStoriesByVenueRequest struct { + // Provider of the venue + VenueProvider string `json:"venue_provider"` + // Identifier of the venue in the provider database + VenueId string `json:"venue_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 stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit + Limit int32 `json:"limit"` +} + +// Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +func (client *Client) SearchPublicStoriesByVenue(req *SearchPublicStoriesByVenueRequest) (*FoundStories, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "searchPublicStoriesByVenue", + }, + Data: map[string]interface{}{ + "venue_provider": req.VenueProvider, + "venue_id": req.VenueId, + "offset": req.Offset, + "limit": req.Limit, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalFoundStories(result.Data) +} + +type GetSearchedForTagsRequest struct { + // Prefix of hashtags or cashtags to return + TagPrefix string `json:"tag_prefix"` + // The maximum number of items to be returned + Limit int32 `json:"limit"` +} + +// Returns recently searched for hashtags or cashtags by their prefix +func (client *Client) GetSearchedForTags(req *GetSearchedForTagsRequest) (*Hashtags, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getSearchedForTags", + }, + Data: map[string]interface{}{ + "tag_prefix": req.TagPrefix, "limit": req.Limit, }, }) @@ -2938,19 +3037,19 @@ func (client *Client) GetSearchedForHashtags(req *GetSearchedForHashtagsRequest) return UnmarshalHashtags(result.Data) } -type RemoveSearchedForHashtagRequest struct { - // Hashtag to delete - Hashtag string `json:"hashtag"` +type RemoveSearchedForTagRequest struct { + // Hashtag or cashtag to delete + Tag string `json:"tag"` } -// Removes a hashtag from the list of recently searched for hashtags -func (client *Client) RemoveSearchedForHashtag(req *RemoveSearchedForHashtagRequest) (*Ok, error) { +// Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags +func (client *Client) RemoveSearchedForTag(req *RemoveSearchedForTagRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "removeSearchedForHashtag", + Type: "removeSearchedForTag", }, Data: map[string]interface{}{ - "hashtag": req.Hashtag, + "tag": req.Tag, }, }) if err != nil { @@ -2964,13 +3063,20 @@ func (client *Client) RemoveSearchedForHashtag(req *RemoveSearchedForHashtagRequ return UnmarshalOk(result.Data) } -// Clears the list of recently searched for hashtags -func (client *Client) ClearSearchedForHashtags() (*Ok, error) { +type ClearSearchedForTagsRequest struct { + // Pass true to clear the list of recently searched for cashtags; otherwise, the list of recently searched for hashtags will be cleared + ClearCashtags bool `json:"clear_cashtags"` +} + +// Clears the list of recently searched for hashtags or cashtags +func (client *Client) ClearSearchedForTags(req *ClearSearchedForTagsRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ - Type: "clearSearchedForHashtags", + Type: "clearSearchedForTags", + }, + Data: map[string]interface{}{ + "clear_cashtags": req.ClearCashtags, }, - Data: map[string]interface{}{}, }) if err != nil { return nil, err @@ -4505,7 +4611,7 @@ func (client *Client) EditMessageSchedulingState(req *EditMessageSchedulingState type SetMessageFactCheckRequest struct { // The channel chat the message belongs to ChatId int64 `json:"chat_id"` - // Identifier of the message + // Identifier of the message. The message must be one of the following types: messageAnimation, messageAudio, messageDocument, messagePhoto, messageText, messageVideo MessageId int64 `json:"message_id"` // New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported Text *FormattedText `json:"text"` @@ -4625,6 +4731,240 @@ func (client *Client) SendBusinessMessageAlbum(req *SendBusinessMessageAlbumRequ return UnmarshalBusinessMessages(result.Data) } +type EditBusinessMessageTextRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New text content of the message. Must be of type inputMessageText + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Edits the text of a text or game message sent on behalf of a business account; for bots only +func (client *Client) EditBusinessMessageText(req *EditBusinessMessageTextRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessMessageText", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type EditBusinessMessageLiveLocationRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New location content of the message; pass null to stop sharing the live location + Location *Location `json:"location"` + // New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period + LivePeriod int32 `json:"live_period"` + // The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown + Heading int32 `json:"heading"` + // The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled + ProximityAlertRadius int32 `json:"proximity_alert_radius"` +} + +// Edits the content of a live location in a message sent on behalf of a business account; for bots only +func (client *Client) EditBusinessMessageLiveLocation(req *EditBusinessMessageLiveLocationRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessMessageLiveLocation", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + "location": req.Location, + "live_period": req.LivePeriod, + "heading": req.Heading, + "proximity_alert_radius": req.ProximityAlertRadius, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type EditBusinessMessageMediaRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none; for bots only + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo + InputMessageContent InputMessageContent `json:"input_message_content"` +} + +// Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on behalf of a business account; for bots only +func (client *Client) EditBusinessMessageMedia(req *EditBusinessMessageMediaRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessMessageMedia", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + "input_message_content": req.InputMessageContent, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type EditBusinessMessageCaptionRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` + // New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters + Caption *FormattedText `json:"caption"` + // Pass true to show the caption above the media; otherwise, caption will be shown below the media. Can be true only for animation, photo, and video messages + ShowCaptionAboveMedia bool `json:"show_caption_above_media"` +} + +// Edits the caption of a message sent on behalf of a business account; for bots only +func (client *Client) EditBusinessMessageCaption(req *EditBusinessMessageCaptionRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessMessageCaption", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + "caption": req.Caption, + "show_caption_above_media": req.ShowCaptionAboveMedia, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type EditBusinessMessageReplyMarkupRequest struct { + // Unique identifier of business connection on behalf of which the message was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` +} + +// Edits the reply markup of a message sent on behalf of a business account; for bots only +func (client *Client) EditBusinessMessageReplyMarkup(req *EditBusinessMessageReplyMarkupRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "editBusinessMessageReplyMarkup", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + +type StopBusinessPollRequest struct { + // Unique identifier of business connection on behalf of which the message with the poll was sent + BusinessConnectionId string `json:"business_connection_id"` + // The chat the message belongs to + ChatId int64 `json:"chat_id"` + // Identifier of the message containing the poll + MessageId int64 `json:"message_id"` + // The new message reply markup; pass null if none + ReplyMarkup ReplyMarkup `json:"reply_markup"` +} + +// Stops a poll sent on behalf of a business account; for bots only +func (client *Client) StopBusinessPoll(req *StopBusinessPollRequest) (*BusinessMessage, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "stopBusinessPoll", + }, + Data: map[string]interface{}{ + "business_connection_id": req.BusinessConnectionId, + "chat_id": req.ChatId, + "message_id": req.MessageId, + "reply_markup": req.ReplyMarkup, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalBusinessMessage(result.Data) +} + type CheckQuickReplyShortcutNameRequest struct { // The name of the shortcut; 1-32 characters Name string `json:"name"` @@ -4974,7 +5314,7 @@ func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) ( return UnmarshalOk(result.Data) } -// Returns the list of custom emojis, which can be used as forum topic icon by all users +// Returns the list of custom emoji, which can be used as forum topic icon by all users func (client *Client) GetForumTopicDefaultIcons() (*Stickers, error) { result, err := client.Send(Request{ meta: meta{ @@ -13891,7 +14231,7 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C type GetStickersRequest struct { // Type of the stickers to return StickerType StickerType `json:"sticker_type"` - // Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers + // Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers Query string `json:"query"` // The maximum number of stickers to be returned Limit int32 `json:"limit"` @@ -13961,7 +14301,7 @@ func (client *Client) GetAllStickerEmojis(req *GetAllStickerEmojisRequest) (*Emo type SearchStickersRequest struct { // Type of the stickers to return StickerType StickerType `json:"sticker_type"` - // Space-separated list of emoji to search for; must be non-empty + // Space-separated list of emojis to search for; must be non-empty Emojis string `json:"emojis"` // The maximum number of stickers to be returned; 0-100 Limit int32 `json:"limit"` @@ -14621,7 +14961,7 @@ type GetEmojiCategoriesRequest struct { Type EmojiCategoryType `json:"type"` } -// Returns available emojis categories +// Returns available emoji categories func (client *Client) GetEmojiCategories(req *GetEmojiCategoriesRequest) (*EmojiCategories, error) { result, err := client.Send(Request{ meta: meta{ @@ -18753,6 +19093,67 @@ func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactions return UnmarshalChatRevenueTransactions(result.Data) } +type GetStarRevenueStatisticsRequest struct { + // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true + OwnerId MessageSender `json:"owner_id"` + // Pass true if a dark theme is used by the application + IsDark bool `json:"is_dark"` +} + +// Returns detailed Telegram star revenue statistics +func (client *Client) GetStarRevenueStatistics(req *GetStarRevenueStatisticsRequest) (*StarRevenueStatistics, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStarRevenueStatistics", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "is_dark": req.IsDark, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalStarRevenueStatistics(result.Data) +} + +type GetStarWithdrawalUrlRequest struct { + // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true + OwnerId MessageSender `json:"owner_id"` + // The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") + StarCount int64 `json:"star_count"` + // The 2-step verification password of the current user + Password string `json:"password"` +} + +// Returns URL for Telegram star withdrawal +func (client *Client) GetStarWithdrawalUrl(req *GetStarWithdrawalUrlRequest) (*HttpUrl, error) { + result, err := client.Send(Request{ + meta: meta{ + Type: "getStarWithdrawalUrl", + }, + Data: map[string]interface{}{ + "owner_id": req.OwnerId, + "star_count": req.StarCount, + "password": req.Password, + }, + }) + if err != nil { + return nil, err + } + + if result.Type == "error" { + return nil, buildResponseError(result.Data) + } + + return UnmarshalHttpUrl(result.Data) +} + type GetChatStatisticsRequest struct { // Chat identifier ChatId int64 `json:"chat_id"` @@ -20116,7 +20517,7 @@ type SetStickerEmojisRequest struct { Emojis string `json:"emojis"` } -// Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user +// Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user func (client *Client) SetStickerEmojis(req *SetStickerEmojisRequest) (*Ok, error) { result, err := client.Send(Request{ meta: meta{ @@ -20566,21 +20967,27 @@ func (client *Client) GetStarPaymentOptions() (*StarPaymentOptions, error) { } type GetStarTransactionsRequest struct { - // Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results - Offset string `json:"offset"` + // Identifier of the owner of the Telegram stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true + OwnerId MessageSender `json:"owner_id"` // Direction of the transactions to receive; pass null to get all transactions Direction StarTransactionDirection `json:"direction"` + // Offset of the first transaction 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 transactions to return + Limit int32 `json:"limit"` } -// Returns the list of Telegram star transactions for the current user +// Returns the list of Telegram star transactions for the specified owner func (client *Client) GetStarTransactions(req *GetStarTransactionsRequest) (*StarTransactions, error) { result, err := client.Send(Request{ meta: meta{ Type: "getStarTransactions", }, Data: map[string]interface{}{ - "offset": req.Offset, + "owner_id": req.OwnerId, "direction": req.Direction, + "offset": req.Offset, + "limit": req.Limit, }, }) if err != nil { @@ -22289,6 +22696,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(result.Data) + case TypeUpdateStarRevenueStatus: + return UnmarshalUpdateStarRevenueStatus(result.Data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(result.Data) @@ -22337,6 +22747,9 @@ func (client *Client) TestUseUpdate() (Update, error) { case TypeUpdateNewInlineCallbackQuery: return UnmarshalUpdateNewInlineCallbackQuery(result.Data) + case TypeUpdateNewBusinessCallbackQuery: + return UnmarshalUpdateNewBusinessCallbackQuery(result.Data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(result.Data) diff --git a/client/type.go b/client/type.go index ea9fc14..76c7306 100755 --- a/client/type.go +++ b/client/type.go @@ -23,7 +23,7 @@ const ( ClassChatPhotoStickerType = "ChatPhotoStickerType" ClassInputChatPhoto = "InputChatPhoto" ClassStarTransactionDirection = "StarTransactionDirection" - ClassStarTransactionSource = "StarTransactionSource" + ClassStarTransactionPartner = "StarTransactionPartner" ClassPremiumGiveawayParticipantStatus = "PremiumGiveawayParticipantStatus" ClassPremiumGiveawayInfo = "PremiumGiveawayInfo" ClassChatMemberStatus = "ChatMemberStatus" @@ -150,7 +150,7 @@ const ( ClassStatisticalGraph = "StatisticalGraph" ClassChatStatisticsObjectType = "ChatStatisticsObjectType" ClassChatStatistics = "ChatStatistics" - ClassChatRevenueWithdrawalState = "ChatRevenueWithdrawalState" + ClassRevenueWithdrawalState = "RevenueWithdrawalState" ClassChatRevenueTransactionType = "ChatRevenueTransactionType" ClassVectorPathCommand = "VectorPathCommand" ClassBotCommandScope = "BotCommandScope" @@ -348,6 +348,7 @@ const ( ClassBankCardActionOpenUrl = "BankCardActionOpenUrl" ClassBankCardInfo = "BankCardInfo" ClassAddress = "Address" + ClassLocationAddress = "LocationAddress" ClassThemeParameters = "ThemeParameters" ClassLabeledPricePart = "LabeledPricePart" ClassInvoice = "Invoice" @@ -398,6 +399,7 @@ const ( ClassStoryInteractionInfo = "StoryInteractionInfo" ClassStory = "Story" ClassStories = "Stories" + ClassFoundStories = "FoundStories" ClassStoryFullId = "StoryFullId" ClassStoryInfo = "StoryInfo" ClassChatActiveStories = "ChatActiveStories" @@ -522,6 +524,8 @@ const ( ClassStoryStatistics = "StoryStatistics" ClassChatRevenueTransaction = "ChatRevenueTransaction" ClassChatRevenueTransactions = "ChatRevenueTransactions" + ClassStarRevenueStatus = "StarRevenueStatus" + ClassStarRevenueStatistics = "StarRevenueStatistics" ClassPoint = "Point" ClassUpdates = "Updates" ClassLogVerbosityLevel = "LogVerbosityLevel" @@ -679,12 +683,13 @@ const ( TypeStarPaymentOptions = "starPaymentOptions" TypeStarTransactionDirectionIncoming = "starTransactionDirectionIncoming" TypeStarTransactionDirectionOutgoing = "starTransactionDirectionOutgoing" - TypeStarTransactionSourceTelegram = "starTransactionSourceTelegram" - TypeStarTransactionSourceAppStore = "starTransactionSourceAppStore" - TypeStarTransactionSourceGooglePlay = "starTransactionSourceGooglePlay" - TypeStarTransactionSourceFragment = "starTransactionSourceFragment" - TypeStarTransactionSourceUser = "starTransactionSourceUser" - TypeStarTransactionSourceUnsupported = "starTransactionSourceUnsupported" + TypeStarTransactionPartnerTelegram = "starTransactionPartnerTelegram" + TypeStarTransactionPartnerAppStore = "starTransactionPartnerAppStore" + TypeStarTransactionPartnerGooglePlay = "starTransactionPartnerGooglePlay" + TypeStarTransactionPartnerFragment = "starTransactionPartnerFragment" + TypeStarTransactionPartnerUser = "starTransactionPartnerUser" + TypeStarTransactionPartnerChannel = "starTransactionPartnerChannel" + TypeStarTransactionPartnerUnsupported = "starTransactionPartnerUnsupported" TypeStarTransaction = "starTransaction" TypeStarTransactions = "starTransactions" TypePremiumGiveawayParticipantStatusEligible = "premiumGiveawayParticipantStatusEligible" @@ -786,6 +791,7 @@ const ( TypeMessageReplyToMessage = "messageReplyToMessage" TypeMessageReplyToStory = "messageReplyToStory" TypeInputMessageReplyToMessage = "inputMessageReplyToMessage" + TypeInputMessageReplyToExternalMessage = "inputMessageReplyToExternalMessage" TypeInputMessageReplyToStory = "inputMessageReplyToStory" TypeFactCheck = "factCheck" TypeMessage = "message" @@ -977,6 +983,7 @@ const ( TypeBankCardActionOpenUrl = "bankCardActionOpenUrl" TypeBankCardInfo = "bankCardInfo" TypeAddress = "address" + TypeLocationAddress = "locationAddress" TypeThemeParameters = "themeParameters" TypeLabeledPricePart = "labeledPricePart" TypeInvoice = "invoice" @@ -1255,12 +1262,14 @@ const ( TypeStoryAreaTypeVenue = "storyAreaTypeVenue" TypeStoryAreaTypeSuggestedReaction = "storyAreaTypeSuggestedReaction" TypeStoryAreaTypeMessage = "storyAreaTypeMessage" + TypeStoryAreaTypeLink = "storyAreaTypeLink" TypeStoryArea = "storyArea" TypeInputStoryAreaTypeLocation = "inputStoryAreaTypeLocation" TypeInputStoryAreaTypeFoundVenue = "inputStoryAreaTypeFoundVenue" TypeInputStoryAreaTypePreviousVenue = "inputStoryAreaTypePreviousVenue" TypeInputStoryAreaTypeSuggestedReaction = "inputStoryAreaTypeSuggestedReaction" TypeInputStoryAreaTypeMessage = "inputStoryAreaTypeMessage" + TypeInputStoryAreaTypeLink = "inputStoryAreaTypeLink" TypeInputStoryArea = "inputStoryArea" TypeInputStoryAreas = "inputStoryAreas" TypeStoryVideo = "storyVideo" @@ -1277,6 +1286,7 @@ const ( TypeStoryInteractionInfo = "storyInteractionInfo" TypeStory = "story" TypeStories = "stories" + TypeFoundStories = "foundStories" TypeStoryFullId = "storyFullId" TypeStoryInfo = "storyInfo" TypeChatActiveStories = "chatActiveStories" @@ -1874,14 +1884,16 @@ const ( TypeChatRevenueStatistics = "chatRevenueStatistics" TypeMessageStatistics = "messageStatistics" TypeStoryStatistics = "storyStatistics" - TypeChatRevenueWithdrawalStatePending = "chatRevenueWithdrawalStatePending" - TypeChatRevenueWithdrawalStateCompleted = "chatRevenueWithdrawalStateCompleted" - TypeChatRevenueWithdrawalStateFailed = "chatRevenueWithdrawalStateFailed" + TypeRevenueWithdrawalStatePending = "revenueWithdrawalStatePending" + TypeRevenueWithdrawalStateSucceeded = "revenueWithdrawalStateSucceeded" + TypeRevenueWithdrawalStateFailed = "revenueWithdrawalStateFailed" TypeChatRevenueTransactionTypeEarnings = "chatRevenueTransactionTypeEarnings" TypeChatRevenueTransactionTypeWithdrawal = "chatRevenueTransactionTypeWithdrawal" TypeChatRevenueTransactionTypeRefund = "chatRevenueTransactionTypeRefund" TypeChatRevenueTransaction = "chatRevenueTransaction" TypeChatRevenueTransactions = "chatRevenueTransactions" + TypeStarRevenueStatus = "starRevenueStatus" + TypeStarRevenueStatistics = "starRevenueStatistics" TypePoint = "point" TypeVectorPathCommandLine = "vectorPathCommandLine" TypeVectorPathCommandCubicBezierCurve = "vectorPathCommandCubicBezierCurve" @@ -2015,6 +2027,7 @@ const ( TypeUpdateSavedMessagesTags = "updateSavedMessagesTags" TypeUpdateOwnedStarCount = "updateOwnedStarCount" TypeUpdateChatRevenueAmount = "updateChatRevenueAmount" + TypeUpdateStarRevenueStatus = "updateStarRevenueStatus" TypeUpdateSpeechRecognitionTrial = "updateSpeechRecognitionTrial" TypeUpdateDiceEmojis = "updateDiceEmojis" TypeUpdateAnimatedEmojiMessageClicked = "updateAnimatedEmojiMessageClicked" @@ -2031,6 +2044,7 @@ const ( TypeUpdateNewChosenInlineResult = "updateNewChosenInlineResult" TypeUpdateNewCallbackQuery = "updateNewCallbackQuery" TypeUpdateNewInlineCallbackQuery = "updateNewInlineCallbackQuery" + TypeUpdateNewBusinessCallbackQuery = "updateNewBusinessCallbackQuery" TypeUpdateNewShippingQuery = "updateNewShippingQuery" TypeUpdateNewPreCheckoutQuery = "updateNewPreCheckoutQuery" TypeUpdateNewCustomEvent = "updateNewCustomEvent" @@ -2139,8 +2153,8 @@ type StarTransactionDirection interface { } // Describes source or recipient of a transaction with Telegram stars -type StarTransactionSource interface { - StarTransactionSourceType() string +type StarTransactionPartner interface { + StarTransactionPartnerType() string } // Contains information about status of a user in a Telegram Premium giveaway @@ -2773,9 +2787,9 @@ type ChatStatistics interface { ChatStatisticsType() string } -// Describes state of a chat revenue withdrawal -type ChatRevenueWithdrawalState interface { - ChatRevenueWithdrawalStateType() string +// Describes state of a revenue withdrawal +type RevenueWithdrawalState interface { + RevenueWithdrawalStateType() string } // Describes type of transaction for revenue earned from sponsored messages in a chat @@ -7186,7 +7200,7 @@ type StarPaymentOption struct { Currency string `json:"currency"` // The amount to pay, in the smallest units of the currency Amount int64 `json:"amount"` - // Number of stars that will be purchased + // Number of Telegram stars that will be purchased StarCount int64 `json:"star_count"` // Identifier of the store product associated with the option; may be empty if none StoreProductId string `json:"store_product_id"` @@ -7284,107 +7298,125 @@ func (*StarTransactionDirectionOutgoing) StarTransactionDirectionType() string { } // The transaction is a transaction with Telegram through a bot -type StarTransactionSourceTelegram struct{ +type StarTransactionPartnerTelegram struct{ meta } -func (entity *StarTransactionSourceTelegram) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerTelegram) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceTelegram + type stub StarTransactionPartnerTelegram return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceTelegram) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerTelegram) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceTelegram) GetType() string { - return TypeStarTransactionSourceTelegram +func (*StarTransactionPartnerTelegram) GetType() string { + return TypeStarTransactionPartnerTelegram } -func (*StarTransactionSourceTelegram) StarTransactionSourceType() string { - return TypeStarTransactionSourceTelegram +func (*StarTransactionPartnerTelegram) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerTelegram } // The transaction is a transaction with App Store -type StarTransactionSourceAppStore struct{ +type StarTransactionPartnerAppStore struct{ meta } -func (entity *StarTransactionSourceAppStore) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerAppStore) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceAppStore + type stub StarTransactionPartnerAppStore return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceAppStore) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerAppStore) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceAppStore) GetType() string { - return TypeStarTransactionSourceAppStore +func (*StarTransactionPartnerAppStore) GetType() string { + return TypeStarTransactionPartnerAppStore } -func (*StarTransactionSourceAppStore) StarTransactionSourceType() string { - return TypeStarTransactionSourceAppStore +func (*StarTransactionPartnerAppStore) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerAppStore } // The transaction is a transaction with Google Play -type StarTransactionSourceGooglePlay struct{ +type StarTransactionPartnerGooglePlay struct{ meta } -func (entity *StarTransactionSourceGooglePlay) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerGooglePlay) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceGooglePlay + type stub StarTransactionPartnerGooglePlay return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceGooglePlay) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerGooglePlay) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceGooglePlay) GetType() string { - return TypeStarTransactionSourceGooglePlay +func (*StarTransactionPartnerGooglePlay) GetType() string { + return TypeStarTransactionPartnerGooglePlay } -func (*StarTransactionSourceGooglePlay) StarTransactionSourceType() string { - return TypeStarTransactionSourceGooglePlay +func (*StarTransactionPartnerGooglePlay) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerGooglePlay } // The transaction is a transaction with Fragment -type StarTransactionSourceFragment struct{ +type StarTransactionPartnerFragment struct { meta + // State of the withdrawal; may be null for refunds from Fragment + WithdrawalState RevenueWithdrawalState `json:"withdrawal_state"` } -func (entity *StarTransactionSourceFragment) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerFragment) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceFragment + type stub StarTransactionPartnerFragment return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceFragment) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerFragment) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceFragment) GetType() string { - return TypeStarTransactionSourceFragment +func (*StarTransactionPartnerFragment) GetType() string { + return TypeStarTransactionPartnerFragment } -func (*StarTransactionSourceFragment) StarTransactionSourceType() string { - return TypeStarTransactionSourceFragment +func (*StarTransactionPartnerFragment) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerFragment +} + +func (starTransactionPartnerFragment *StarTransactionPartnerFragment) UnmarshalJSON(data []byte) error { + var tmp struct { + WithdrawalState json.RawMessage `json:"withdrawal_state"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + fieldWithdrawalState, _ := UnmarshalRevenueWithdrawalState(tmp.WithdrawalState) + starTransactionPartnerFragment.WithdrawalState = fieldWithdrawalState + + return nil } // The transaction is a transaction with another user -type StarTransactionSourceUser struct { +type StarTransactionPartnerUser struct { meta // Identifier of the user UserId int64 `json:"user_id"` @@ -7392,49 +7424,76 @@ type StarTransactionSourceUser struct { ProductInfo *ProductInfo `json:"product_info"` } -func (entity *StarTransactionSourceUser) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerUser) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceUser + type stub StarTransactionPartnerUser return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceUser) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerUser) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceUser) GetType() string { - return TypeStarTransactionSourceUser +func (*StarTransactionPartnerUser) GetType() string { + return TypeStarTransactionPartnerUser } -func (*StarTransactionSourceUser) StarTransactionSourceType() string { - return TypeStarTransactionSourceUser +func (*StarTransactionPartnerUser) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerUser } -// The transaction is a transaction with unknown source -type StarTransactionSourceUnsupported struct{ +// The transaction is a transaction with a channel chat +type StarTransactionPartnerChannel struct { + meta + // Identifier of the chat + ChatId int64 `json:"chat_id"` +} + +func (entity *StarTransactionPartnerChannel) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarTransactionPartnerChannel + + return json.Marshal((*stub)(entity)) +} + +func (*StarTransactionPartnerChannel) GetClass() string { + return ClassStarTransactionPartner +} + +func (*StarTransactionPartnerChannel) GetType() string { + return TypeStarTransactionPartnerChannel +} + +func (*StarTransactionPartnerChannel) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerChannel +} + +// The transaction is a transaction with unknown partner +type StarTransactionPartnerUnsupported struct{ meta } -func (entity *StarTransactionSourceUnsupported) MarshalJSON() ([]byte, error) { +func (entity *StarTransactionPartnerUnsupported) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub StarTransactionSourceUnsupported + type stub StarTransactionPartnerUnsupported return json.Marshal((*stub)(entity)) } -func (*StarTransactionSourceUnsupported) GetClass() string { - return ClassStarTransactionSource +func (*StarTransactionPartnerUnsupported) GetClass() string { + return ClassStarTransactionPartner } -func (*StarTransactionSourceUnsupported) GetType() string { - return TypeStarTransactionSourceUnsupported +func (*StarTransactionPartnerUnsupported) GetType() string { + return TypeStarTransactionPartnerUnsupported } -func (*StarTransactionSourceUnsupported) StarTransactionSourceType() string { - return TypeStarTransactionSourceUnsupported +func (*StarTransactionPartnerUnsupported) StarTransactionPartnerType() string { + return TypeStarTransactionPartnerUnsupported } // Represents a transaction changing the amount of owned Telegram stars @@ -7448,8 +7507,8 @@ type StarTransaction struct { IsRefund bool `json:"is_refund"` // Point in time (Unix timestamp) when the transaction was completed Date int32 `json:"date"` - // Source of the transaction, or its recipient for outgoing transactions - Source StarTransactionSource `json:"source"` + // Source of the incoming transaction, or its recipient for outgoing transactions + Partner StarTransactionPartner `json:"partner"` } func (entity *StarTransaction) MarshalJSON() ([]byte, error) { @@ -7474,7 +7533,7 @@ func (starTransaction *StarTransaction) UnmarshalJSON(data []byte) error { StarCount int64 `json:"star_count"` IsRefund bool `json:"is_refund"` Date int32 `json:"date"` - Source json.RawMessage `json:"source"` + Partner json.RawMessage `json:"partner"` } err := json.Unmarshal(data, &tmp) @@ -7487,8 +7546,8 @@ func (starTransaction *StarTransaction) UnmarshalJSON(data []byte) error { starTransaction.IsRefund = tmp.IsRefund starTransaction.Date = tmp.Date - fieldSource, _ := UnmarshalStarTransactionSource(tmp.Source) - starTransaction.Source = fieldSource + fieldPartner, _ := UnmarshalStarTransactionPartner(tmp.Partner) + starTransaction.Partner = fieldPartner return nil } @@ -8342,7 +8401,7 @@ func (*ChatAdministrators) GetType() string { // The user is the owner of the chat and has all the administrator privileges type ChatMemberStatusCreator struct { meta - // A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only + // A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only CustomTitle string `json:"custom_title"` // True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only IsAnonymous bool `json:"is_anonymous"` @@ -8373,7 +8432,7 @@ func (*ChatMemberStatusCreator) ChatMemberStatusType() string { // The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges type ChatMemberStatusAdministrator struct { meta - // A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only + // A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only CustomTitle string `json:"custom_title"` // True, if the current user can edit the administrator privileges for the called user CanBeEdited bool `json:"can_be_edited"` @@ -11020,12 +11079,10 @@ func (*MessageReplyToStory) MessageReplyToType() string { return TypeMessageReplyToStory } -// Describes a message to be replied +// Describes a message to be replied in the same chat and forum topic 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 or topic 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 + // The identifier of the message to be replied in the same chat and forum topic MessageId int64 `json:"message_id"` // Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats Quote *InputTextQuote `json:"quote"` @@ -11051,6 +11108,37 @@ func (*InputMessageReplyToMessage) InputMessageReplyToType() string { return TypeInputMessageReplyToMessage } +// Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats +type InputMessageReplyToExternalMessage struct { + meta + // The identifier of the chat to which the message to be replied belongs + ChatId int64 `json:"chat_id"` + // The identifier of the message to be replied in the specified chat. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat + MessageId int64 `json:"message_id"` + // Quote from the message to be replied; pass null if none + Quote *InputTextQuote `json:"quote"` +} + +func (entity *InputMessageReplyToExternalMessage) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputMessageReplyToExternalMessage + + return json.Marshal((*stub)(entity)) +} + +func (*InputMessageReplyToExternalMessage) GetClass() string { + return ClassInputMessageReplyTo +} + +func (*InputMessageReplyToExternalMessage) GetType() string { + return TypeInputMessageReplyToExternalMessage +} + +func (*InputMessageReplyToExternalMessage) InputMessageReplyToType() string { + return TypeInputMessageReplyToExternalMessage +} + // Describes a story to be replied type InputMessageReplyToStory struct { meta @@ -12492,6 +12580,8 @@ type DraftMessage struct { Date int32 `json:"date"` // Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote InputMessageText InputMessageContent `json:"input_message_text"` + // Identifier of the effect to apply to the message when it is sent; 0 if none + EffectId JsonInt64 `json:"effect_id"` } func (entity *DraftMessage) MarshalJSON() ([]byte, error) { @@ -12515,6 +12605,7 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { ReplyTo json.RawMessage `json:"reply_to"` Date int32 `json:"date"` InputMessageText json.RawMessage `json:"input_message_text"` + EffectId JsonInt64 `json:"effect_id"` } err := json.Unmarshal(data, &tmp) @@ -12523,6 +12614,7 @@ func (draftMessage *DraftMessage) UnmarshalJSON(data []byte) error { } draftMessage.Date = tmp.Date + draftMessage.EffectId = tmp.EffectId fieldReplyTo, _ := UnmarshalInputMessageReplyTo(tmp.ReplyTo) draftMessage.ReplyTo = fieldReplyTo @@ -17838,6 +17930,35 @@ func (*Address) GetType() string { return TypeAddress } +// Describes an address of a location +type LocationAddress struct { + meta + // A two-letter ISO 3166-1 alpha-2 country code + CountryCode string `json:"country_code"` + // State, if applicable; empty if unknown + State string `json:"state"` + // City; empty if unknown + City string `json:"city"` + // The address; empty if unknown + Street string `json:"street"` +} + +func (entity *LocationAddress) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub LocationAddress + + return json.Marshal((*stub)(entity)) +} + +func (*LocationAddress) GetClass() string { + return ClassLocationAddress +} + +func (*LocationAddress) GetType() string { + return TypeLocationAddress +} + // Contains parameters of the application theme type ThemeParameters struct { meta @@ -18339,7 +18460,7 @@ func (paymentFormTypeRegular *PaymentFormTypeRegular) UnmarshalJSON(data []byte) // The payment form is for a payment in Telegram stars type PaymentFormTypeStars struct { meta - // Number of stars that will be paid + // Number of Telegram stars that will be paid StarCount int64 `json:"star_count"` } @@ -18505,7 +18626,7 @@ func (*PaymentReceiptTypeRegular) PaymentReceiptTypeType() string { // The payment was done using Telegram stars type PaymentReceiptTypeStars struct { meta - // Number of stars that were paid + // Number of Telegram stars that were paid StarCount int64 `json:"star_count"` // Unique identifier of the transaction that can be used to dispute it TransactionId string `json:"transaction_id"` @@ -23927,7 +24048,7 @@ type MessageSendOptions struct { UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"` // 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 SchedulingState MessageSchedulingState `json:"scheduling_state"` - // Identifier of the effect to apply to the message; applicable only to sendMessage and sendMessageAlbum in private chats + // Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats EffectId JsonInt64 `json:"effect_id"` // 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"` @@ -25946,10 +26067,10 @@ func (*EmojiKeyword) GetType() string { return TypeEmojiKeyword } -// Represents a list of emoji with their keywords +// Represents a list of emojis with their keywords type EmojiKeywords struct { meta - // List of emoji with their keywords + // List of emojis with their keywords EmojiKeywords []*EmojiKeyword `json:"emoji_keywords"` } @@ -25992,7 +26113,7 @@ func (*Stickers) GetType() string { return TypeStickers } -// Represents a list of emoji +// Represents a list of emojis type Emojis struct { meta // List of emojis @@ -26046,7 +26167,7 @@ type StickerSet struct { IsViewed bool `json:"is_viewed"` // List of stickers in this set Stickers []*Sticker `json:"stickers"` - // 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 + // A list of emojis 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 Emojis []*Emojis `json:"emojis"` } @@ -26262,7 +26383,7 @@ func (*TrendingStickerSets) GetType() string { // The category contains a list of similar emoji to search for in getStickers and searchStickers for stickers, or getInlineQueryResults with the bot getOption("animation_search_bot_username") for animations type EmojiCategorySourceSearch struct { meta - // List of emojis for search for + // List of emojis to search for Emojis []string `json:"emojis"` } @@ -26499,6 +26620,8 @@ type StoryAreaPosition struct { HeightPercentage float64 `json:"height_percentage"` // Clockwise rotation angle of the rectangle, in degrees; 0-360 RotationAngle float64 `json:"rotation_angle"` + // The radius of the rectangle corner rounding, as a percentage of the media width + CornerRadiusPercentage float64 `json:"corner_radius_percentage"` } func (entity *StoryAreaPosition) MarshalJSON() ([]byte, error) { @@ -26522,6 +26645,8 @@ type StoryAreaTypeLocation struct { meta // The location Location *Location `json:"location"` + // Address of the location; may be null if unknown + Address *LocationAddress `json:"address"` } func (entity *StoryAreaTypeLocation) MarshalJSON() ([]byte, error) { @@ -26656,6 +26781,33 @@ func (*StoryAreaTypeMessage) StoryAreaTypeType() string { return TypeStoryAreaTypeMessage } +// An area pointing to a HTTP or tg:// link +type StoryAreaTypeLink struct { + meta + // HTTP or tg:// URL to be opened when the area is clicked + Url string `json:"url"` +} + +func (entity *StoryAreaTypeLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StoryAreaTypeLink + + return json.Marshal((*stub)(entity)) +} + +func (*StoryAreaTypeLink) GetClass() string { + return ClassStoryAreaType +} + +func (*StoryAreaTypeLink) GetType() string { + return TypeStoryAreaTypeLink +} + +func (*StoryAreaTypeLink) StoryAreaTypeType() string { + return TypeStoryAreaTypeLink +} + // Describes a clickable rectangle area on a story media type StoryArea struct { meta @@ -26705,6 +26857,8 @@ type InputStoryAreaTypeLocation struct { meta // The location Location *Location `json:"location"` + // Address of the location; pass null if unknown + Address *LocationAddress `json:"address"` } func (entity *InputStoryAreaTypeLocation) MarshalJSON() ([]byte, error) { @@ -26866,6 +27020,33 @@ func (*InputStoryAreaTypeMessage) InputStoryAreaTypeType() string { return TypeInputStoryAreaTypeMessage } +// An area pointing to a HTTP or tg:// link +type InputStoryAreaTypeLink struct { + meta + // HTTP or tg:// URL to be opened when the area is clicked + Url string `json:"url"` +} + +func (entity *InputStoryAreaTypeLink) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub InputStoryAreaTypeLink + + return json.Marshal((*stub)(entity)) +} + +func (*InputStoryAreaTypeLink) GetClass() string { + return ClassInputStoryAreaType +} + +func (*InputStoryAreaTypeLink) GetType() string { + return TypeInputStoryAreaTypeLink +} + +func (*InputStoryAreaTypeLink) InputStoryAreaTypeType() string { + return TypeInputStoryAreaTypeLink +} + // Describes a clickable rectangle area on a story media to be added type InputStoryArea struct { meta @@ -26913,7 +27094,7 @@ func (inputStoryArea *InputStoryArea) UnmarshalJSON(data []byte) error { // Contains a list of story areas to be added type InputStoryAreas struct { meta - // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area + // List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, and up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user Areas []*InputStoryArea `json:"areas"` } @@ -27501,6 +27682,33 @@ func (*Stories) GetType() string { return TypeStories } +// Contains a list of stories found by a search +type FoundStories struct { + meta + // Approximate total number of stories found + TotalCount int32 `json:"total_count"` + // List of stories + Stories []*Story `json:"stories"` + // The offset for the next request. If empty, then there are no more results + NextOffset string `json:"next_offset"` +} + +func (entity *FoundStories) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub FoundStories + + return json.Marshal((*stub)(entity)) +} + +func (*FoundStories) GetClass() string { + return ClassFoundStories +} + +func (*FoundStories) GetType() string { + return TypeFoundStories +} + // Contains identifier of a story along with identifier of its sender type StoryFullId struct { meta @@ -28840,7 +29048,7 @@ type CallStateReady struct { Config string `json:"config"` // Call encryption key EncryptionKey []byte `json:"encryption_key"` - // Encryption key emojis fingerprint + // Encryption key fingerprint represented as 4 emoji Emojis []string `json:"emojis"` // True, if peer-to-peer connection is allowed by users privacy settings AllowP2p bool `json:"allow_p2p"` @@ -35475,7 +35683,7 @@ func (*PremiumStoryFeatureSaveStories) PremiumStoryFeatureType() string { return TypePremiumStoryFeatureSaveStories } -// The ability to use links and formatting in story caption +// The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas type PremiumStoryFeatureLinksAndFormatting struct{ meta } @@ -45871,32 +46079,32 @@ func (storyStatistics *StoryStatistics) UnmarshalJSON(data []byte) error { } // Withdrawal is pending -type ChatRevenueWithdrawalStatePending struct{ +type RevenueWithdrawalStatePending struct{ meta } -func (entity *ChatRevenueWithdrawalStatePending) MarshalJSON() ([]byte, error) { +func (entity *RevenueWithdrawalStatePending) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueWithdrawalStatePending + type stub RevenueWithdrawalStatePending return json.Marshal((*stub)(entity)) } -func (*ChatRevenueWithdrawalStatePending) GetClass() string { - return ClassChatRevenueWithdrawalState +func (*RevenueWithdrawalStatePending) GetClass() string { + return ClassRevenueWithdrawalState } -func (*ChatRevenueWithdrawalStatePending) GetType() string { - return TypeChatRevenueWithdrawalStatePending +func (*RevenueWithdrawalStatePending) GetType() string { + return TypeRevenueWithdrawalStatePending } -func (*ChatRevenueWithdrawalStatePending) ChatRevenueWithdrawalStateType() string { - return TypeChatRevenueWithdrawalStatePending +func (*RevenueWithdrawalStatePending) RevenueWithdrawalStateType() string { + return TypeRevenueWithdrawalStatePending } -// Withdrawal was completed -type ChatRevenueWithdrawalStateCompleted struct { +// Withdrawal succeeded +type RevenueWithdrawalStateSucceeded struct { meta // Point in time (Unix timestamp) when the withdrawal was completed Date int32 `json:"date"` @@ -45904,49 +46112,49 @@ type ChatRevenueWithdrawalStateCompleted struct { Url string `json:"url"` } -func (entity *ChatRevenueWithdrawalStateCompleted) MarshalJSON() ([]byte, error) { +func (entity *RevenueWithdrawalStateSucceeded) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueWithdrawalStateCompleted + type stub RevenueWithdrawalStateSucceeded return json.Marshal((*stub)(entity)) } -func (*ChatRevenueWithdrawalStateCompleted) GetClass() string { - return ClassChatRevenueWithdrawalState +func (*RevenueWithdrawalStateSucceeded) GetClass() string { + return ClassRevenueWithdrawalState } -func (*ChatRevenueWithdrawalStateCompleted) GetType() string { - return TypeChatRevenueWithdrawalStateCompleted +func (*RevenueWithdrawalStateSucceeded) GetType() string { + return TypeRevenueWithdrawalStateSucceeded } -func (*ChatRevenueWithdrawalStateCompleted) ChatRevenueWithdrawalStateType() string { - return TypeChatRevenueWithdrawalStateCompleted +func (*RevenueWithdrawalStateSucceeded) RevenueWithdrawalStateType() string { + return TypeRevenueWithdrawalStateSucceeded } -// Withdrawal has_failed -type ChatRevenueWithdrawalStateFailed struct{ +// Withdrawal failed +type RevenueWithdrawalStateFailed struct{ meta } -func (entity *ChatRevenueWithdrawalStateFailed) MarshalJSON() ([]byte, error) { +func (entity *RevenueWithdrawalStateFailed) MarshalJSON() ([]byte, error) { entity.meta.Type = entity.GetType() - type stub ChatRevenueWithdrawalStateFailed + type stub RevenueWithdrawalStateFailed return json.Marshal((*stub)(entity)) } -func (*ChatRevenueWithdrawalStateFailed) GetClass() string { - return ClassChatRevenueWithdrawalState +func (*RevenueWithdrawalStateFailed) GetClass() string { + return ClassRevenueWithdrawalState } -func (*ChatRevenueWithdrawalStateFailed) GetType() string { - return TypeChatRevenueWithdrawalStateFailed +func (*RevenueWithdrawalStateFailed) GetType() string { + return TypeRevenueWithdrawalStateFailed } -func (*ChatRevenueWithdrawalStateFailed) ChatRevenueWithdrawalStateType() string { - return TypeChatRevenueWithdrawalStateFailed +func (*RevenueWithdrawalStateFailed) RevenueWithdrawalStateType() string { + return TypeRevenueWithdrawalStateFailed } // Describes earnings from sponsored messages in a chat in some time frame @@ -45986,7 +46194,7 @@ type ChatRevenueTransactionTypeWithdrawal struct { // Name of the payment provider Provider string `json:"provider"` // State of the withdrawal - State ChatRevenueWithdrawalState `json:"state"` + State RevenueWithdrawalState `json:"state"` } func (entity *ChatRevenueTransactionTypeWithdrawal) MarshalJSON() ([]byte, error) { @@ -46024,7 +46232,7 @@ func (chatRevenueTransactionTypeWithdrawal *ChatRevenueTransactionTypeWithdrawal chatRevenueTransactionTypeWithdrawal.WithdrawalDate = tmp.WithdrawalDate chatRevenueTransactionTypeWithdrawal.Provider = tmp.Provider - fieldState, _ := UnmarshalChatRevenueWithdrawalState(tmp.State) + fieldState, _ := UnmarshalRevenueWithdrawalState(tmp.State) chatRevenueTransactionTypeWithdrawal.State = fieldState return nil @@ -46132,6 +46340,85 @@ func (*ChatRevenueTransactions) GetType() string { return TypeChatRevenueTransactions } +// Contains information about Telegram stars earned by a bot or a chat +type StarRevenueStatus struct { + meta + // Total number of the stars earned + TotalCount int64 `json:"total_count"` + // The number of Telegram stars that aren't withdrawn yet + CurrentCount int64 `json:"current_count"` + // The number of Telegram stars that are available for withdrawal + AvailableCount int64 `json:"available_count"` + // True, if Telegram stars can be withdrawn now or later + WithdrawalEnabled bool `json:"withdrawal_enabled"` + // Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now + NextWithdrawalIn int32 `json:"next_withdrawal_in"` +} + +func (entity *StarRevenueStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarRevenueStatus + + return json.Marshal((*stub)(entity)) +} + +func (*StarRevenueStatus) GetClass() string { + return ClassStarRevenueStatus +} + +func (*StarRevenueStatus) GetType() string { + return TypeStarRevenueStatus +} + +// A detailed statistics about Telegram stars earned by a bot or a chat +type StarRevenueStatistics struct { + meta + // A graph containing amount of revenue in a given day + RevenueByDayGraph StatisticalGraph `json:"revenue_by_day_graph"` + // Telegram star revenue status + Status *StarRevenueStatus `json:"status"` + // Current conversion rate of a Telegram star to USD + UsdRate float64 `json:"usd_rate"` +} + +func (entity *StarRevenueStatistics) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub StarRevenueStatistics + + return json.Marshal((*stub)(entity)) +} + +func (*StarRevenueStatistics) GetClass() string { + return ClassStarRevenueStatistics +} + +func (*StarRevenueStatistics) GetType() string { + return TypeStarRevenueStatistics +} + +func (starRevenueStatistics *StarRevenueStatistics) UnmarshalJSON(data []byte) error { + var tmp struct { + RevenueByDayGraph json.RawMessage `json:"revenue_by_day_graph"` + Status *StarRevenueStatus `json:"status"` + UsdRate float64 `json:"usd_rate"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + starRevenueStatistics.Status = tmp.Status + starRevenueStatistics.UsdRate = tmp.UsdRate + + fieldRevenueByDayGraph, _ := UnmarshalStatisticalGraph(tmp.RevenueByDayGraph) + starRevenueStatistics.RevenueByDayGraph = fieldRevenueByDayGraph + + return nil +} + // A point on a Cartesian plane type Point struct { meta @@ -50450,6 +50737,54 @@ func (*UpdateChatRevenueAmount) UpdateType() string { return TypeUpdateChatRevenueAmount } +// The Telegram star revenue earned by a bot or a chat has changed. If star transactions screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +type UpdateStarRevenueStatus struct { + meta + // Identifier of the owner of the Telegram stars + OwnerId MessageSender `json:"owner_id"` + // New Telegram star revenue status + Status *StarRevenueStatus `json:"status"` +} + +func (entity *UpdateStarRevenueStatus) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateStarRevenueStatus + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateStarRevenueStatus) GetClass() string { + return ClassUpdate +} + +func (*UpdateStarRevenueStatus) GetType() string { + return TypeUpdateStarRevenueStatus +} + +func (*UpdateStarRevenueStatus) UpdateType() string { + return TypeUpdateStarRevenueStatus +} + +func (updateStarRevenueStatus *UpdateStarRevenueStatus) UnmarshalJSON(data []byte) error { + var tmp struct { + OwnerId json.RawMessage `json:"owner_id"` + Status *StarRevenueStatus `json:"status"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateStarRevenueStatus.Status = tmp.Status + + fieldOwnerId, _ := UnmarshalMessageSender(tmp.OwnerId) + updateStarRevenueStatus.OwnerId = fieldOwnerId + + return nil +} + // The parameters of speech recognition without Telegram Premium subscription has changed type UpdateSpeechRecognitionTrial struct { meta @@ -51060,6 +51395,70 @@ func (updateNewInlineCallbackQuery *UpdateNewInlineCallbackQuery) UnmarshalJSON( return nil } +// A new incoming callback query from a business message; for bots only +type UpdateNewBusinessCallbackQuery struct { + meta + // Unique query identifier + Id JsonInt64 `json:"id"` + // Identifier of the user who sent the query + SenderUserId int64 `json:"sender_user_id"` + // Unique identifier of the business connection + ConnectionId string `json:"connection_id"` + // The message from the business account from which the query originated + Message *BusinessMessage `json:"message"` + // An identifier uniquely corresponding to the chat a message was sent to + ChatInstance JsonInt64 `json:"chat_instance"` + // Query payload + Payload CallbackQueryPayload `json:"payload"` +} + +func (entity *UpdateNewBusinessCallbackQuery) MarshalJSON() ([]byte, error) { + entity.meta.Type = entity.GetType() + + type stub UpdateNewBusinessCallbackQuery + + return json.Marshal((*stub)(entity)) +} + +func (*UpdateNewBusinessCallbackQuery) GetClass() string { + return ClassUpdate +} + +func (*UpdateNewBusinessCallbackQuery) GetType() string { + return TypeUpdateNewBusinessCallbackQuery +} + +func (*UpdateNewBusinessCallbackQuery) UpdateType() string { + return TypeUpdateNewBusinessCallbackQuery +} + +func (updateNewBusinessCallbackQuery *UpdateNewBusinessCallbackQuery) UnmarshalJSON(data []byte) error { + var tmp struct { + Id JsonInt64 `json:"id"` + SenderUserId int64 `json:"sender_user_id"` + ConnectionId string `json:"connection_id"` + Message *BusinessMessage `json:"message"` + ChatInstance JsonInt64 `json:"chat_instance"` + Payload json.RawMessage `json:"payload"` + } + + err := json.Unmarshal(data, &tmp) + if err != nil { + return err + } + + updateNewBusinessCallbackQuery.Id = tmp.Id + updateNewBusinessCallbackQuery.SenderUserId = tmp.SenderUserId + updateNewBusinessCallbackQuery.ConnectionId = tmp.ConnectionId + updateNewBusinessCallbackQuery.Message = tmp.Message + updateNewBusinessCallbackQuery.ChatInstance = tmp.ChatInstance + + fieldPayload, _ := UnmarshalCallbackQueryPayload(tmp.Payload) + updateNewBusinessCallbackQuery.Payload = fieldPayload + + return nil +} + // A new incoming shipping query; for bots only. Only for invoices with flexible price type UpdateNewShippingQuery struct { meta diff --git a/client/unmarshaler.go b/client/unmarshaler.go index ac3d1bc..945db86 100755 --- a/client/unmarshaler.go +++ b/client/unmarshaler.go @@ -659,7 +659,7 @@ func UnmarshalListOfStarTransactionDirection(dataList []json.RawMessage) ([]Star return list, nil } -func UnmarshalStarTransactionSource(data json.RawMessage) (StarTransactionSource, error) { +func UnmarshalStarTransactionPartner(data json.RawMessage) (StarTransactionPartner, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -668,34 +668,37 @@ func UnmarshalStarTransactionSource(data json.RawMessage) (StarTransactionSource } switch meta.Type { - case TypeStarTransactionSourceTelegram: - return UnmarshalStarTransactionSourceTelegram(data) + case TypeStarTransactionPartnerTelegram: + return UnmarshalStarTransactionPartnerTelegram(data) - case TypeStarTransactionSourceAppStore: - return UnmarshalStarTransactionSourceAppStore(data) + case TypeStarTransactionPartnerAppStore: + return UnmarshalStarTransactionPartnerAppStore(data) - case TypeStarTransactionSourceGooglePlay: - return UnmarshalStarTransactionSourceGooglePlay(data) + case TypeStarTransactionPartnerGooglePlay: + return UnmarshalStarTransactionPartnerGooglePlay(data) - case TypeStarTransactionSourceFragment: - return UnmarshalStarTransactionSourceFragment(data) + case TypeStarTransactionPartnerFragment: + return UnmarshalStarTransactionPartnerFragment(data) - case TypeStarTransactionSourceUser: - return UnmarshalStarTransactionSourceUser(data) + case TypeStarTransactionPartnerUser: + return UnmarshalStarTransactionPartnerUser(data) - case TypeStarTransactionSourceUnsupported: - return UnmarshalStarTransactionSourceUnsupported(data) + case TypeStarTransactionPartnerChannel: + return UnmarshalStarTransactionPartnerChannel(data) + + case TypeStarTransactionPartnerUnsupported: + return UnmarshalStarTransactionPartnerUnsupported(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfStarTransactionSource(dataList []json.RawMessage) ([]StarTransactionSource, error) { - list := []StarTransactionSource{} +func UnmarshalListOfStarTransactionPartner(dataList []json.RawMessage) ([]StarTransactionPartner, error) { + list := []StarTransactionPartner{} for _, data := range dataList { - entity, err := UnmarshalStarTransactionSource(data) + entity, err := UnmarshalStarTransactionPartner(data) if err != nil { return nil, err } @@ -1268,6 +1271,9 @@ func UnmarshalInputMessageReplyTo(data json.RawMessage) (InputMessageReplyTo, er case TypeInputMessageReplyToMessage: return UnmarshalInputMessageReplyToMessage(data) + case TypeInputMessageReplyToExternalMessage: + return UnmarshalInputMessageReplyToExternalMessage(data) + case TypeInputMessageReplyToStory: return UnmarshalInputMessageReplyToStory(data) @@ -3515,6 +3521,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) { case TypeStoryAreaTypeMessage: return UnmarshalStoryAreaTypeMessage(data) + case TypeStoryAreaTypeLink: + return UnmarshalStoryAreaTypeLink(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -3558,6 +3567,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro case TypeInputStoryAreaTypeMessage: return UnmarshalInputStoryAreaTypeMessage(data) + case TypeInputStoryAreaTypeLink: + return UnmarshalInputStoryAreaTypeLink(data) + default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } @@ -6933,7 +6945,7 @@ func UnmarshalListOfChatStatistics(dataList []json.RawMessage) ([]ChatStatistics return list, nil } -func UnmarshalChatRevenueWithdrawalState(data json.RawMessage) (ChatRevenueWithdrawalState, error) { +func UnmarshalRevenueWithdrawalState(data json.RawMessage) (RevenueWithdrawalState, error) { var meta meta err := json.Unmarshal(data, &meta) @@ -6942,25 +6954,25 @@ func UnmarshalChatRevenueWithdrawalState(data json.RawMessage) (ChatRevenueWithd } switch meta.Type { - case TypeChatRevenueWithdrawalStatePending: - return UnmarshalChatRevenueWithdrawalStatePending(data) + case TypeRevenueWithdrawalStatePending: + return UnmarshalRevenueWithdrawalStatePending(data) - case TypeChatRevenueWithdrawalStateCompleted: - return UnmarshalChatRevenueWithdrawalStateCompleted(data) + case TypeRevenueWithdrawalStateSucceeded: + return UnmarshalRevenueWithdrawalStateSucceeded(data) - case TypeChatRevenueWithdrawalStateFailed: - return UnmarshalChatRevenueWithdrawalStateFailed(data) + case TypeRevenueWithdrawalStateFailed: + return UnmarshalRevenueWithdrawalStateFailed(data) default: return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) } } -func UnmarshalListOfChatRevenueWithdrawalState(dataList []json.RawMessage) ([]ChatRevenueWithdrawalState, error) { - list := []ChatRevenueWithdrawalState{} +func UnmarshalListOfRevenueWithdrawalState(dataList []json.RawMessage) ([]RevenueWithdrawalState, error) { + list := []RevenueWithdrawalState{} for _, data := range dataList { - entity, err := UnmarshalChatRevenueWithdrawalState(data) + entity, err := UnmarshalRevenueWithdrawalState(data) if err != nil { return nil, err } @@ -7496,6 +7508,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) + case TypeUpdateStarRevenueStatus: + return UnmarshalUpdateStarRevenueStatus(data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) @@ -7544,6 +7559,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) { case TypeUpdateNewInlineCallbackQuery: return UnmarshalUpdateNewInlineCallbackQuery(data) + case TypeUpdateNewBusinessCallbackQuery: + return UnmarshalUpdateNewBusinessCallbackQuery(data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(data) @@ -8769,48 +8787,56 @@ func UnmarshalStarTransactionDirectionOutgoing(data json.RawMessage) (*StarTrans return &resp, err } -func UnmarshalStarTransactionSourceTelegram(data json.RawMessage) (*StarTransactionSourceTelegram, error) { - var resp StarTransactionSourceTelegram +func UnmarshalStarTransactionPartnerTelegram(data json.RawMessage) (*StarTransactionPartnerTelegram, error) { + var resp StarTransactionPartnerTelegram err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalStarTransactionSourceAppStore(data json.RawMessage) (*StarTransactionSourceAppStore, error) { - var resp StarTransactionSourceAppStore +func UnmarshalStarTransactionPartnerAppStore(data json.RawMessage) (*StarTransactionPartnerAppStore, error) { + var resp StarTransactionPartnerAppStore err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalStarTransactionSourceGooglePlay(data json.RawMessage) (*StarTransactionSourceGooglePlay, error) { - var resp StarTransactionSourceGooglePlay +func UnmarshalStarTransactionPartnerGooglePlay(data json.RawMessage) (*StarTransactionPartnerGooglePlay, error) { + var resp StarTransactionPartnerGooglePlay err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalStarTransactionSourceFragment(data json.RawMessage) (*StarTransactionSourceFragment, error) { - var resp StarTransactionSourceFragment +func UnmarshalStarTransactionPartnerFragment(data json.RawMessage) (*StarTransactionPartnerFragment, error) { + var resp StarTransactionPartnerFragment err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalStarTransactionSourceUser(data json.RawMessage) (*StarTransactionSourceUser, error) { - var resp StarTransactionSourceUser +func UnmarshalStarTransactionPartnerUser(data json.RawMessage) (*StarTransactionPartnerUser, error) { + var resp StarTransactionPartnerUser err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalStarTransactionSourceUnsupported(data json.RawMessage) (*StarTransactionSourceUnsupported, error) { - var resp StarTransactionSourceUnsupported +func UnmarshalStarTransactionPartnerChannel(data json.RawMessage) (*StarTransactionPartnerChannel, error) { + var resp StarTransactionPartnerChannel + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarTransactionPartnerUnsupported(data json.RawMessage) (*StarTransactionPartnerUnsupported, error) { + var resp StarTransactionPartnerUnsupported err := json.Unmarshal(data, &resp) @@ -9625,6 +9651,14 @@ func UnmarshalInputMessageReplyToMessage(data json.RawMessage) (*InputMessageRep return &resp, err } +func UnmarshalInputMessageReplyToExternalMessage(data json.RawMessage) (*InputMessageReplyToExternalMessage, error) { + var resp InputMessageReplyToExternalMessage + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputMessageReplyToStory(data json.RawMessage) (*InputMessageReplyToStory, error) { var resp InputMessageReplyToStory @@ -11153,6 +11187,14 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) { return &resp, err } +func UnmarshalLocationAddress(data json.RawMessage) (*LocationAddress, error) { + var resp LocationAddress + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) { var resp ThemeParameters @@ -13377,6 +13419,14 @@ func UnmarshalStoryAreaTypeMessage(data json.RawMessage) (*StoryAreaTypeMessage, return &resp, err } +func UnmarshalStoryAreaTypeLink(data json.RawMessage) (*StoryAreaTypeLink, error) { + var resp StoryAreaTypeLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { var resp StoryArea @@ -13425,6 +13475,14 @@ func UnmarshalInputStoryAreaTypeMessage(data json.RawMessage) (*InputStoryAreaTy return &resp, err } +func UnmarshalInputStoryAreaTypeLink(data json.RawMessage) (*InputStoryAreaTypeLink, error) { + var resp InputStoryAreaTypeLink + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { var resp InputStoryArea @@ -13553,6 +13611,14 @@ func UnmarshalStories(data json.RawMessage) (*Stories, error) { return &resp, err } +func UnmarshalFoundStories(data json.RawMessage) (*FoundStories, error) { + var resp FoundStories + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalStoryFullId(data json.RawMessage) (*StoryFullId, error) { var resp StoryFullId @@ -18329,24 +18395,24 @@ func UnmarshalStoryStatistics(data json.RawMessage) (*StoryStatistics, error) { return &resp, err } -func UnmarshalChatRevenueWithdrawalStatePending(data json.RawMessage) (*ChatRevenueWithdrawalStatePending, error) { - var resp ChatRevenueWithdrawalStatePending +func UnmarshalRevenueWithdrawalStatePending(data json.RawMessage) (*RevenueWithdrawalStatePending, error) { + var resp RevenueWithdrawalStatePending err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatRevenueWithdrawalStateCompleted(data json.RawMessage) (*ChatRevenueWithdrawalStateCompleted, error) { - var resp ChatRevenueWithdrawalStateCompleted +func UnmarshalRevenueWithdrawalStateSucceeded(data json.RawMessage) (*RevenueWithdrawalStateSucceeded, error) { + var resp RevenueWithdrawalStateSucceeded err := json.Unmarshal(data, &resp) return &resp, err } -func UnmarshalChatRevenueWithdrawalStateFailed(data json.RawMessage) (*ChatRevenueWithdrawalStateFailed, error) { - var resp ChatRevenueWithdrawalStateFailed +func UnmarshalRevenueWithdrawalStateFailed(data json.RawMessage) (*RevenueWithdrawalStateFailed, error) { + var resp RevenueWithdrawalStateFailed err := json.Unmarshal(data, &resp) @@ -18393,6 +18459,22 @@ func UnmarshalChatRevenueTransactions(data json.RawMessage) (*ChatRevenueTransac return &resp, err } +func UnmarshalStarRevenueStatus(data json.RawMessage) (*StarRevenueStatus, error) { + var resp StarRevenueStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + +func UnmarshalStarRevenueStatistics(data json.RawMessage) (*StarRevenueStatistics, error) { + var resp StarRevenueStatistics + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalPoint(data json.RawMessage) (*Point, error) { var resp Point @@ -19457,6 +19539,14 @@ func UnmarshalUpdateChatRevenueAmount(data json.RawMessage) (*UpdateChatRevenueA return &resp, err } +func UnmarshalUpdateStarRevenueStatus(data json.RawMessage) (*UpdateStarRevenueStatus, error) { + var resp UpdateStarRevenueStatus + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateSpeechRecognitionTrial(data json.RawMessage) (*UpdateSpeechRecognitionTrial, error) { var resp UpdateSpeechRecognitionTrial @@ -19585,6 +19675,14 @@ func UnmarshalUpdateNewInlineCallbackQuery(data json.RawMessage) (*UpdateNewInli return &resp, err } +func UnmarshalUpdateNewBusinessCallbackQuery(data json.RawMessage) (*UpdateNewBusinessCallbackQuery, error) { + var resp UpdateNewBusinessCallbackQuery + + err := json.Unmarshal(data, &resp) + + return &resp, err +} + func UnmarshalUpdateNewShippingQuery(data json.RawMessage) (*UpdateNewShippingQuery, error) { var resp UpdateNewShippingQuery @@ -20220,23 +20318,26 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStarTransactionDirectionOutgoing: return UnmarshalStarTransactionDirectionOutgoing(data) - case TypeStarTransactionSourceTelegram: - return UnmarshalStarTransactionSourceTelegram(data) + case TypeStarTransactionPartnerTelegram: + return UnmarshalStarTransactionPartnerTelegram(data) - case TypeStarTransactionSourceAppStore: - return UnmarshalStarTransactionSourceAppStore(data) + case TypeStarTransactionPartnerAppStore: + return UnmarshalStarTransactionPartnerAppStore(data) - case TypeStarTransactionSourceGooglePlay: - return UnmarshalStarTransactionSourceGooglePlay(data) + case TypeStarTransactionPartnerGooglePlay: + return UnmarshalStarTransactionPartnerGooglePlay(data) - case TypeStarTransactionSourceFragment: - return UnmarshalStarTransactionSourceFragment(data) + case TypeStarTransactionPartnerFragment: + return UnmarshalStarTransactionPartnerFragment(data) - case TypeStarTransactionSourceUser: - return UnmarshalStarTransactionSourceUser(data) + case TypeStarTransactionPartnerUser: + return UnmarshalStarTransactionPartnerUser(data) - case TypeStarTransactionSourceUnsupported: - return UnmarshalStarTransactionSourceUnsupported(data) + case TypeStarTransactionPartnerChannel: + return UnmarshalStarTransactionPartnerChannel(data) + + case TypeStarTransactionPartnerUnsupported: + return UnmarshalStarTransactionPartnerUnsupported(data) case TypeStarTransaction: return UnmarshalStarTransaction(data) @@ -20541,6 +20642,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputMessageReplyToMessage: return UnmarshalInputMessageReplyToMessage(data) + case TypeInputMessageReplyToExternalMessage: + return UnmarshalInputMessageReplyToExternalMessage(data) + case TypeInputMessageReplyToStory: return UnmarshalInputMessageReplyToStory(data) @@ -21114,6 +21218,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeAddress: return UnmarshalAddress(data) + case TypeLocationAddress: + return UnmarshalLocationAddress(data) + case TypeThemeParameters: return UnmarshalThemeParameters(data) @@ -21948,6 +22055,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryAreaTypeMessage: return UnmarshalStoryAreaTypeMessage(data) + case TypeStoryAreaTypeLink: + return UnmarshalStoryAreaTypeLink(data) + case TypeStoryArea: return UnmarshalStoryArea(data) @@ -21966,6 +22076,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeInputStoryAreaTypeMessage: return UnmarshalInputStoryAreaTypeMessage(data) + case TypeInputStoryAreaTypeLink: + return UnmarshalInputStoryAreaTypeLink(data) + case TypeInputStoryArea: return UnmarshalInputStoryArea(data) @@ -22014,6 +22127,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStories: return UnmarshalStories(data) + case TypeFoundStories: + return UnmarshalFoundStories(data) + case TypeStoryFullId: return UnmarshalStoryFullId(data) @@ -23805,14 +23921,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeStoryStatistics: return UnmarshalStoryStatistics(data) - case TypeChatRevenueWithdrawalStatePending: - return UnmarshalChatRevenueWithdrawalStatePending(data) + case TypeRevenueWithdrawalStatePending: + return UnmarshalRevenueWithdrawalStatePending(data) - case TypeChatRevenueWithdrawalStateCompleted: - return UnmarshalChatRevenueWithdrawalStateCompleted(data) + case TypeRevenueWithdrawalStateSucceeded: + return UnmarshalRevenueWithdrawalStateSucceeded(data) - case TypeChatRevenueWithdrawalStateFailed: - return UnmarshalChatRevenueWithdrawalStateFailed(data) + case TypeRevenueWithdrawalStateFailed: + return UnmarshalRevenueWithdrawalStateFailed(data) case TypeChatRevenueTransactionTypeEarnings: return UnmarshalChatRevenueTransactionTypeEarnings(data) @@ -23829,6 +23945,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeChatRevenueTransactions: return UnmarshalChatRevenueTransactions(data) + case TypeStarRevenueStatus: + return UnmarshalStarRevenueStatus(data) + + case TypeStarRevenueStatistics: + return UnmarshalStarRevenueStatistics(data) + case TypePoint: return UnmarshalPoint(data) @@ -24228,6 +24350,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateChatRevenueAmount: return UnmarshalUpdateChatRevenueAmount(data) + case TypeUpdateStarRevenueStatus: + return UnmarshalUpdateStarRevenueStatus(data) + case TypeUpdateSpeechRecognitionTrial: return UnmarshalUpdateSpeechRecognitionTrial(data) @@ -24276,6 +24401,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) { case TypeUpdateNewInlineCallbackQuery: return UnmarshalUpdateNewInlineCallbackQuery(data) + case TypeUpdateNewBusinessCallbackQuery: + return UnmarshalUpdateNewBusinessCallbackQuery(data) + case TypeUpdateNewShippingQuery: return UnmarshalUpdateNewShippingQuery(data) diff --git a/data/td_api.tl b/data/td_api.tl index dae79c7..14fb6f4 100644 --- a/data/td_api.tl +++ b/data/td_api.tl @@ -836,7 +836,7 @@ premiumGiftCodeInfo creator_id:MessageSender creation_date:int32 is_from_giveawa //@description Describes an option for buying Telegram stars //@currency ISO 4217 currency code for the payment //@amount The amount to pay, in the smallest units of the currency -//@star_count Number of stars that will be purchased +//@star_count Number of Telegram stars that will be purchased //@store_product_id Identifier of the store product associated with the option; may be empty if none //@is_additional True, if the option must be shown only in the full list of payment options starPaymentOption currency:string amount:int53 star_count:int53 store_product_id:string is_additional:Bool = StarPaymentOption; @@ -854,25 +854,28 @@ starTransactionDirectionIncoming = StarTransactionDirection; starTransactionDirectionOutgoing = StarTransactionDirection; -//@class StarTransactionSource @description Describes source or recipient of a transaction with Telegram stars +//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram stars //@description The transaction is a transaction with Telegram through a bot -starTransactionSourceTelegram = StarTransactionSource; +starTransactionPartnerTelegram = StarTransactionPartner; //@description The transaction is a transaction with App Store -starTransactionSourceAppStore = StarTransactionSource; +starTransactionPartnerAppStore = StarTransactionPartner; //@description The transaction is a transaction with Google Play -starTransactionSourceGooglePlay = StarTransactionSource; +starTransactionPartnerGooglePlay = StarTransactionPartner; -//@description The transaction is a transaction with Fragment -starTransactionSourceFragment = StarTransactionSource; +//@description The transaction is a transaction with Fragment @withdrawal_state State of the withdrawal; may be null for refunds from Fragment +starTransactionPartnerFragment withdrawal_state:RevenueWithdrawalState = StarTransactionPartner; //@description The transaction is a transaction with another user @user_id Identifier of the user @product_info Information about the bought product; may be null if none -starTransactionSourceUser user_id:int53 product_info:productInfo = StarTransactionSource; +starTransactionPartnerUser user_id:int53 product_info:productInfo = StarTransactionPartner; -//@description The transaction is a transaction with unknown source -starTransactionSourceUnsupported = StarTransactionSource; +//@description The transaction is a transaction with a channel chat @chat_id Identifier of the chat +starTransactionPartnerChannel chat_id:int53 = StarTransactionPartner; + +//@description The transaction is a transaction with unknown partner +starTransactionPartnerUnsupported = StarTransactionPartner; //@description Represents a transaction changing the amount of owned Telegram stars @@ -880,8 +883,8 @@ starTransactionSourceUnsupported = StarTransactionSource; //@star_count The amount of added owned Telegram stars; negative for outgoing transactions //@is_refund True, if the transaction is a refund of a previous transaction //@date Point in time (Unix timestamp) when the transaction was completed -//@source Source of the transaction, or its recipient for outgoing transactions -starTransaction id:string star_count:int53 is_refund:Bool date:int32 source:StarTransactionSource = StarTransaction; +//@partner Source of the incoming transaction, or its recipient for outgoing transactions +starTransaction id:string star_count:int53 is_refund:Bool date:int32 partner:StarTransactionPartner = StarTransaction; //@description Represents a list of Telegram star transactions //@star_count The amount of owned Telegram stars @@ -1053,14 +1056,14 @@ chatAdministrators administrators:vector = ChatAdministrators //@class ChatMemberStatus @description Provides information about the status of a member in a chat //@description The user is the owner of the chat and has all the administrator privileges -//@custom_title A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only +//@custom_title A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only //@is_anonymous True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only //@is_member True, if the user is a member of the chat chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = ChatMemberStatus; //@description The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. //-In supergroups and channels, there are more detailed options for administrator privileges -//@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only +//@custom_title A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only //@can_be_edited True, if the current user can edit the administrator privileges for the called user //@rights Rights of the administrator chatMemberStatusAdministrator custom_title:string can_be_edited:Bool rights:chatAdministratorRights = ChatMemberStatus; @@ -1527,11 +1530,16 @@ 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 or topic 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 +//@description Describes a message to be replied in the same chat and forum topic +//@message_id The identifier of the message to be replied in the same chat and forum topic //@quote Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats -inputMessageReplyToMessage chat_id:int53 message_id:int53 quote:inputTextQuote = InputMessageReplyTo; +inputMessageReplyToMessage message_id:int53 quote:inputTextQuote = InputMessageReplyTo; + +//@description Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats +//@chat_id The identifier of the chat to which the message to be replied belongs +//@message_id The identifier of the message to be replied in the specified chat. A message can be replied in another chat or topic only if message.can_be_replied_in_another_chat +//@quote Quote from the message to be replied; pass null if none +inputMessageReplyToExternalMessage chat_id:int53 message_id:int53 quote:inputTextQuote = 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 and channel stories can't be replied @@ -1790,7 +1798,8 @@ reactionNotificationSettings message_reaction_source:ReactionNotificationSource //@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, inputMessageVideoNote, or inputMessageVoiceNote -draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent = DraftMessage; +//@effect_id Identifier of the effect to apply to the message when it is sent; 0 if none +draftMessage reply_to:InputMessageReplyTo date:int32 input_message_text:InputMessageContent effect_id:int64 = DraftMessage; //@class ChatType @description Describes the type of chat @@ -2613,6 +2622,13 @@ bankCardInfo title:string actions:vector = BankCardInfo; //@postal_code Address postal code address country_code:string state:string city:string street_line1:string street_line2:string postal_code:string = Address; +//@description Describes an address of a location +//@country_code A two-letter ISO 3166-1 alpha-2 country code +//@state State, if applicable; empty if unknown +//@city City; empty if unknown +//@street The address; empty if unknown +locationAddress country_code:string state:string city:string street:string = LocationAddress; + //@description Contains parameters of the application theme //@background_color A color of the background in the RGB24 format @@ -2716,7 +2732,7 @@ paymentOption title:string url:string = PaymentOption; //@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password paymentFormTypeRegular invoice:invoice payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector saved_order_info:orderInfo saved_credentials:vector can_save_credentials:Bool need_password:Bool = PaymentFormType; -//@description The payment form is for a payment in Telegram stars @star_count Number of stars that will be paid +//@description The payment form is for a payment in Telegram stars @star_count Number of Telegram stars that will be paid paymentFormTypeStars star_count:int53 = PaymentFormType; @@ -2746,7 +2762,7 @@ paymentResult success:Bool verification_url:string = PaymentResult; paymentReceiptTypeRegular payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceiptType; //@description The payment was done using Telegram stars -//@star_count Number of stars that were paid +//@star_count Number of Telegram stars that were paid //@transaction_id Unique identifier of the transaction that can be used to dispute it paymentReceiptTypeStars star_count:int53 transaction_id:string = PaymentReceiptType; @@ -3490,7 +3506,7 @@ messageSelfDestructTypeImmediately = MessageSelfDestructType; //@protect_content Pass true if the content of the message must be protected from forwarding and saving; for bots only //@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 -//@effect_id Identifier of the effect to apply to the message; applicable only to sendMessage and sendMessageAlbum in private chats +//@effect_id Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats //@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 //@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 effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; @@ -3773,13 +3789,13 @@ userStatusLastMonth by_my_privacy_settings:Bool = UserStatus; //@description Represents an emoji with its keyword @emoji The emoji @keyword The keyword emojiKeyword emoji:string keyword:string = EmojiKeyword; -//@description Represents a list of emoji with their keywords @emoji_keywords List of emoji with their keywords +//@description Represents a list of emojis with their keywords @emoji_keywords List of emojis with their keywords emojiKeywords emoji_keywords:vector = EmojiKeywords; //@description Represents a list of stickers @stickers List of stickers stickers stickers:vector = Stickers; -//@description Represents a list of emoji @emojis List of emojis +//@description Represents a list of emojis @emojis List of emojis emojis emojis:vector = Emojis; //@description Represents a sticker set @@ -3797,7 +3813,7 @@ emojis emojis:vector = Emojis; //@is_allowed_as_chat_emoji_status True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; 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 +//@emojis A list of emojis 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_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set @@ -3829,7 +3845,7 @@ trendingStickerSets total_count:int32 sets:vector is_premium:Boo //@description The category contains a list of similar emoji to search for in getStickers and searchStickers for stickers, //-or getInlineQueryResults with the bot getOption("animation_search_bot_username") for animations -//@emojis List of emojis for search for +//@emojis List of emojis to search for emojiCategorySourceSearch emojis:vector = EmojiCategorySource; //@description The category contains premium stickers that must be found by getPremiumStickers @@ -3868,13 +3884,14 @@ emojiCategoryTypeChatPhoto = EmojiCategoryType; //@width_percentage The width of the rectangle, as a percentage of the media width //@height_percentage The height of the rectangle, as a percentage of the media height //@rotation_angle Clockwise rotation angle of the rectangle, in degrees; 0-360 -storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double = StoryAreaPosition; +//@corner_radius_percentage The radius of the rectangle corner rounding, as a percentage of the media width +storyAreaPosition x_percentage:double y_percentage:double width_percentage:double height_percentage:double rotation_angle:double corner_radius_percentage:double = StoryAreaPosition; //@class StoryAreaType @description Describes type of clickable rectangle area on a story media -//@description An area pointing to a location @location The location -storyAreaTypeLocation location:location = StoryAreaType; +//@description An area pointing to a location @location The location @address Address of the location; may be null if unknown +storyAreaTypeLocation location:location address:locationAddress = StoryAreaType; //@description An area pointing to a venue @venue Information about the venue storyAreaTypeVenue venue:venue = StoryAreaType; @@ -3889,6 +3906,9 @@ storyAreaTypeSuggestedReaction reaction_type:ReactionType total_count:int32 is_d //@description An area pointing to a message @chat_id Identifier of the chat with the message @message_id Identifier of the message storyAreaTypeMessage chat_id:int53 message_id:int53 = StoryAreaType; +//@description An area pointing to a HTTP or tg:// link @url HTTP or tg:// URL to be opened when the area is clicked +storyAreaTypeLink url:string = StoryAreaType; + //@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; @@ -3896,8 +3916,8 @@ storyArea position:storyAreaPosition type:StoryAreaType = StoryArea; //@class InputStoryAreaType @description Describes type of clickable rectangle area on a story media to be added -//@description An area pointing to a location @location The location -inputStoryAreaTypeLocation location:location = InputStoryAreaType; +//@description An area pointing to a location @location The location @address Address of the location; pass null if unknown +inputStoryAreaTypeLocation location:location address:locationAddress = InputStoryAreaType; //@description An area pointing to a venue found by the bot getOption("venue_search_bot_username") //@query_id Identifier of the inline query, used to found the venue @@ -3920,13 +3940,19 @@ inputStoryAreaTypeSuggestedReaction reaction_type:ReactionType is_dark:Bool is_f //@message_id Identifier of the message. Only successfully sent non-scheduled messages can be specified inputStoryAreaTypeMessage chat_id:int53 message_id:int53 = InputStoryAreaType; +//@description An area pointing to a HTTP or tg:// link +//@url HTTP or tg:// URL to be opened when the area is clicked +inputStoryAreaTypeLink url:string = InputStoryAreaType; + //@description Describes a clickable rectangle area on a story media to be added @position Position of the area @type Type of the area inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea; //@description Contains a list of story areas to be added @areas List of input story areas. Currently, a story can have //-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, -//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, and up to 1 inputStoryAreaTypeMessage area +//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, +//-up to 1 inputStoryAreaTypeMessage area, and +//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user inputStoryAreas areas:vector = InputStoryAreas; @@ -4033,6 +4059,9 @@ story id:int32 sender_chat_id:int53 sender_id:MessageSender date:int32 is_being_ //@pinned_story_ids Identifiers of the pinned stories; returned only in getChatPostedToChatPageStories with from_story_id == 0 stories total_count:int32 stories:vector pinned_story_ids:vector = Stories; +//@description Contains a list of stories found by a search @total_count Approximate total number of stories found @stories List of stories @next_offset The offset for the next request. If empty, then there are no more results +foundStories total_count:int32 stories:vector next_offset:string = FoundStories; + //@description Contains identifier of a story along with identifier of its sender //@sender_chat_id Identifier of the chat that posted the story //@story_id Unique story identifier among stories of the given sender @@ -4293,7 +4322,7 @@ callStateExchangingKeys = CallState; //@servers List of available call servers //@config A JSON-encoded call config //@encryption_key Call encryption key -//@emojis Encryption key emojis fingerprint +//@emojis Encryption key fingerprint represented as 4 emoji //@allow_p2p True, if peer-to-peer connection is allowed by users privacy settings //@custom_parameters Custom JSON-encoded call parameters to be passed to tgcalls callStateReady protocol:callProtocol servers:vector config:string encryption_key:bytes emojis:vector allow_p2p:Bool custom_parameters:string = CallState; @@ -5278,7 +5307,7 @@ premiumStoryFeatureCustomExpirationDuration = PremiumStoryFeature; //@description The ability to save other's unprotected stories premiumStoryFeatureSaveStories = PremiumStoryFeature; -//@description The ability to use links and formatting in story caption +//@description The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas premiumStoryFeatureLinksAndFormatting = PremiumStoryFeature; //@description The ability to choose better quality for viewed stories @@ -6846,18 +6875,18 @@ messageStatistics message_interaction_graph:StatisticalGraph message_reaction_gr storyStatistics story_interaction_graph:StatisticalGraph story_reaction_graph:StatisticalGraph = StoryStatistics; -//@class ChatRevenueWithdrawalState @description Describes state of a chat revenue withdrawal +//@class RevenueWithdrawalState @description Describes state of a revenue withdrawal //@description Withdrawal is pending -chatRevenueWithdrawalStatePending = ChatRevenueWithdrawalState; +revenueWithdrawalStatePending = RevenueWithdrawalState; -//@description Withdrawal was completed +//@description Withdrawal succeeded //@date Point in time (Unix timestamp) when the withdrawal was completed //@url The URL where the withdrawal transaction can be viewed -chatRevenueWithdrawalStateCompleted date:int32 url:string = ChatRevenueWithdrawalState; +revenueWithdrawalStateSucceeded date:int32 url:string = RevenueWithdrawalState; -//@description Withdrawal has_failed -chatRevenueWithdrawalStateFailed = ChatRevenueWithdrawalState; +//@description Withdrawal failed +revenueWithdrawalStateFailed = RevenueWithdrawalState; //@class ChatRevenueTransactionType @description Describes type of transaction for revenue earned from sponsored messages in a chat @@ -6871,7 +6900,7 @@ chatRevenueTransactionTypeEarnings start_date:int32 end_date:int32 = ChatRevenue //@withdrawal_date Point in time (Unix timestamp) when the earnings withdrawal started //@provider Name of the payment provider //@state State of the withdrawal -chatRevenueTransactionTypeWithdrawal withdrawal_date:int32 provider:string state:ChatRevenueWithdrawalState = ChatRevenueTransactionType; +chatRevenueTransactionTypeWithdrawal withdrawal_date:int32 provider:string state:RevenueWithdrawalState = ChatRevenueTransactionType; //@description Describes a refund for failed withdrawal of earnings //@refund_date Point in time (Unix timestamp) when the transaction was refunded @@ -6888,6 +6917,21 @@ chatRevenueTransaction cryptocurrency:string cryptocurrency_amount:int64 type:Ch chatRevenueTransactions total_count:int32 transactions:vector = ChatRevenueTransactions; +//@description Contains information about Telegram stars earned by a bot or a chat +//@total_count Total number of the stars earned +//@current_count The number of Telegram stars that aren't withdrawn yet +//@available_count The number of Telegram stars that are available for withdrawal +//@withdrawal_enabled True, if Telegram stars can be withdrawn now or later +//@next_withdrawal_in Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now +starRevenueStatus total_count:int53 current_count:int53 available_count:int53 withdrawal_enabled:Bool next_withdrawal_in:int32 = StarRevenueStatus; + +//@description A detailed statistics about Telegram stars earned by a bot or a chat +//@revenue_by_day_graph A graph containing amount of revenue in a given day +//@status Telegram star revenue status +//@usd_rate Current conversion rate of a Telegram star to USD +starRevenueStatistics revenue_by_day_graph:StatisticalGraph status:starRevenueStatus usd_rate:double = StarRevenueStatistics; + + //@description A point on a Cartesian plane @x The point's first coordinate @y The point's second coordinate point x:double y:double = Point; @@ -7409,6 +7453,11 @@ updateOwnedStarCount star_count:int53 = Update; //@revenue_amount New amount of earned revenue updateChatRevenueAmount chat_id:int53 revenue_amount:chatRevenueAmount = Update; +//@description The Telegram star revenue earned by a bot or a chat has changed. If star transactions screen of the chat is opened, then getStarTransactions may be called to fetch new transactions +//@owner_id Identifier of the owner of the Telegram stars +//@status New Telegram star revenue status +updateStarRevenueStatus owner_id:MessageSender status:starRevenueStatus = Update; + //@description The parameters of speech recognition without Telegram Premium subscription has changed //@max_media_duration The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds //@weekly_count The total number of allowed speech recognitions per week; 0 if none @@ -7491,6 +7540,15 @@ updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:in //@payload Query payload updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update; +//@description A new incoming callback query from a business message; for bots only +//@id Unique query identifier +//@sender_user_id Identifier of the user who sent the query +//@connection_id Unique identifier of the business connection +//@message The message from the business account from which the query originated +//@chat_instance An identifier uniquely corresponding to the chat a message was sent to +//@payload Query payload +updateNewBusinessCallbackQuery id:int64 sender_user_id:int53 connection_id:string message:businessMessage chat_instance:int64 payload:CallbackQueryPayload = Update; + //@description A new incoming shipping query; for bots only. Only for invoices with flexible price //@id Unique query identifier //@sender_user_id Identifier of the user who sent the query @@ -8071,20 +8129,39 @@ searchCallMessages offset:string limit:int32 only_missed:Bool = FoundMessages; //@limit The maximum number of messages to be returned; up to 100 searchOutgoingDocumentMessages query:string limit:int32 = FoundMessages; -//@description Searches for public channel posts with the given hashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -//@hashtag Hashtag to search for +//@description Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//@tag Hashtag or cashtag to search for //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit -searchPublicHashtagMessages hashtag:string offset:string limit:int32 = FoundMessages; +searchPublicMessagesByTag tag:string offset:string limit:int32 = FoundMessages; -//@description Returns recently searched for hashtags by their prefix @prefix Prefix of hashtags to return @limit The maximum number of hashtags to be returned -getSearchedForHashtags prefix:string limit:int32 = Hashtags; +//@description Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@tag Hashtag or cashtag to search for +//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByTag tag:string offset:string limit:int32 = FoundStories; -//@description Removes a hashtag from the list of recently searched for hashtags @hashtag Hashtag to delete -removeSearchedForHashtag hashtag:string = Ok; +//@description Searches for public stories by the given address location. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@address Address of the location +//@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 stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByLocation address:locationAddress offset:string limit:int32 = FoundStories; -//@description Clears the list of recently searched for hashtags -clearSearchedForHashtags = Ok; +//@description Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +//@venue_provider Provider of the venue +//@venue_id Identifier of the venue in the provider database +//@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 stories to be returned; up to 100. For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit +searchPublicStoriesByVenue venue_provider:string venue_id:string offset:string limit:int32 = FoundStories; + +//@description Returns recently searched for hashtags or cashtags by their prefix @tag_prefix Prefix of hashtags or cashtags to return @limit The maximum number of items to be returned +getSearchedForTags tag_prefix:string limit:int32 = Hashtags; + +//@description Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags @tag Hashtag or cashtag to delete +removeSearchedForTag tag:string = Ok; + +//@description Clears the list of recently searched for hashtags or cashtags @clear_cashtags Pass true to clear the list of recently searched for cashtags; otherwise, the list of recently searched for hashtags will be cleared +clearSearchedForTags clear_cashtags:Bool = Ok; //@description Deletes all call messages @revoke Pass true to delete the messages for all users deleteAllCallMessages revoke:Bool = Ok; @@ -8376,7 +8453,7 @@ editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:Messa //@description Changes the fact-check of a message. Can be only used if getOption("can_edit_fact_check") == true //@chat_id The channel chat the message belongs to -//@message_id Identifier of the message +//@message_id Identifier of the message. The message must be one of the following types: messageAnimation, messageAudio, messageDocument, messagePhoto, messageText, messageVideo //@text New text of the fact-check; 0-getOption("fact_check_length_max") characters; pass null to remove it. Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported setMessageFactCheck chat_id:int53 message_id:int53 text:formattedText = Ok; @@ -8403,6 +8480,57 @@ sendBusinessMessage business_connection_id:string chat_id:int53 reply_to:InputMe //@input_message_contents Contents of messages to be sent. At most 10 messages can be added to an album. All messages must have the same value of show_caption_above_media sendBusinessMessageAlbum business_connection_id:string chat_id:int53 reply_to:InputMessageReplyTo disable_notification:Bool protect_content:Bool effect_id:int64 input_message_contents:vector = BusinessMessages; +//@description Edits the text of a text or game message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@input_message_content New text content of the message. Must be of type inputMessageText +editBusinessMessageText business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; + +//@description Edits the content of a live location in a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@location New location content of the message; pass null to stop sharing the live location +//@live_period New time relative to the message send date, for which the location can be updated, in seconds. If 0x7FFFFFFF specified, then the location can be updated forever. +//-Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must remain in the next 90 days. Pass 0 to keep the current live_period +//@heading The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown +//@proximity_alert_radius The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled +editBusinessMessageLiveLocation business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup location:location live_period:int32 heading:int32 proximity_alert_radius:int32 = BusinessMessage; + +//@description Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none; for bots only +//@input_message_content New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo +editBusinessMessageMedia business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_message_content:InputMessageContent = BusinessMessage; + +//@description Edits the caption of a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters +//@show_caption_above_media Pass true to show the caption above the media; otherwise, caption will be shown below the media. Can be true only for animation, photo, and video messages +editBusinessMessageCaption business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = BusinessMessage; + +//@description Edits the reply markup of a message sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message +//@reply_markup The new message reply markup; pass null if none +editBusinessMessageReplyMarkup business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = BusinessMessage; + +//@description Stops a poll sent on behalf of a business account; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which the message with the poll was sent +//@chat_id The chat the message belongs to +//@message_id Identifier of the message containing the poll +//@reply_markup The new message reply markup; pass null if none +stopBusinessPoll business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup = BusinessMessage; + //@description Checks validness of a name for a quick reply shortcut. Can be called synchronously @name The name of the shortcut; 1-32 characters checkQuickReplyShortcutName name:string = Ok; @@ -8465,7 +8593,7 @@ readdQuickReplyShortcutMessages shortcut_name:string message_ids:vector = editQuickReplyMessage shortcut_id:int32 message_id:int53 input_message_content:InputMessageContent = Ok; -//@description Returns the list of custom emojis, which can be used as forum topic icon by all users +//@description Returns the list of custom emoji, which can be used as forum topic icon by all users getForumTopicDefaultIcons = Stickers; //@description Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right in the supergroup @@ -9878,7 +10006,7 @@ getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; //@description Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned //@sticker_type Type of the stickers to return -//@query Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers +//@query Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers //@limit The maximum number of stickers to be returned //@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers; @@ -9892,7 +10020,7 @@ getAllStickerEmojis sticker_type:StickerType query:string chat_id:int53 return_o //@description Searches for stickers from public sticker sets that correspond to any of the given emoji //@sticker_type Type of the stickers to return -//@emojis Space-separated list of emoji to search for; must be non-empty +//@emojis Space-separated list of emojis to search for; must be non-empty //@limit The maximum number of stickers to be returned; 0-100 searchStickers sticker_type:StickerType emojis:string limit:int32 = Stickers; @@ -9982,7 +10110,7 @@ searchEmojis text:string input_language_codes:vector = EmojiKeywords; //@input_language_codes List of possible IETF language tags of the user's input language; may be empty if unknown getKeywordEmojis text:string input_language_codes:vector = Emojis; -//@description Returns available emojis categories @type Type of emoji categories to return; pass null to get default emoji categories +//@description Returns available emoji categories @type Type of emoji categories to return; pass null to get default emoji categories getEmojiCategories type:EmojiCategoryType = EmojiCategories; //@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji @@ -10612,6 +10740,18 @@ getChatRevenueWithdrawalUrl chat_id:int53 password:string = HttpUrl; getChatRevenueTransactions chat_id:int53 offset:int32 limit:int32 = ChatRevenueTransactions; +//@description Returns detailed Telegram star revenue statistics +//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true +//@is_dark Pass true if a dark theme is used by the application +getStarRevenueStatistics owner_id:MessageSender is_dark:Bool = StarRevenueStatistics; + +//@description Returns URL for Telegram star withdrawal +//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true +//@star_count The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") +//@password The 2-step verification password of the current user +getStarWithdrawalUrl owner_id:MessageSender star_count:int53 password:string = HttpUrl; + + //@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics; @@ -10806,7 +10946,7 @@ setStickerPositionInSet sticker:InputFile position:int32 = Ok; //@description Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user @sticker Sticker to remove from the set removeStickerFromSet sticker:InputFile = Ok; -//@description Changes the list of emoji corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user +//@description Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set that is owned by the current user //@sticker Sticker //@emojis New string with 1-20 emoji corresponding to the sticker setStickerEmojis sticker:InputFile emojis:string = Ok; @@ -10878,10 +11018,13 @@ getPremiumGiveawayInfo chat_id:int53 message_id:int53 = PremiumGiveawayInfo; //@description Returns available options for Telegram stars purchase getStarPaymentOptions = StarPaymentOptions; -//@description Returns the list of Telegram star transactions for the current user -//@offset Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results +//@description Returns the list of Telegram star transactions for the specified owner +//@owner_id Identifier of the owner of the Telegram stars; can be the identifier of the current user, identifier of an owned bot, +//-or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true //@direction Direction of the transactions to receive; pass null to get all transactions -getStarTransactions offset:string direction:StarTransactionDirection = StarTransactions; +//@offset Offset of the first transaction to return as received from the previous request; use empty string to get the first chunk of results +//@limit The maximum number of transactions to return +getStarTransactions owner_id:MessageSender direction:StarTransactionDirection offset:string limit:int32 = StarTransactions; //@description Checks whether an in-store purchase is possible. Must be called before any in-store purchase @purpose Transaction purpose canPurchaseFromStore purpose:StorePaymentPurpose = Ok; diff --git a/example/bot/Bot.go b/example/bot/Bot.go index 4471dea..81e413c 100644 --- a/example/bot/Bot.go +++ b/example/bot/Bot.go @@ -86,7 +86,6 @@ func main() { m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContent: &tdlib.InputMessageText{ diff --git a/example/command/ReplyCommand.go b/example/command/ReplyCommand.go index 80015d3..bd118f2 100644 --- a/example/command/ReplyCommand.go +++ b/example/command/ReplyCommand.go @@ -97,7 +97,6 @@ func main() { m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContent: &tdlib.InputMessageText{ @@ -112,7 +111,6 @@ func main() { m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContent: &tdlib.InputMessageText{ diff --git a/example/event/CustomEventFilter.go b/example/event/CustomEventFilter.go index 1333934..72302ac 100644 --- a/example/event/CustomEventFilter.go +++ b/example/event/CustomEventFilter.go @@ -19,21 +19,19 @@ func GetSenderId(sender tdlib.MessageSender) int64 { func GetTdParameters() *tdlib.SetTdlibParametersRequest { return &tdlib.SetTdlibParametersRequest{ - UseTestDc: false, - DatabaseDirectory: "./tdlib-db", - FilesDirectory: "./tdlib-files", - UseFileDatabase: true, - UseChatInfoDatabase: true, - UseMessageDatabase: true, - UseSecretChats: false, - ApiId: 132712, - ApiHash: "e82c07ad653399a37baca8d1e498e472", - SystemLanguageCode: "en", - DeviceModel: "HuskyNG", - SystemVersion: "3.0", - ApplicationVersion: "3.0", - EnableStorageOptimizer: true, - IgnoreFileNames: false, + UseTestDc: false, + DatabaseDirectory: "./tdlib-db", + FilesDirectory: "./tdlib-files", + UseFileDatabase: true, + UseChatInfoDatabase: true, + UseMessageDatabase: true, + UseSecretChats: false, + ApiId: 132712, + ApiHash: "e82c07ad653399a37baca8d1e498e472", + SystemLanguageCode: "en", + DeviceModel: "HuskyNG", + SystemVersion: "3.0", + ApplicationVersion: "3.0", } } diff --git a/example/media/Photo_or_Album.go b/example/media/Photo_or_Album.go index 4caad1d..0b7138d 100644 --- a/example/media/Photo_or_Album.go +++ b/example/media/Photo_or_Album.go @@ -97,7 +97,6 @@ func main() { m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContent: &tdlib.InputMessagePhoto{ @@ -119,7 +118,6 @@ func main() { m, err := client.SendMessageAlbum(&tdlib.SendMessageAlbumRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContents: []tdlib.InputMessageContent{ diff --git a/example/pending/PendingUpdate.go b/example/pending/PendingUpdate.go index c314659..63d703a 100644 --- a/example/pending/PendingUpdate.go +++ b/example/pending/PendingUpdate.go @@ -91,7 +91,6 @@ func main() { m, err := client.SendMessage(&tdlib.SendMessageRequest{ ChatId: chatId, ReplyTo: &tdlib.InputMessageReplyToMessage{ - ChatId: chatId, MessageId: msgId, }, InputMessageContent: &tdlib.InputMessageText{