Update to TDLib 1.8.46

This commit is contained in:
c0re100 2025-03-07 22:22:55 +08:00
parent baee9b059d
commit 8de0893227
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1076 additions and 108 deletions

View file

@ -4085,7 +4085,7 @@ type SendQuickReplyShortcutMessagesRequest struct {
SendingId int32 `json:"sending_id"`
}
// Sends messages from a quick reply shortcut. Requires Telegram Business subscription
// Sends messages from a quick reply shortcut. Requires Telegram Business subscription. Can't be used to send paid messages
func (client *Client) SendQuickReplyShortcutMessages(req *SendQuickReplyShortcutMessagesRequest) (*Messages, error) {
result, err := client.Send(Request{
meta: meta{
@ -4115,6 +4115,8 @@ type ResendMessagesRequest struct {
MessageIds []int64 `json:"message_ids"`
// New manually chosen quote from the message to be replied; pass null if none. Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false
Quote *InputTextQuote `json:"quote"`
// The number of Telegram Stars the user agreed to pay to send the messages. Ignored if messageSendingStateFailed.required_paid_message_star_count == 0
PaidMessageStarCount int64 `json:"paid_message_star_count"`
}
// Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message
@ -4127,6 +4129,7 @@ func (client *Client) ResendMessages(req *ResendMessagesRequest) (*Messages, err
"chat_id": req.ChatId,
"message_ids": req.MessageIds,
"quote": req.Quote,
"paid_message_star_count": req.PaidMessageStarCount,
},
})
if err != nil {
@ -13249,7 +13252,7 @@ type CreateCallRequest struct {
Protocol *CallProtocol `json:"protocol"`
// Pass true to create a video call
IsVideo bool `json:"is_video"`
// Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none; currently, ignored
// Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none
GroupCallId int32 `json:"group_call_id"`
}
@ -13730,6 +13733,8 @@ type JoinGroupCallRequest struct {
IsMyVideoEnabled bool `json:"is_my_video_enabled"`
// If non-empty, invite hash to be used to join the group call without being muted by administrators
InviteHash string `json:"invite_hash"`
// Fingerprint of the encryption key for E2E group calls not bound to a chat; pass 0 for voice chats
KeyFingerprint JsonInt64 `json:"key_fingerprint"`
}
// Joins an active group call. Returns join response payload for tgcalls
@ -13746,6 +13751,7 @@ func (client *Client) JoinGroupCall(req *JoinGroupCallRequest) (*Text, error) {
"is_muted": req.IsMuted,
"is_my_video_enabled": req.IsMyVideoEnabled,
"invite_hash": req.InviteHash,
"key_fingerprint": req.KeyFingerprint,
},
})
if err != nil {
@ -14750,7 +14756,7 @@ type SuggestUserProfilePhotoRequest struct {
Photo InputChatPhoto `json:"photo"`
}
// Suggests a profile photo to another regular user with common messages
// Suggests a profile photo to another regular user with common messages and allowing non-paid messages
func (client *Client) SuggestUserProfilePhoto(req *SuggestUserProfilePhotoRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -16072,11 +16078,11 @@ func (client *Client) GetLinkPreview(req *GetLinkPreviewRequest) (*LinkPreview,
type GetWebPageInstantViewRequest struct {
// The web page URL
Url string `json:"url"`
// Pass true to get full instant view for the web page
ForceFull bool `json:"force_full"`
// Pass true to get only locally available information without sending network requests
OnlyLocal bool `json:"only_local"`
}
// Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page
// Returns an instant view version of a web page if available. This is an offline request if only_local is true. Returns a 404 error if the web page has no instant view page
func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) (*WebPageInstantView, error) {
result, err := client.Send(Request{
meta: meta{
@ -16084,7 +16090,7 @@ func (client *Client) GetWebPageInstantView(req *GetWebPageInstantViewRequest) (
},
Data: map[string]interface{}{
"url": req.Url,
"force_full": req.ForceFull,
"only_local": req.OnlyLocal,
},
})
if err != nil {
@ -18908,7 +18914,7 @@ type SendGiftRequest struct {
GiftId JsonInt64 `json:"gift_id"`
// Identifier of the user or the channel chat that will receive the gift
OwnerId MessageSender `json:"owner_id"`
// Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
// Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed. Must be empty if the receiver enabled paid messages
Text *FormattedText `json:"text"`
// Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them
IsPrivate bool `json:"is_private"`
@ -18974,7 +18980,7 @@ type ToggleGiftIsSavedRequest struct {
IsSaved bool `json:"is_saved"`
}
// Toggles whether a gift is shown on the current user's or the channel's profile page; requires can_post_messages administrator right in the chat
// Toggles whether a gift is shown on the current user's or the channel's profile page; requires can_post_messages administrator right in the channel chat
func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -18996,6 +19002,35 @@ func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, err
return UnmarshalOk(result.Data)
}
type SetPinnedGiftsRequest struct {
// Identifier of the user or the channel chat that received the gifts
OwnerId MessageSender `json:"owner_id"`
// New list of pinned gifts. All gifts must be upgraded and saved on the profile page first. There can be up to getOption("pinned_gift_count_max") pinned gifts
ReceivedGiftIds []string `json:"received_gift_ids"`
}
// Changes the list of pinned gifts on the current user's or the channel's profile page; requires can_post_messages administrator right in the channel chat
func (client *Client) SetPinnedGifts(req *SetPinnedGiftsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setPinnedGifts",
},
Data: map[string]interface{}{
"owner_id": req.OwnerId,
"received_gift_ids": req.ReceivedGiftIds,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ToggleChatGiftNotificationsRequest struct {
// Identifier of the channel chat
ChatId int64 `json:"chat_id"`
@ -20007,6 +20042,90 @@ func (client *Client) GetNewChatPrivacySettings() (*NewChatPrivacySettings, erro
return UnmarshalNewChatPrivacySettings(result.Data)
}
type GetPaidMessageRevenueRequest struct {
// Identifier of the user
UserId int64 `json:"user_id"`
}
// Returns the total number of Telegram Stars received by the current user for paid messages from the given user
func (client *Client) GetPaidMessageRevenue(req *GetPaidMessageRevenueRequest) (*StarCount, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPaidMessageRevenue",
},
Data: map[string]interface{}{
"user_id": req.UserId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalStarCount(result.Data)
}
type AllowUnpaidMessagesFromUserRequest struct {
// Identifier of the user
UserId int64 `json:"user_id"`
// Pass true to refund the user previously paid messages
RefundPayments bool `json:"refund_payments"`
}
// Allows the specified user to send unpaid private messages to the current user by adding a rule to userPrivacySettingAllowUnpaidMessages
func (client *Client) AllowUnpaidMessagesFromUser(req *AllowUnpaidMessagesFromUserRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "allowUnpaidMessagesFromUser",
},
Data: map[string]interface{}{
"user_id": req.UserId,
"refund_payments": req.RefundPayments,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetChatPaidMessageStarCountRequest struct {
// Identifier of the supergroup chat
ChatId int64 `json:"chat_id"`
// The new number of Telegram Stars that must be paid for each message that is sent to the supergroup chat unless the sender is an administrator of the chat; 0-getOption("paid_message_star_count_max"). The supergroup will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending
PaidMessageStarCount int64 `json:"paid_message_star_count"`
}
// Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages
func (client *Client) SetChatPaidMessageStarCount(req *SetChatPaidMessageStarCountRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setChatPaidMessageStarCount",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"paid_message_star_count": req.PaidMessageStarCount,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type CanSendMessageToUserRequest struct {
// Identifier of the other user
UserId int64 `json:"user_id"`
@ -20037,6 +20156,9 @@ func (client *Client) CanSendMessageToUser(req *CanSendMessageToUserRequest) (Ca
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(result.Data)
case TypeCanSendMessageToUserResultUserHasPaidMessages:
return UnmarshalCanSendMessageToUserResultUserHasPaidMessages(result.Data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(result.Data)
@ -20476,7 +20598,7 @@ func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactions
}
type GetStarRevenueStatisticsRequest struct {
// Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
// Identifier of the owner of the Telegram Stars; can be identifier of the current user, an owned bot, or a supergroup or a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
OwnerId MessageSender `json:"owner_id"`
// Pass true if a dark theme is used by the application
IsDark bool `json:"is_dark"`
@ -20505,7 +20627,7 @@ func (client *Client) GetStarRevenueStatistics(req *GetStarRevenueStatisticsRequ
}
type GetStarWithdrawalUrlRequest struct {
// Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of an owned channel chat
// Identifier of the owner of the Telegram Stars; can be identifier of the current user, an owned bot, or an owned supergroup or channel chat
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"`
@ -22236,16 +22358,35 @@ func (client *Client) GetPremiumState() (*PremiumState, error) {
return UnmarshalPremiumState(result.Data)
}
type GetPremiumGiftCodePaymentOptionsRequest struct {
// Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user; 0 if none
// Returns available options for gifting Telegram Premium to a user
func (client *Client) GetPremiumGiftPaymentOptions() (*PremiumGiftPaymentOptions, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPremiumGiftPaymentOptions",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalPremiumGiftPaymentOptions(result.Data)
}
type GetPremiumGiveawayPaymentOptionsRequest struct {
// Identifier of the supergroup or channel chat, which will be automatically boosted by receivers of the gift codes and which is administered by the user
BoostedChatId int64 `json:"boosted_chat_id"`
}
// Returns available options for Telegram Premium gift code or Telegram Premium giveaway creation
func (client *Client) GetPremiumGiftCodePaymentOptions(req *GetPremiumGiftCodePaymentOptionsRequest) (*PremiumGiftCodePaymentOptions, error) {
// Returns available options for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members
func (client *Client) GetPremiumGiveawayPaymentOptions(req *GetPremiumGiveawayPaymentOptionsRequest) (*PremiumGiveawayPaymentOptions, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPremiumGiftCodePaymentOptions",
Type: "getPremiumGiveawayPaymentOptions",
},
Data: map[string]interface{}{
"boosted_chat_id": req.BoostedChatId,
@ -22259,7 +22400,7 @@ func (client *Client) GetPremiumGiftCodePaymentOptions(req *GetPremiumGiftCodePa
return nil, buildResponseError(result.Data)
}
return UnmarshalPremiumGiftCodePaymentOptions(result.Data)
return UnmarshalPremiumGiveawayPaymentOptions(result.Data)
}
type CheckPremiumGiftCodeRequest struct {
@ -22452,7 +22593,7 @@ func (client *Client) GetStarGiveawayPaymentOptions() (*StarGiveawayPaymentOptio
}
type GetStarTransactionsRequest struct {
// Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
// Identifier of the owner of the Telegram Stars; can be the identifier of the current user, identifier of an owned bot, or identifier of a supergroup or a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
OwnerId MessageSender `json:"owner_id"`
// If non-empty, only transactions related to the Star Subscription will be returned
SubscriptionId string `json:"subscription_id"`

View file

@ -257,8 +257,10 @@ const (
ClassProductInfo = "ProductInfo"
ClassPremiumPaymentOption = "PremiumPaymentOption"
ClassPremiumStatePaymentOption = "PremiumStatePaymentOption"
ClassPremiumGiftCodePaymentOption = "PremiumGiftCodePaymentOption"
ClassPremiumGiftCodePaymentOptions = "PremiumGiftCodePaymentOptions"
ClassPremiumGiftPaymentOption = "PremiumGiftPaymentOption"
ClassPremiumGiftPaymentOptions = "PremiumGiftPaymentOptions"
ClassPremiumGiveawayPaymentOption = "PremiumGiveawayPaymentOption"
ClassPremiumGiveawayPaymentOptions = "PremiumGiveawayPaymentOptions"
ClassPremiumGiftCodeInfo = "PremiumGiftCodeInfo"
ClassStarPaymentOption = "StarPaymentOption"
ClassStarPaymentOptions = "StarPaymentOptions"
@ -371,6 +373,7 @@ const (
ClassFailedToAddMember = "FailedToAddMember"
ClassFailedToAddMembers = "FailedToAddMembers"
ClassCreatedBasicGroupChat = "CreatedBasicGroupChat"
ClassAccountInfo = "AccountInfo"
ClassKeyboardButton = "KeyboardButton"
ClassInlineKeyboardButton = "InlineKeyboardButton"
ClassThemeParameters = "ThemeParameters"
@ -568,6 +571,7 @@ const (
ClassText = "Text"
ClassSeconds = "Seconds"
ClassFileDownloadedPrefixSize = "FileDownloadedPrefixSize"
ClassStarCount = "StarCount"
ClassDeepLinkInfo = "DeepLinkInfo"
ClassProxy = "Proxy"
ClassProxies = "Proxies"
@ -762,8 +766,10 @@ const (
TypeProductInfo = "productInfo"
TypePremiumPaymentOption = "premiumPaymentOption"
TypePremiumStatePaymentOption = "premiumStatePaymentOption"
TypePremiumGiftCodePaymentOption = "premiumGiftCodePaymentOption"
TypePremiumGiftCodePaymentOptions = "premiumGiftCodePaymentOptions"
TypePremiumGiftPaymentOption = "premiumGiftPaymentOption"
TypePremiumGiftPaymentOptions = "premiumGiftPaymentOptions"
TypePremiumGiveawayPaymentOption = "premiumGiveawayPaymentOption"
TypePremiumGiveawayPaymentOptions = "premiumGiveawayPaymentOptions"
TypePremiumGiftCodeInfo = "premiumGiftCodeInfo"
TypeStarPaymentOption = "starPaymentOption"
TypeStarPaymentOptions = "starPaymentOptions"
@ -812,6 +818,9 @@ const (
TypeStarTransactionTypeChannelPaidReactionSend = "starTransactionTypeChannelPaidReactionSend"
TypeStarTransactionTypeChannelPaidReactionReceive = "starTransactionTypeChannelPaidReactionReceive"
TypeStarTransactionTypeAffiliateProgramCommission = "starTransactionTypeAffiliateProgramCommission"
TypeStarTransactionTypePaidMessageSend = "starTransactionTypePaidMessageSend"
TypeStarTransactionTypePaidMessageReceive = "starTransactionTypePaidMessageReceive"
TypeStarTransactionTypePremiumPurchase = "starTransactionTypePremiumPurchase"
TypeStarTransactionTypeUnsupported = "starTransactionTypeUnsupported"
TypeStarTransaction = "starTransaction"
TypeStarTransactions = "starTransactions"
@ -1005,6 +1014,7 @@ const (
TypeCreatedBasicGroupChat = "createdBasicGroupChat"
TypePublicChatTypeHasUsername = "publicChatTypeHasUsername"
TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased"
TypeAccountInfo = "accountInfo"
TypeChatActionBarReportSpam = "chatActionBarReportSpam"
TypeChatActionBarInviteMembers = "chatActionBarInviteMembers"
TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock"
@ -1755,11 +1765,13 @@ const (
TypeBusinessFeaturePromotionAnimation = "businessFeaturePromotionAnimation"
TypePremiumState = "premiumState"
TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription"
TypeStorePaymentPurposePremiumGift = "storePaymentPurposePremiumGift"
TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes"
TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway"
TypeStorePaymentPurposeStarGiveaway = "storePaymentPurposeStarGiveaway"
TypeStorePaymentPurposeStars = "storePaymentPurposeStars"
TypeStorePaymentPurposeGiftedStars = "storePaymentPurposeGiftedStars"
TypeTelegramPaymentPurposePremiumGift = "telegramPaymentPurposePremiumGift"
TypeTelegramPaymentPurposePremiumGiftCodes = "telegramPaymentPurposePremiumGiftCodes"
TypeTelegramPaymentPurposePremiumGiveaway = "telegramPaymentPurposePremiumGiveaway"
TypeTelegramPaymentPurposeStars = "telegramPaymentPurposeStars"
@ -1843,6 +1855,9 @@ const (
TypePushMessageContentVideoNote = "pushMessageContentVideoNote"
TypePushMessageContentVoiceNote = "pushMessageContentVoiceNote"
TypePushMessageContentBasicGroupChatCreate = "pushMessageContentBasicGroupChatCreate"
TypePushMessageContentVideoChatStarted = "pushMessageContentVideoChatStarted"
TypePushMessageContentVideoChatEnded = "pushMessageContentVideoChatEnded"
TypePushMessageContentInviteVideoChatParticipants = "pushMessageContentInviteVideoChatParticipants"
TypePushMessageContentChatAddMembers = "pushMessageContentChatAddMembers"
TypePushMessageContentChatChangePhoto = "pushMessageContentChatChangePhoto"
TypePushMessageContentChatChangeTitle = "pushMessageContentChatChangeTitle"
@ -1853,6 +1868,7 @@ const (
TypePushMessageContentChatJoinByRequest = "pushMessageContentChatJoinByRequest"
TypePushMessageContentRecurringPayment = "pushMessageContentRecurringPayment"
TypePushMessageContentSuggestProfilePhoto = "pushMessageContentSuggestProfilePhoto"
TypePushMessageContentProximityAlertTriggered = "pushMessageContentProximityAlertTriggered"
TypePushMessageContentMessageForwards = "pushMessageContentMessageForwards"
TypePushMessageContentMediaAlbum = "pushMessageContentMediaAlbum"
TypeNotificationTypeNewMessage = "notificationTypeNewMessage"
@ -1906,9 +1922,11 @@ const (
TypeUserPrivacySettingAllowFindingByPhoneNumber = "userPrivacySettingAllowFindingByPhoneNumber"
TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages"
TypeUserPrivacySettingAutosaveGifts = "userPrivacySettingAutosaveGifts"
TypeUserPrivacySettingAllowUnpaidMessages = "userPrivacySettingAllowUnpaidMessages"
TypeReadDatePrivacySettings = "readDatePrivacySettings"
TypeNewChatPrivacySettings = "newChatPrivacySettings"
TypeCanSendMessageToUserResultOk = "canSendMessageToUserResultOk"
TypeCanSendMessageToUserResultUserHasPaidMessages = "canSendMessageToUserResultUserHasPaidMessages"
TypeCanSendMessageToUserResultUserIsDeleted = "canSendMessageToUserResultUserIsDeleted"
TypeCanSendMessageToUserResultUserRestrictsNewChats = "canSendMessageToUserResultUserRestrictsNewChats"
TypeAccountTtl = "accountTtl"
@ -2090,6 +2108,7 @@ const (
TypeText = "text"
TypeSeconds = "seconds"
TypeFileDownloadedPrefixSize = "fileDownloadedPrefixSize"
TypeStarCount = "starCount"
TypeDeepLinkInfo = "deepLinkInfo"
TypeTextParseModeMarkdown = "textParseModeMarkdown"
TypeTextParseModeHTML = "textParseModeHTML"
@ -5975,6 +5994,8 @@ func (poll *Poll) UnmarshalJSON(data []byte) error {
// Describes an alternative re-encoded quality of a video file
type AlternativeVideo struct {
meta
// Unique identifier of the alternative video, which is used in the HLS file
Id JsonInt64 `json:"id"`
// Video width
Width int32 `json:"width"`
// Video height
@ -8148,15 +8169,71 @@ func (*PremiumStatePaymentOption) GetType() string {
return TypePremiumStatePaymentOption
}
// Describes an option for creating Telegram Premium gift codes or Telegram Premium giveaway. Use telegramPaymentPurposePremiumGiftCodes or telegramPaymentPurposePremiumGiveaway for out-of-store payments
type PremiumGiftCodePaymentOption struct {
// Describes an option for gifting Telegram Premium to a user. Use telegramPaymentPurposePremiumGift for out-of-store payments or payments in Telegram Stars
type PremiumGiftPaymentOption struct {
meta
// ISO 4217 currency code for the payment
Currency string `json:"currency"`
// The amount to pay, in the smallest units of the currency
Amount int64 `json:"amount"`
// The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible
StarCount int64 `json:"star_count"`
// The discount associated with this option, as a percentage
DiscountPercentage int32 `json:"discount_percentage"`
// Number of months the Telegram Premium subscription will be active
MonthCount int32 `json:"month_count"`
// Identifier of the store product associated with the option
StoreProductId string `json:"store_product_id"`
// A sticker to be shown along with the option; may be null if unknown
Sticker *Sticker `json:"sticker"`
}
func (entity *PremiumGiftPaymentOption) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumGiftPaymentOption
return json.Marshal((*stub)(entity))
}
func (*PremiumGiftPaymentOption) GetClass() string {
return ClassPremiumGiftPaymentOption
}
func (*PremiumGiftPaymentOption) GetType() string {
return TypePremiumGiftPaymentOption
}
// Contains a list of options for gifting Telegram Premium to a user
type PremiumGiftPaymentOptions struct {
meta
// The list of options sorted by Telegram Premium subscription duration
Options []*PremiumGiftPaymentOption `json:"options"`
}
func (entity *PremiumGiftPaymentOptions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumGiftPaymentOptions
return json.Marshal((*stub)(entity))
}
func (*PremiumGiftPaymentOptions) GetClass() string {
return ClassPremiumGiftPaymentOptions
}
func (*PremiumGiftPaymentOptions) GetType() string {
return TypePremiumGiftPaymentOptions
}
// Describes an option for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members. Use telegramPaymentPurposePremiumGiftCodes or telegramPaymentPurposePremiumGiveaway for out-of-store payments
type PremiumGiveawayPaymentOption struct {
meta
// ISO 4217 currency code for Telegram Premium gift code payment
Currency string `json:"currency"`
// The amount to pay, in the smallest units of the currency
Amount int64 `json:"amount"`
// The discount associated with this option, as a percentage
DiscountPercentage int32 `json:"discount_percentage"`
// Number of users which will be able to activate the gift codes
WinnerCount int32 `json:"winner_count"`
// Number of months the Telegram Premium subscription will be active
@ -8165,47 +8242,45 @@ type PremiumGiftCodePaymentOption struct {
StoreProductId string `json:"store_product_id"`
// Number of times the store product must be paid
StoreProductQuantity int32 `json:"store_product_quantity"`
// A sticker to be shown along with the gift code; may be null if unknown
Sticker *Sticker `json:"sticker"`
}
func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) {
func (entity *PremiumGiveawayPaymentOption) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumGiftCodePaymentOption
type stub PremiumGiveawayPaymentOption
return json.Marshal((*stub)(entity))
}
func (*PremiumGiftCodePaymentOption) GetClass() string {
return ClassPremiumGiftCodePaymentOption
func (*PremiumGiveawayPaymentOption) GetClass() string {
return ClassPremiumGiveawayPaymentOption
}
func (*PremiumGiftCodePaymentOption) GetType() string {
return TypePremiumGiftCodePaymentOption
func (*PremiumGiveawayPaymentOption) GetType() string {
return TypePremiumGiveawayPaymentOption
}
// Contains a list of options for creating Telegram Premium gift codes or Telegram Premium giveaway
type PremiumGiftCodePaymentOptions struct {
// Contains a list of options for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members
type PremiumGiveawayPaymentOptions struct {
meta
// The list of options
Options []*PremiumGiftCodePaymentOption `json:"options"`
Options []*PremiumGiveawayPaymentOption `json:"options"`
}
func (entity *PremiumGiftCodePaymentOptions) MarshalJSON() ([]byte, error) {
func (entity *PremiumGiveawayPaymentOptions) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumGiftCodePaymentOptions
type stub PremiumGiveawayPaymentOptions
return json.Marshal((*stub)(entity))
}
func (*PremiumGiftCodePaymentOptions) GetClass() string {
return ClassPremiumGiftCodePaymentOptions
func (*PremiumGiveawayPaymentOptions) GetClass() string {
return ClassPremiumGiveawayPaymentOptions
}
func (*PremiumGiftCodePaymentOptions) GetType() string {
return TypePremiumGiftCodePaymentOptions
func (*PremiumGiveawayPaymentOptions) GetType() string {
return TypePremiumGiveawayPaymentOptions
}
// Contains information about a Telegram Premium gift code
@ -8353,7 +8428,7 @@ func (*StarGiveawayWinnerOption) GetType() string {
return TypeStarGiveawayWinnerOption
}
// Describes an option for creating Telegram Star giveaway. Use telegramPaymentPurposeStarGiveaway for out-of-store payments
// Describes an option for creating of Telegram Star giveaway. Use telegramPaymentPurposeStarGiveaway for out-of-store payments
type StarGiveawayPaymentOption struct {
meta
// ISO 4217 currency code for the payment
@ -8390,7 +8465,7 @@ func (*StarGiveawayPaymentOption) GetType() string {
return TypeStarGiveawayPaymentOption
}
// Contains a list of options for creating Telegram Star giveaway
// Contains a list of options for creating of Telegram Star giveaway
type StarGiveawayPaymentOptions struct {
meta
// The list of options
@ -8833,6 +8908,8 @@ type ReceivedGift struct {
IsPrivate bool `json:"is_private"`
// True, if the gift is displayed on the chat's profile page; only for the receiver of the gift
IsSaved bool `json:"is_saved"`
// True, if the gift is pinned to the top of the chat's profile page
IsPinned bool `json:"is_pinned"`
// True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift
CanBeUpgraded bool `json:"can_be_upgraded"`
// True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift
@ -8876,6 +8953,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error {
Text *FormattedText `json:"text"`
IsPrivate bool `json:"is_private"`
IsSaved bool `json:"is_saved"`
IsPinned bool `json:"is_pinned"`
CanBeUpgraded bool `json:"can_be_upgraded"`
CanBeTransferred bool `json:"can_be_transferred"`
WasRefunded bool `json:"was_refunded"`
@ -8896,6 +8974,7 @@ func (receivedGift *ReceivedGift) UnmarshalJSON(data []byte) error {
receivedGift.Text = tmp.Text
receivedGift.IsPrivate = tmp.IsPrivate
receivedGift.IsSaved = tmp.IsSaved
receivedGift.IsPinned = tmp.IsPinned
receivedGift.CanBeUpgraded = tmp.CanBeUpgraded
receivedGift.CanBeTransferred = tmp.CanBeTransferred
receivedGift.WasRefunded = tmp.WasRefunded
@ -9178,7 +9257,7 @@ func (*StarTransactionTypeGiveawayDeposit) StarTransactionTypeType() string {
return TypeStarTransactionTypeGiveawayDeposit
}
// The transaction is a withdrawal of earned Telegram Stars to Fragment; for bots and channel chats only
// The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only
type StarTransactionTypeFragmentWithdrawal struct {
meta
// State of the withdrawal; may be null for refunds from Fragment
@ -9795,6 +9874,8 @@ func (*StarTransactionTypeGiftSale) StarTransactionTypeType() string {
// The transaction is an upgrade of a gift; for regular users only
type StarTransactionTypeGiftUpgrade struct {
meta
// Identifier of the user that initially sent the gift
UserId int64 `json:"user_id"`
// The upgraded gift
Gift *UpgradedGift `json:"gift"`
}
@ -9906,6 +9987,122 @@ func (*StarTransactionTypeAffiliateProgramCommission) StarTransactionTypeType()
return TypeStarTransactionTypeAffiliateProgramCommission
}
// The transaction is a sending of a paid message; for regular users only
type StarTransactionTypePaidMessageSend struct {
meta
// Identifier of the chat that received the payment
ChatId int64 `json:"chat_id"`
// Number of sent paid messages
MessageCount int32 `json:"message_count"`
}
func (entity *StarTransactionTypePaidMessageSend) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionTypePaidMessageSend
return json.Marshal((*stub)(entity))
}
func (*StarTransactionTypePaidMessageSend) GetClass() string {
return ClassStarTransactionType
}
func (*StarTransactionTypePaidMessageSend) GetType() string {
return TypeStarTransactionTypePaidMessageSend
}
func (*StarTransactionTypePaidMessageSend) StarTransactionTypeType() string {
return TypeStarTransactionTypePaidMessageSend
}
// The transaction is a receiving of a paid message; for regular users and supergroup chats only
type StarTransactionTypePaidMessageReceive struct {
meta
// Identifier of the sender of the message
SenderId MessageSender `json:"sender_id"`
// Number of received paid messages
MessageCount int32 `json:"message_count"`
// The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending
CommissionPerMille int32 `json:"commission_per_mille"`
// The amount of Telegram Stars that were received by Telegram; can be negative for refunds
CommissionStarAmount *StarAmount `json:"commission_star_amount"`
}
func (entity *StarTransactionTypePaidMessageReceive) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionTypePaidMessageReceive
return json.Marshal((*stub)(entity))
}
func (*StarTransactionTypePaidMessageReceive) GetClass() string {
return ClassStarTransactionType
}
func (*StarTransactionTypePaidMessageReceive) GetType() string {
return TypeStarTransactionTypePaidMessageReceive
}
func (*StarTransactionTypePaidMessageReceive) StarTransactionTypeType() string {
return TypeStarTransactionTypePaidMessageReceive
}
func (starTransactionTypePaidMessageReceive *StarTransactionTypePaidMessageReceive) UnmarshalJSON(data []byte) error {
var tmp struct {
SenderId json.RawMessage `json:"sender_id"`
MessageCount int32 `json:"message_count"`
CommissionPerMille int32 `json:"commission_per_mille"`
CommissionStarAmount *StarAmount `json:"commission_star_amount"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
starTransactionTypePaidMessageReceive.MessageCount = tmp.MessageCount
starTransactionTypePaidMessageReceive.CommissionPerMille = tmp.CommissionPerMille
starTransactionTypePaidMessageReceive.CommissionStarAmount = tmp.CommissionStarAmount
fieldSenderId, _ := UnmarshalMessageSender(tmp.SenderId)
starTransactionTypePaidMessageReceive.SenderId = fieldSenderId
return nil
}
// The transaction is a purchase of Telegram Premium subscription; for regular users only
type StarTransactionTypePremiumPurchase struct {
meta
// Identifier of the user that received the Telegram Premium subscription
UserId int64 `json:"user_id"`
// Number of months the Telegram Premium subscription will be active
MonthCount int32 `json:"month_count"`
// A sticker to be shown in the transaction information; may be null if unknown
Sticker *Sticker `json:"sticker"`
}
func (entity *StarTransactionTypePremiumPurchase) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionTypePremiumPurchase
return json.Marshal((*stub)(entity))
}
func (*StarTransactionTypePremiumPurchase) GetClass() string {
return ClassStarTransactionType
}
func (*StarTransactionTypePremiumPurchase) GetType() string {
return TypeStarTransactionTypePremiumPurchase
}
func (*StarTransactionTypePremiumPurchase) StarTransactionTypeType() string {
return TypeStarTransactionTypePremiumPurchase
}
// The transaction is a transaction of an unsupported type
type StarTransactionTypeUnsupported struct{
meta
@ -10611,6 +10808,8 @@ type User struct {
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
// True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them
RestrictsNewChats bool `json:"restricts_new_chats"`
// Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay
PaidMessageStarCount int64 `json:"paid_message_star_count"`
// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method
HaveAccess bool `json:"have_access"`
// Type of the user
@ -10662,6 +10861,7 @@ func (user *User) UnmarshalJSON(data []byte) error {
HasActiveStories bool `json:"has_active_stories"`
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
RestrictsNewChats bool `json:"restricts_new_chats"`
PaidMessageStarCount int64 `json:"paid_message_star_count"`
HaveAccess bool `json:"have_access"`
Type json.RawMessage `json:"type"`
LanguageCode string `json:"language_code"`
@ -10695,6 +10895,7 @@ func (user *User) UnmarshalJSON(data []byte) error {
user.HasActiveStories = tmp.HasActiveStories
user.HasUnreadActiveStories = tmp.HasUnreadActiveStories
user.RestrictsNewChats = tmp.RestrictsNewChats
user.PaidMessageStarCount = tmp.PaidMessageStarCount
user.HaveAccess = tmp.HaveAccess
user.LanguageCode = tmp.LanguageCode
user.AddedToAttachmentMenu = tmp.AddedToAttachmentMenu
@ -10877,6 +11078,10 @@ type UserFullInfo struct {
GiftCount int32 `json:"gift_count"`
// Number of group chats where both the other user and the current user are a member; 0 for the current user
GroupInCommonCount int32 `json:"group_in_common_count"`
// Number of Telegram Stars that must be paid by the user for each sent message to the current user
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
// Number of Telegram Stars that must be paid by the current user for each sent message to the user
OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"`
// Information about verification status of the user provided by a bot; may be null if none or unknown
BotVerification *BotVerification `json:"bot_verification"`
// Information about business settings for Telegram Business accounts; may be null if none
@ -10921,6 +11126,8 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
PersonalChatId int64 `json:"personal_chat_id"`
GiftCount int32 `json:"gift_count"`
GroupInCommonCount int32 `json:"group_in_common_count"`
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"`
BotVerification *BotVerification `json:"bot_verification"`
BusinessInfo *BusinessInfo `json:"business_info"`
BotInfo *BotInfo `json:"bot_info"`
@ -10948,6 +11155,8 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
userFullInfo.PersonalChatId = tmp.PersonalChatId
userFullInfo.GiftCount = tmp.GiftCount
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
userFullInfo.IncomingPaidMessageStarCount = tmp.IncomingPaidMessageStarCount
userFullInfo.OutgoingPaidMessageStarCount = tmp.OutgoingPaidMessageStarCount
userFullInfo.BotVerification = tmp.BotVerification
userFullInfo.BusinessInfo = tmp.BusinessInfo
userFullInfo.BotInfo = tmp.BotInfo
@ -12279,6 +12488,8 @@ type Supergroup struct {
HasSensitiveContent bool `json:"has_sensitive_content"`
// If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
RestrictionReason string `json:"restriction_reason"`
// Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message
PaidMessageStarCount int64 `json:"paid_message_star_count"`
// True, if the supergroup or channel has non-expired stories available to the current user
HasActiveStories bool `json:"has_active_stories"`
// True, if the supergroup or channel has unread non-expired stories available to the current user
@ -12323,6 +12534,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
VerificationStatus *VerificationStatus `json:"verification_status"`
HasSensitiveContent bool `json:"has_sensitive_content"`
RestrictionReason string `json:"restriction_reason"`
PaidMessageStarCount int64 `json:"paid_message_star_count"`
HasActiveStories bool `json:"has_active_stories"`
HasUnreadActiveStories bool `json:"has_unread_active_stories"`
}
@ -12351,6 +12563,7 @@ func (supergroup *Supergroup) UnmarshalJSON(data []byte) error {
supergroup.VerificationStatus = tmp.VerificationStatus
supergroup.HasSensitiveContent = tmp.HasSensitiveContent
supergroup.RestrictionReason = tmp.RestrictionReason
supergroup.PaidMessageStarCount = tmp.PaidMessageStarCount
supergroup.HasActiveStories = tmp.HasActiveStories
supergroup.HasUnreadActiveStories = tmp.HasUnreadActiveStories
@ -12381,6 +12594,8 @@ type SupergroupFullInfo struct {
SlowModeDelay int32 `json:"slow_mode_delay"`
// Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
SlowModeDelayExpiresIn float64 `json:"slow_mode_delay_expires_in"`
// True, if paid messages can be enabled in the supergroup chat; for supergroup only
CanEnablePaidMessages bool `json:"can_enable_paid_messages"`
// True, if paid reaction can be enabled in the channel chat; for channels only
CanEnablePaidReaction bool `json:"can_enable_paid_reaction"`
// True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers
@ -13767,6 +13982,8 @@ type MessageSendingStateFailed struct {
NeedAnotherReplyQuote bool `json:"need_another_reply_quote"`
// True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages
NeedDropReply bool `json:"need_drop_reply"`
// The number of Telegram Stars that must be paid to send the message; 0 if the current amount is correct
RequiredPaidMessageStarCount int64 `json:"required_paid_message_star_count"`
// Time left before the message can be re-sent, in seconds. No update is sent when this field changes
RetryAfter float64 `json:"retry_after"`
}
@ -14113,6 +14330,8 @@ type Message struct {
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
// Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead
SenderBoostCount int32 `json:"sender_boost_count"`
// The number of Telegram Stars the sender paid to send the message
PaidMessageStarCount int64 `json:"paid_message_star_count"`
// For channel posts and anonymous group messages, optional author signature
AuthorSignature string `json:"author_signature"`
// Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums
@ -14176,6 +14395,7 @@ func (message *Message) UnmarshalJSON(data []byte) error {
ViaBotUserId int64 `json:"via_bot_user_id"`
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
SenderBoostCount int32 `json:"sender_boost_count"`
PaidMessageStarCount int64 `json:"paid_message_star_count"`
AuthorSignature string `json:"author_signature"`
MediaAlbumId JsonInt64 `json:"media_album_id"`
EffectId JsonInt64 `json:"effect_id"`
@ -14214,6 +14434,7 @@ func (message *Message) UnmarshalJSON(data []byte) error {
message.ViaBotUserId = tmp.ViaBotUserId
message.SenderBusinessBotUserId = tmp.SenderBusinessBotUserId
message.SenderBoostCount = tmp.SenderBoostCount
message.PaidMessageStarCount = tmp.PaidMessageStarCount
message.AuthorSignature = tmp.AuthorSignature
message.MediaAlbumId = tmp.MediaAlbumId
message.EffectId = tmp.EffectId
@ -16643,6 +16864,37 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string {
return TypePublicChatTypeIsLocationBased
}
// Contains basic information about another user that started a chat with the current user
type AccountInfo struct {
meta
// Month when the user was registered in Telegram; 0-12; may be 0 if unknown
RegistrationMonth int32 `json:"registration_month"`
// Year when the user was registered in Telegram; 0-9999; may be 0 if unknown
RegistrationYear int32 `json:"registration_year"`
// A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user; may be empty if unknown
PhoneNumberCountryCode string `json:"phone_number_country_code"`
// Point in time (Unix timestamp) when the user changed name last time; 0 if unknown
LastNameChangeDate int32 `json:"last_name_change_date"`
// Point in time (Unix timestamp) when the user changed photo last time; 0 if unknown
LastPhotoChangeDate int32 `json:"last_photo_change_date"`
}
func (entity *AccountInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub AccountInfo
return json.Marshal((*stub)(entity))
}
func (*AccountInfo) GetClass() string {
return ClassAccountInfo
}
func (*AccountInfo) GetType() string {
return TypeAccountInfo
}
// The chat can be reported as spam using the method reportChat with an empty option_id and message_ids. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
type ChatActionBarReportSpam struct {
meta
@ -16700,6 +16952,8 @@ type ChatActionBarReportAddBlock struct {
meta
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
CanUnarchive bool `json:"can_unarchive"`
// Basic information about the other user in the chat; may be null if unknown
AccountInfo *AccountInfo `json:"account_info"`
}
func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) {
@ -28798,9 +29052,11 @@ type MessageSendOptions struct {
ProtectContent bool `json:"protect_content"`
// Pass true to allow the message to ignore regular broadcast limits for a small fee; for bots only
AllowPaidBroadcast bool `json:"allow_paid_broadcast"`
// The number of Telegram Stars the user agreed to pay to send the messages
PaidMessageStarCount int64 `json:"paid_message_star_count"`
// Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum
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
// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, 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; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats
EffectId JsonInt64 `json:"effect_id"`
@ -28832,6 +29088,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
FromBackground bool `json:"from_background"`
ProtectContent bool `json:"protect_content"`
AllowPaidBroadcast bool `json:"allow_paid_broadcast"`
PaidMessageStarCount int64 `json:"paid_message_star_count"`
UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"`
SchedulingState json.RawMessage `json:"scheduling_state"`
EffectId JsonInt64 `json:"effect_id"`
@ -28848,6 +29105,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
messageSendOptions.FromBackground = tmp.FromBackground
messageSendOptions.ProtectContent = tmp.ProtectContent
messageSendOptions.AllowPaidBroadcast = tmp.AllowPaidBroadcast
messageSendOptions.PaidMessageStarCount = tmp.PaidMessageStarCount
messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets
messageSendOptions.EffectId = tmp.EffectId
messageSendOptions.SendingId = tmp.SendingId
@ -34594,6 +34852,8 @@ type GroupCall struct {
meta
// Group call identifier
Id int32 `json:"id"`
// Identifier of one-to-one call from which the group call was created; 0 if unknown
FromCallId int32 `json:"from_call_id"`
// Group call title
Title string `json:"title"`
// Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended
@ -41754,10 +42014,43 @@ func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string
return TypeStorePaymentPurposePremiumSubscription
}
// The user creating Telegram Premium gift codes for other users
// The user gifting Telegram Premium to another user
type StorePaymentPurposePremiumGift struct {
meta
// ISO 4217 currency code of the payment currency
Currency string `json:"currency"`
// Paid amount, in the smallest units of the currency
Amount int64 `json:"amount"`
// Identifiers of the user which will receive Telegram Premium
UserId int64 `json:"user_id"`
// Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
Text *FormattedText `json:"text"`
}
func (entity *StorePaymentPurposePremiumGift) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorePaymentPurposePremiumGift
return json.Marshal((*stub)(entity))
}
func (*StorePaymentPurposePremiumGift) GetClass() string {
return ClassStorePaymentPurpose
}
func (*StorePaymentPurposePremiumGift) GetType() string {
return TypeStorePaymentPurposePremiumGift
}
func (*StorePaymentPurposePremiumGift) StorePaymentPurposeType() string {
return TypeStorePaymentPurposePremiumGift
}
// The user boosting a chat by creating Telegram Premium gift codes for other users
type StorePaymentPurposePremiumGiftCodes struct {
meta
// Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none
// Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user
BoostedChatId int64 `json:"boosted_chat_id"`
// ISO 4217 currency code of the payment currency
Currency string `json:"currency"`
@ -41919,10 +42212,45 @@ func (*StorePaymentPurposeGiftedStars) StorePaymentPurposeType() string {
return TypeStorePaymentPurposeGiftedStars
}
// The user creating Telegram Premium gift codes for other users
// The user gifting Telegram Premium to another user
type TelegramPaymentPurposePremiumGift struct {
meta
// ISO 4217 currency code of the payment currency
Currency string `json:"currency"`
// Paid amount, in the smallest units of the currency
Amount int64 `json:"amount"`
// Identifier of the user which will receive Telegram Premium
UserId int64 `json:"user_id"`
// Number of months the Telegram Premium subscription will be active for the user
MonthCount int32 `json:"month_count"`
// Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
Text *FormattedText `json:"text"`
}
func (entity *TelegramPaymentPurposePremiumGift) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TelegramPaymentPurposePremiumGift
return json.Marshal((*stub)(entity))
}
func (*TelegramPaymentPurposePremiumGift) GetClass() string {
return ClassTelegramPaymentPurpose
}
func (*TelegramPaymentPurposePremiumGift) GetType() string {
return TypeTelegramPaymentPurposePremiumGift
}
func (*TelegramPaymentPurposePremiumGift) TelegramPaymentPurposeType() string {
return TypeTelegramPaymentPurposePremiumGift
}
// The user boosting a chat by creating Telegram Premium gift codes for other users
type TelegramPaymentPurposePremiumGiftCodes struct {
meta
// Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user; 0 if none
// Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user
BoostedChatId int64 `json:"boosted_chat_id"`
// ISO 4217 currency code of the payment currency
Currency string `json:"currency"`
@ -44129,6 +44457,8 @@ func (*PushMessageContentSticker) PushMessageContentType() string {
// A message with a story
type PushMessageContentStory struct {
meta
// True, if the user was mentioned in the story
IsMention bool `json:"is_mention"`
// True, if the message is a pinned message with the specified content
IsPinned bool `json:"is_pinned"`
}
@ -44298,6 +44628,83 @@ func (*PushMessageContentBasicGroupChatCreate) PushMessageContentType() string {
return TypePushMessageContentBasicGroupChatCreate
}
// A video chat or live stream was started
type PushMessageContentVideoChatStarted struct{
meta
}
func (entity *PushMessageContentVideoChatStarted) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentVideoChatStarted
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentVideoChatStarted) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentVideoChatStarted) GetType() string {
return TypePushMessageContentVideoChatStarted
}
func (*PushMessageContentVideoChatStarted) PushMessageContentType() string {
return TypePushMessageContentVideoChatStarted
}
// A video chat or live stream has ended
type PushMessageContentVideoChatEnded struct{
meta
}
func (entity *PushMessageContentVideoChatEnded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentVideoChatEnded
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentVideoChatEnded) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentVideoChatEnded) GetType() string {
return TypePushMessageContentVideoChatEnded
}
func (*PushMessageContentVideoChatEnded) PushMessageContentType() string {
return TypePushMessageContentVideoChatEnded
}
// An invitation of participants to a video chat or live stream
type PushMessageContentInviteVideoChatParticipants struct {
meta
// True, if the current user was invited to the video chat or the live stream
IsCurrentUser bool `json:"is_current_user"`
}
func (entity *PushMessageContentInviteVideoChatParticipants) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentInviteVideoChatParticipants
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentInviteVideoChatParticipants) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentInviteVideoChatParticipants) GetType() string {
return TypePushMessageContentInviteVideoChatParticipants
}
func (*PushMessageContentInviteVideoChatParticipants) PushMessageContentType() string {
return TypePushMessageContentInviteVideoChatParticipants
}
// New chat members were invited to a group
type PushMessageContentChatAddMembers struct {
meta
@ -44568,6 +44975,33 @@ func (*PushMessageContentSuggestProfilePhoto) PushMessageContentType() string {
return TypePushMessageContentSuggestProfilePhoto
}
// A user in the chat came within proximity alert range from the current user
type PushMessageContentProximityAlertTriggered struct {
meta
// The distance to the user
Distance int32 `json:"distance"`
}
func (entity *PushMessageContentProximityAlertTriggered) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PushMessageContentProximityAlertTriggered
return json.Marshal((*stub)(entity))
}
func (*PushMessageContentProximityAlertTriggered) GetClass() string {
return ClassPushMessageContent
}
func (*PushMessageContentProximityAlertTriggered) GetType() string {
return TypePushMessageContentProximityAlertTriggered
}
func (*PushMessageContentProximityAlertTriggered) PushMessageContentType() string {
return TypePushMessageContentProximityAlertTriggered
}
// A forwarded messages
type PushMessageContentMessageForwards struct {
meta
@ -46091,6 +46525,31 @@ func (*UserPrivacySettingAutosaveGifts) UserPrivacySettingType() string {
return TypeUserPrivacySettingAutosaveGifts
}
// A privacy setting for managing whether the user can receive messages without additional payment
type UserPrivacySettingAllowUnpaidMessages struct{
meta
}
func (entity *UserPrivacySettingAllowUnpaidMessages) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UserPrivacySettingAllowUnpaidMessages
return json.Marshal((*stub)(entity))
}
func (*UserPrivacySettingAllowUnpaidMessages) GetClass() string {
return ClassUserPrivacySetting
}
func (*UserPrivacySettingAllowUnpaidMessages) GetType() string {
return TypeUserPrivacySettingAllowUnpaidMessages
}
func (*UserPrivacySettingAllowUnpaidMessages) UserPrivacySettingType() string {
return TypeUserPrivacySettingAllowUnpaidMessages
}
// Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting
type ReadDatePrivacySettings struct {
meta
@ -46114,11 +46573,13 @@ func (*ReadDatePrivacySettings) GetType() string {
return TypeReadDatePrivacySettings
}
// Contains privacy settings for new chats with non-contacts
// Contains privacy settings for chats with non-contacts
type NewChatPrivacySettings struct {
meta
// True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting
AllowNewChatsFromUnknownUsers bool `json:"allow_new_chats_from_unknown_users"`
// Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending
IncomingPaidMessageStarCount int64 `json:"incoming_paid_message_star_count"`
}
func (entity *NewChatPrivacySettings) MarshalJSON() ([]byte, error) {
@ -46162,6 +46623,33 @@ func (*CanSendMessageToUserResultOk) CanSendMessageToUserResultType() string {
return TypeCanSendMessageToUserResultOk
}
// The user can be messaged, but the messages are paid
type CanSendMessageToUserResultUserHasPaidMessages struct {
meta
// Number of Telegram Stars that must be paid by the current user for each sent message to the user
OutgoingPaidMessageStarCount int64 `json:"outgoing_paid_message_star_count"`
}
func (entity *CanSendMessageToUserResultUserHasPaidMessages) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub CanSendMessageToUserResultUserHasPaidMessages
return json.Marshal((*stub)(entity))
}
func (*CanSendMessageToUserResultUserHasPaidMessages) GetClass() string {
return ClassCanSendMessageToUserResult
}
func (*CanSendMessageToUserResultUserHasPaidMessages) GetType() string {
return TypeCanSendMessageToUserResultUserHasPaidMessages
}
func (*CanSendMessageToUserResultUserHasPaidMessages) CanSendMessageToUserResultType() string {
return TypeCanSendMessageToUserResultUserHasPaidMessages
}
// The user can't be messaged, because they are deleted or unknown
type CanSendMessageToUserResultUserIsDeleted struct{
meta
@ -48172,7 +48660,7 @@ func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string {
return TypeInternalLinkTypePremiumFeatures
}
// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGiftCodes payments or in-store purchases
// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases
type InternalLinkTypePremiumGift struct {
meta
// Referrer specified in the link
@ -51185,6 +51673,29 @@ func (*FileDownloadedPrefixSize) GetType() string {
return TypeFileDownloadedPrefixSize
}
// Contains a number of Telegram Stars
type StarCount struct {
meta
// Number of Telegram Stars
StarCount int64 `json:"star_count"`
}
func (entity *StarCount) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarCount
return json.Marshal((*stub)(entity))
}
func (*StarCount) GetClass() string {
return ClassStarCount
}
func (*StarCount) GetType() string {
return TypeStarCount
}
// Contains information about a tg: deep link
type DeepLinkInfo struct {
meta

View file

@ -922,6 +922,15 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er
case TypeStarTransactionTypeAffiliateProgramCommission:
return UnmarshalStarTransactionTypeAffiliateProgramCommission(data)
case TypeStarTransactionTypePaidMessageSend:
return UnmarshalStarTransactionTypePaidMessageSend(data)
case TypeStarTransactionTypePaidMessageReceive:
return UnmarshalStarTransactionTypePaidMessageReceive(data)
case TypeStarTransactionTypePremiumPurchase:
return UnmarshalStarTransactionTypePremiumPurchase(data)
case TypeStarTransactionTypeUnsupported:
return UnmarshalStarTransactionTypeUnsupported(data)
@ -5726,6 +5735,9 @@ func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, er
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposePremiumGift:
return UnmarshalStorePaymentPurposePremiumGift(data)
case TypeStorePaymentPurposePremiumGiftCodes:
return UnmarshalStorePaymentPurposePremiumGiftCodes(data)
@ -5769,6 +5781,9 @@ func UnmarshalTelegramPaymentPurpose(data json.RawMessage) (TelegramPaymentPurpo
}
switch meta.Type {
case TypeTelegramPaymentPurposePremiumGift:
return UnmarshalTelegramPaymentPurposePremiumGift(data)
case TypeTelegramPaymentPurposePremiumGiftCodes:
return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data)
@ -6311,6 +6326,15 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro
case TypePushMessageContentBasicGroupChatCreate:
return UnmarshalPushMessageContentBasicGroupChatCreate(data)
case TypePushMessageContentVideoChatStarted:
return UnmarshalPushMessageContentVideoChatStarted(data)
case TypePushMessageContentVideoChatEnded:
return UnmarshalPushMessageContentVideoChatEnded(data)
case TypePushMessageContentInviteVideoChatParticipants:
return UnmarshalPushMessageContentInviteVideoChatParticipants(data)
case TypePushMessageContentChatAddMembers:
return UnmarshalPushMessageContentChatAddMembers(data)
@ -6341,6 +6365,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro
case TypePushMessageContentSuggestProfilePhoto:
return UnmarshalPushMessageContentSuggestProfilePhoto(data)
case TypePushMessageContentProximityAlertTriggered:
return UnmarshalPushMessageContentProximityAlertTriggered(data)
case TypePushMessageContentMessageForwards:
return UnmarshalPushMessageContentMessageForwards(data)
@ -6678,6 +6705,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro
case TypeUserPrivacySettingAutosaveGifts:
return UnmarshalUserPrivacySettingAutosaveGifts(data)
case TypeUserPrivacySettingAllowUnpaidMessages:
return UnmarshalUserPrivacySettingAllowUnpaidMessages(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -6709,6 +6739,9 @@ func UnmarshalCanSendMessageToUserResult(data json.RawMessage) (CanSendMessageTo
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(data)
case TypeCanSendMessageToUserResultUserHasPaidMessages:
return UnmarshalCanSendMessageToUserResultUserHasPaidMessages(data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(data)
@ -9752,16 +9785,32 @@ func UnmarshalPremiumStatePaymentOption(data json.RawMessage) (*PremiumStatePaym
return &resp, err
}
func UnmarshalPremiumGiftCodePaymentOption(data json.RawMessage) (*PremiumGiftCodePaymentOption, error) {
var resp PremiumGiftCodePaymentOption
func UnmarshalPremiumGiftPaymentOption(data json.RawMessage) (*PremiumGiftPaymentOption, error) {
var resp PremiumGiftPaymentOption
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumGiftCodePaymentOptions(data json.RawMessage) (*PremiumGiftCodePaymentOptions, error) {
var resp PremiumGiftCodePaymentOptions
func UnmarshalPremiumGiftPaymentOptions(data json.RawMessage) (*PremiumGiftPaymentOptions, error) {
var resp PremiumGiftPaymentOptions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumGiveawayPaymentOption(data json.RawMessage) (*PremiumGiveawayPaymentOption, error) {
var resp PremiumGiveawayPaymentOption
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumGiveawayPaymentOptions(data json.RawMessage) (*PremiumGiveawayPaymentOptions, error) {
var resp PremiumGiveawayPaymentOptions
err := json.Unmarshal(data, &resp)
@ -10152,6 +10201,30 @@ func UnmarshalStarTransactionTypeAffiliateProgramCommission(data json.RawMessage
return &resp, err
}
func UnmarshalStarTransactionTypePaidMessageSend(data json.RawMessage) (*StarTransactionTypePaidMessageSend, error) {
var resp StarTransactionTypePaidMessageSend
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypePaidMessageReceive(data json.RawMessage) (*StarTransactionTypePaidMessageReceive, error) {
var resp StarTransactionTypePaidMessageReceive
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypePremiumPurchase(data json.RawMessage) (*StarTransactionTypePremiumPurchase, error) {
var resp StarTransactionTypePremiumPurchase
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypeUnsupported(data json.RawMessage) (*StarTransactionTypeUnsupported, error) {
var resp StarTransactionTypeUnsupported
@ -11696,6 +11769,14 @@ func UnmarshalPublicChatTypeIsLocationBased(data json.RawMessage) (*PublicChatTy
return &resp, err
}
func UnmarshalAccountInfo(data json.RawMessage) (*AccountInfo, error) {
var resp AccountInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatActionBarReportSpam(data json.RawMessage) (*ChatActionBarReportSpam, error) {
var resp ChatActionBarReportSpam
@ -17696,6 +17777,14 @@ func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*Sto
return &resp, err
}
func UnmarshalStorePaymentPurposePremiumGift(data json.RawMessage) (*StorePaymentPurposePremiumGift, error) {
var resp StorePaymentPurposePremiumGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStorePaymentPurposePremiumGiftCodes(data json.RawMessage) (*StorePaymentPurposePremiumGiftCodes, error) {
var resp StorePaymentPurposePremiumGiftCodes
@ -17736,6 +17825,14 @@ func UnmarshalStorePaymentPurposeGiftedStars(data json.RawMessage) (*StorePaymen
return &resp, err
}
func UnmarshalTelegramPaymentPurposePremiumGift(data json.RawMessage) (*TelegramPaymentPurposePremiumGift, error) {
var resp TelegramPaymentPurposePremiumGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalTelegramPaymentPurposePremiumGiftCodes(data json.RawMessage) (*TelegramPaymentPurposePremiumGiftCodes, error) {
var resp TelegramPaymentPurposePremiumGiftCodes
@ -18400,6 +18497,30 @@ func UnmarshalPushMessageContentBasicGroupChatCreate(data json.RawMessage) (*Pus
return &resp, err
}
func UnmarshalPushMessageContentVideoChatStarted(data json.RawMessage) (*PushMessageContentVideoChatStarted, error) {
var resp PushMessageContentVideoChatStarted
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPushMessageContentVideoChatEnded(data json.RawMessage) (*PushMessageContentVideoChatEnded, error) {
var resp PushMessageContentVideoChatEnded
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPushMessageContentInviteVideoChatParticipants(data json.RawMessage) (*PushMessageContentInviteVideoChatParticipants, error) {
var resp PushMessageContentInviteVideoChatParticipants
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPushMessageContentChatAddMembers(data json.RawMessage) (*PushMessageContentChatAddMembers, error) {
var resp PushMessageContentChatAddMembers
@ -18480,6 +18601,14 @@ func UnmarshalPushMessageContentSuggestProfilePhoto(data json.RawMessage) (*Push
return &resp, err
}
func UnmarshalPushMessageContentProximityAlertTriggered(data json.RawMessage) (*PushMessageContentProximityAlertTriggered, error) {
var resp PushMessageContentProximityAlertTriggered
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPushMessageContentMessageForwards(data json.RawMessage) (*PushMessageContentMessageForwards, error) {
var resp PushMessageContentMessageForwards
@ -18904,6 +19033,14 @@ func UnmarshalUserPrivacySettingAutosaveGifts(data json.RawMessage) (*UserPrivac
return &resp, err
}
func UnmarshalUserPrivacySettingAllowUnpaidMessages(data json.RawMessage) (*UserPrivacySettingAllowUnpaidMessages, error) {
var resp UserPrivacySettingAllowUnpaidMessages
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalReadDatePrivacySettings(data json.RawMessage) (*ReadDatePrivacySettings, error) {
var resp ReadDatePrivacySettings
@ -18928,6 +19065,14 @@ func UnmarshalCanSendMessageToUserResultOk(data json.RawMessage) (*CanSendMessag
return &resp, err
}
func UnmarshalCanSendMessageToUserResultUserHasPaidMessages(data json.RawMessage) (*CanSendMessageToUserResultUserHasPaidMessages, error) {
var resp CanSendMessageToUserResultUserHasPaidMessages
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCanSendMessageToUserResultUserIsDeleted(data json.RawMessage) (*CanSendMessageToUserResultUserIsDeleted, error) {
var resp CanSendMessageToUserResultUserIsDeleted
@ -20376,6 +20521,14 @@ func UnmarshalFileDownloadedPrefixSize(data json.RawMessage) (*FileDownloadedPre
return &resp, err
}
func UnmarshalStarCount(data json.RawMessage) (*StarCount, error) {
var resp StarCount
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDeepLinkInfo(data json.RawMessage) (*DeepLinkInfo, error) {
var resp DeepLinkInfo
@ -22596,11 +22749,17 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumStatePaymentOption:
return UnmarshalPremiumStatePaymentOption(data)
case TypePremiumGiftCodePaymentOption:
return UnmarshalPremiumGiftCodePaymentOption(data)
case TypePremiumGiftPaymentOption:
return UnmarshalPremiumGiftPaymentOption(data)
case TypePremiumGiftCodePaymentOptions:
return UnmarshalPremiumGiftCodePaymentOptions(data)
case TypePremiumGiftPaymentOptions:
return UnmarshalPremiumGiftPaymentOptions(data)
case TypePremiumGiveawayPaymentOption:
return UnmarshalPremiumGiveawayPaymentOption(data)
case TypePremiumGiveawayPaymentOptions:
return UnmarshalPremiumGiveawayPaymentOptions(data)
case TypePremiumGiftCodeInfo:
return UnmarshalPremiumGiftCodeInfo(data)
@ -22746,6 +22905,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarTransactionTypeAffiliateProgramCommission:
return UnmarshalStarTransactionTypeAffiliateProgramCommission(data)
case TypeStarTransactionTypePaidMessageSend:
return UnmarshalStarTransactionTypePaidMessageSend(data)
case TypeStarTransactionTypePaidMessageReceive:
return UnmarshalStarTransactionTypePaidMessageReceive(data)
case TypeStarTransactionTypePremiumPurchase:
return UnmarshalStarTransactionTypePremiumPurchase(data)
case TypeStarTransactionTypeUnsupported:
return UnmarshalStarTransactionTypeUnsupported(data)
@ -23325,6 +23493,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePublicChatTypeIsLocationBased:
return UnmarshalPublicChatTypeIsLocationBased(data)
case TypeAccountInfo:
return UnmarshalAccountInfo(data)
case TypeChatActionBarReportSpam:
return UnmarshalChatActionBarReportSpam(data)
@ -25575,6 +25746,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposePremiumGift:
return UnmarshalStorePaymentPurposePremiumGift(data)
case TypeStorePaymentPurposePremiumGiftCodes:
return UnmarshalStorePaymentPurposePremiumGiftCodes(data)
@ -25590,6 +25764,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStorePaymentPurposeGiftedStars:
return UnmarshalStorePaymentPurposeGiftedStars(data)
case TypeTelegramPaymentPurposePremiumGift:
return UnmarshalTelegramPaymentPurposePremiumGift(data)
case TypeTelegramPaymentPurposePremiumGiftCodes:
return UnmarshalTelegramPaymentPurposePremiumGiftCodes(data)
@ -25839,6 +26016,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePushMessageContentBasicGroupChatCreate:
return UnmarshalPushMessageContentBasicGroupChatCreate(data)
case TypePushMessageContentVideoChatStarted:
return UnmarshalPushMessageContentVideoChatStarted(data)
case TypePushMessageContentVideoChatEnded:
return UnmarshalPushMessageContentVideoChatEnded(data)
case TypePushMessageContentInviteVideoChatParticipants:
return UnmarshalPushMessageContentInviteVideoChatParticipants(data)
case TypePushMessageContentChatAddMembers:
return UnmarshalPushMessageContentChatAddMembers(data)
@ -25869,6 +26055,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePushMessageContentSuggestProfilePhoto:
return UnmarshalPushMessageContentSuggestProfilePhoto(data)
case TypePushMessageContentProximityAlertTriggered:
return UnmarshalPushMessageContentProximityAlertTriggered(data)
case TypePushMessageContentMessageForwards:
return UnmarshalPushMessageContentMessageForwards(data)
@ -26028,6 +26217,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUserPrivacySettingAutosaveGifts:
return UnmarshalUserPrivacySettingAutosaveGifts(data)
case TypeUserPrivacySettingAllowUnpaidMessages:
return UnmarshalUserPrivacySettingAllowUnpaidMessages(data)
case TypeReadDatePrivacySettings:
return UnmarshalReadDatePrivacySettings(data)
@ -26037,6 +26229,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeCanSendMessageToUserResultOk:
return UnmarshalCanSendMessageToUserResultOk(data)
case TypeCanSendMessageToUserResultUserHasPaidMessages:
return UnmarshalCanSendMessageToUserResultUserHasPaidMessages(data)
case TypeCanSendMessageToUserResultUserIsDeleted:
return UnmarshalCanSendMessageToUserResultUserIsDeleted(data)
@ -26580,6 +26775,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeFileDownloadedPrefixSize:
return UnmarshalFileDownloadedPrefixSize(data)
case TypeStarCount:
return UnmarshalStarCount(data)
case TypeDeepLinkInfo:
return UnmarshalDeepLinkInfo(data)