Update to TDLib 1.8.44

This commit is contained in:
c0re100 2025-01-25 06:30:12 +08:00
parent 2a5a6d2b76
commit bda4018ed3
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1211 additions and 259 deletions

View file

@ -1931,6 +1931,90 @@ func (client *Client) OpenChatSimilarChat(req *OpenChatSimilarChatRequest) (*Ok,
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type GetBotSimilarBotsRequest struct {
// User identifier of the target bot
BotUserId int64 `json:"bot_user_id"`
}
// Returns a list of bots similar to the given bot
func (client *Client) GetBotSimilarBots(req *GetBotSimilarBotsRequest) (*Users, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getBotSimilarBots",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalUsers(result.Data)
}
type GetBotSimilarBotCountRequest struct {
// User identifier of the target bot
BotUserId int64 `json:"bot_user_id"`
// Pass true to get the number of bots without sending network requests, or -1 if the number of bots is unknown locally
ReturnLocal bool `json:"return_local"`
}
// Returns approximate number of bots similar to the given bot
func (client *Client) GetBotSimilarBotCount(req *GetBotSimilarBotCountRequest) (*Count, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getBotSimilarBotCount",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"return_local": req.ReturnLocal,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalCount(result.Data)
}
type OpenBotSimilarBotRequest struct {
// Identifier of the original bot, which similar bots were requested
BotUserId int64 `json:"bot_user_id"`
// Identifier of the opened bot
OpenedBotUserId int64 `json:"opened_bot_user_id"`
}
// Informs TDLib that a bot was opened from the list of similar bots
func (client *Client) OpenBotSimilarBot(req *OpenBotSimilarBotRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "openBotSimilarBot",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"opened_bot_user_id": req.OpenedBotUserId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetTopChatsRequest struct { type GetTopChatsRequest struct {
// Category of chats to be returned // Category of chats to be returned
Category TopChatCategory `json:"category"` Category TopChatCategory `json:"category"`
@ -4159,7 +4243,7 @@ type DeleteChatMessagesBySenderRequest struct {
SenderId MessageSender `json:"sender_id"` SenderId MessageSender `json:"sender_id"`
} }
// Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges // Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator right
func (client *Client) DeleteChatMessagesBySender(req *DeleteChatMessagesBySenderRequest) (*Ok, error) { func (client *Client) DeleteChatMessagesBySender(req *DeleteChatMessagesBySenderRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -8117,6 +8201,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypeUnsupportedProxy: case TypeInternalLinkTypeUnsupportedProxy:
return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data) return UnmarshalInternalLinkTypeUnsupportedProxy(result.Data)
case TypeInternalLinkTypeUpgradedGift:
return UnmarshalInternalLinkTypeUpgradedGift(result.Data)
case TypeInternalLinkTypeUserPhoneNumber: case TypeInternalLinkTypeUserPhoneNumber:
return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data) return UnmarshalInternalLinkTypeUserPhoneNumber(result.Data)
@ -11789,7 +11876,7 @@ func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAt
} }
// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status // Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status
func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) { func (client *Client) GetThemedEmojiStatuses() (*EmojiStatusCustomEmojis, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getThemedEmojiStatuses", Type: "getThemedEmojiStatuses",
@ -11804,7 +11891,7 @@ func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatusCustomEmojis(result.Data)
} }
// Returns recent emoji statuses for self status // Returns recent emoji statuses for self status
@ -11826,8 +11913,27 @@ func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) {
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatuses(result.Data)
} }
// Returns available upgraded gift emoji statuses for self status
func (client *Client) GetUpgradedGiftEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getUpgradedGiftEmojiStatuses",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojiStatuses(result.Data)
}
// Returns default emoji statuses for self status // Returns default emoji statuses for self status
func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) { func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatusCustomEmojis, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getDefaultEmojiStatuses", Type: "getDefaultEmojiStatuses",
@ -11842,7 +11948,7 @@ func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatusCustomEmojis(result.Data)
} }
// Clears the list of recently used emoji statuses for self status // Clears the list of recently used emoji statuses for self status
@ -11865,7 +11971,7 @@ func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) {
} }
// Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats // Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats
func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatuses, error) { func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatusCustomEmojis, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getThemedChatEmojiStatuses", Type: "getThemedChatEmojiStatuses",
@ -11880,11 +11986,11 @@ func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatuses, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatusCustomEmojis(result.Data)
} }
// Returns default emoji statuses for chats // Returns default emoji statuses for chats
func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatuses, error) { func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatusCustomEmojis, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getDefaultChatEmojiStatuses", Type: "getDefaultChatEmojiStatuses",
@ -11899,11 +12005,11 @@ func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatuses, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatusCustomEmojis(result.Data)
} }
// Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true // Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true
func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatuses, error) { func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatusCustomEmojis, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getDisallowedChatEmojiStatuses", Type: "getDisallowedChatEmojiStatuses",
@ -11918,7 +12024,7 @@ func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatuses, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalEmojiStatuses(result.Data) return UnmarshalEmojiStatusCustomEmojis(result.Data)
} }
type DownloadFileRequest struct { type DownloadFileRequest struct {
@ -18755,7 +18861,7 @@ func (client *Client) DeleteSavedCredentials() (*Ok, error) {
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
// Returns gifts that can be sent to other users // Returns gifts that can be sent to other users and channel chats
func (client *Client) GetAvailableGifts() (*Gifts, error) { func (client *Client) GetAvailableGifts() (*Gifts, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -18777,17 +18883,17 @@ func (client *Client) GetAvailableGifts() (*Gifts, error) {
type SendGiftRequest struct { type SendGiftRequest struct {
// Identifier of the gift to send // Identifier of the gift to send
GiftId JsonInt64 `json:"gift_id"` GiftId JsonInt64 `json:"gift_id"`
// Identifier of the user that will receive the gift // Identifier of the user or the channel chat that will receive the gift
UserId int64 `json:"user_id"` 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
Text *FormattedText `json:"text"` Text *FormattedText `json:"text"`
// Pass true to show the current user as sender and gift text only to the gift receiver; otherwise, everyone will be able to see them // 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"` IsPrivate bool `json:"is_private"`
// Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free // Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free
PayForUpgrade bool `json:"pay_for_upgrade"` PayForUpgrade bool `json:"pay_for_upgrade"`
} }
// Sends a gift to another user. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out // Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out
func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) { func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -18795,7 +18901,7 @@ func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) {
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"gift_id": req.GiftId, "gift_id": req.GiftId,
"user_id": req.UserId, "owner_id": req.OwnerId,
"text": req.Text, "text": req.Text,
"is_private": req.IsPrivate, "is_private": req.IsPrivate,
"pay_for_upgrade": req.PayForUpgrade, "pay_for_upgrade": req.PayForUpgrade,
@ -18813,21 +18919,18 @@ func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) {
} }
type SellGiftRequest struct { type SellGiftRequest struct {
// Identifier of the user that sent the gift // Identifier of the gift
SenderUserId int64 `json:"sender_user_id"` ReceivedGiftId string `json:"received_gift_id"`
// Identifier of the message with the gift in the chat with the user
MessageId int64 `json:"message_id"`
} }
// Sells a gift received by the current user for Telegram Stars // Sells a gift for Telegram Stars
func (client *Client) SellGift(req *SellGiftRequest) (*Ok, error) { func (client *Client) SellGift(req *SellGiftRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "sellGift", Type: "sellGift",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sender_user_id": req.SenderUserId, "received_gift_id": req.ReceivedGiftId,
"message_id": req.MessageId,
}, },
}) })
if err != nil { if err != nil {
@ -18842,23 +18945,20 @@ func (client *Client) SellGift(req *SellGiftRequest) (*Ok, error) {
} }
type ToggleGiftIsSavedRequest struct { type ToggleGiftIsSavedRequest struct {
// Identifier of the user that sent the gift // Identifier of the gift
SenderUserId int64 `json:"sender_user_id"` ReceivedGiftId string `json:"received_gift_id"`
// Identifier of the message with the gift in the chat with the user // Pass true to display the gift on the user's or the channel's profile page; pass false to remove it from the profile page
MessageId int64 `json:"message_id"`
// Pass true to display the gift on the user's profile page; pass false to remove it from the profile page
IsSaved bool `json:"is_saved"` IsSaved bool `json:"is_saved"`
} }
// Toggles whether a gift is shown on the current user's profile page // 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
func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, error) { func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "toggleGiftIsSaved", Type: "toggleGiftIsSaved",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sender_user_id": req.SenderUserId, "received_gift_id": req.ReceivedGiftId,
"message_id": req.MessageId,
"is_saved": req.IsSaved, "is_saved": req.IsSaved,
}, },
}) })
@ -18873,6 +18973,35 @@ func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, err
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type ToggleChatGiftNotificationsRequest struct {
// Identifier of the channel chat
ChatId int64 `json:"chat_id"`
// Pass true to enable notifications about new gifts owned by the channel chat; pass false to disable the notifications
AreEnabled bool `json:"are_enabled"`
}
// Toggles whether notifications for new gifts received by a channel chat are sent to the current user; requires can_post_messages administrator right in the chat
func (client *Client) ToggleChatGiftNotifications(req *ToggleChatGiftNotificationsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleChatGiftNotifications",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"are_enabled": req.AreEnabled,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetGiftUpgradePreviewRequest struct { type GetGiftUpgradePreviewRequest struct {
// Identifier of the gift // Identifier of the gift
GiftId JsonInt64 `json:"gift_id"` GiftId JsonInt64 `json:"gift_id"`
@ -18900,24 +19029,24 @@ func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) (
} }
type UpgradeGiftRequest struct { type UpgradeGiftRequest struct {
// Identifier of the user that sent the gift // Identifier of the gift
SenderUserId int64 `json:"sender_user_id"` ReceivedGiftId string `json:"received_gift_id"`
// Identifier of the message with the gift in the chat with the user
MessageId int64 `json:"message_id"`
// Pass true to keep the original gift text, sender and receiver in the upgraded gift // Pass true to keep the original gift text, sender and receiver in the upgraded gift
KeepOriginalDetails bool `json:"keep_original_details"` KeepOriginalDetails bool `json:"keep_original_details"`
// The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count
StarCount int64 `json:"star_count"`
} }
// Upgrades a gift received by the current user. Unless the gift has prepaid_upgrade_star_count > 0, the user must pay gift.upgrade_star_count Telegram Stars for the upgrade // Upgrades a regular gift
func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult, error) { func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "upgradeGift", Type: "upgradeGift",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sender_user_id": req.SenderUserId, "received_gift_id": req.ReceivedGiftId,
"message_id": req.MessageId,
"keep_original_details": req.KeepOriginalDetails, "keep_original_details": req.KeepOriginalDetails,
"star_count": req.StarCount,
}, },
}) })
if err != nil { if err != nil {
@ -18932,26 +19061,23 @@ func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult,
} }
type TransferGiftRequest struct { type TransferGiftRequest struct {
// Identifier of the user that sent the gift // Identifier of the gift
SenderUserId int64 `json:"sender_user_id"` ReceivedGiftId string `json:"received_gift_id"`
// Identifier of the message with the upgraded gift in the chat with the user // Identifier of the user or the channel chat that will receive the gift
MessageId int64 `json:"message_id"` NewOwnerId MessageSender `json:"new_owner_id"`
// Identifier of the user that will receive the gift // The amount of Telegram Stars required to pay for the transfer
ReceiverUserId int64 `json:"receiver_user_id"`
// The amount of Telegram Stars required for the transfer
StarCount int64 `json:"star_count"` StarCount int64 `json:"star_count"`
} }
// Sends a gift upgraded by the current user to another user // Sends an upgraded gift to another user or a channel chat
func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) { func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "transferGift", Type: "transferGift",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sender_user_id": req.SenderUserId, "received_gift_id": req.ReceivedGiftId,
"message_id": req.MessageId, "new_owner_id": req.NewOwnerId,
"receiver_user_id": req.ReceiverUserId,
"star_count": req.StarCount, "star_count": req.StarCount,
}, },
}) })
@ -18966,23 +19092,41 @@ func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) {
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type GetUserGiftsRequest struct { type GetReceivedGiftsRequest struct {
// Identifier of the user // Identifier of the gift receiver
UserId int64 `json:"user_id"` OwnerId MessageSender `json:"owner_id"`
// Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right
ExcludeUnsaved bool `json:"exclude_unsaved"`
// Pass true to exclude gifts that are saved to the chat's profile page; for channel chats with can_post_messages administrator right only
ExcludeSaved bool `json:"exclude_saved"`
// Pass true to exclude gifts that can be purchased unlimited number of times; for channel chats with can_post_messages administrator right only
ExcludeUnlimited bool `json:"exclude_unlimited"`
// Pass true to exclude gifts that can be purchased limited number of times; for channel chats with can_post_messages administrator right only
ExcludeLimited bool `json:"exclude_limited"`
// Pass true to exclude upgraded gifts; for channel chats with can_post_messages administrator right only
ExcludeUpgraded bool `json:"exclude_upgraded"`
// Pass true to sort results by gift price instead of send date; for channel chats with can_post_messages administrator right only
SortByPrice bool `json:"sort_by_price"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results // 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"` Offset string `json:"offset"`
// The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit // The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
} }
// Returns gifts saved to profile by the given user // Returns gifts received by the given user or chat
func (client *Client) GetUserGifts(req *GetUserGiftsRequest) (*UserGifts, error) { func (client *Client) GetReceivedGifts(req *GetReceivedGiftsRequest) (*ReceivedGifts, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getUserGifts", Type: "getReceivedGifts",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"user_id": req.UserId, "owner_id": req.OwnerId,
"exclude_unsaved": req.ExcludeUnsaved,
"exclude_saved": req.ExcludeSaved,
"exclude_unlimited": req.ExcludeUnlimited,
"exclude_limited": req.ExcludeLimited,
"exclude_upgraded": req.ExcludeUpgraded,
"sort_by_price": req.SortByPrice,
"offset": req.Offset, "offset": req.Offset,
"limit": req.Limit, "limit": req.Limit,
}, },
@ -18995,22 +19139,22 @@ func (client *Client) GetUserGifts(req *GetUserGiftsRequest) (*UserGifts, error)
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalUserGifts(result.Data) return UnmarshalReceivedGifts(result.Data)
} }
type GetUserGiftRequest struct { type GetReceivedGiftRequest struct {
// Identifier of the message with the gift // Identifier of the gift
MessageId int64 `json:"message_id"` ReceivedGiftId string `json:"received_gift_id"`
} }
// Returns information about a gift received or sent by the current user // Returns information about a received gift
func (client *Client) GetUserGift(req *GetUserGiftRequest) (*UserGift, error) { func (client *Client) GetReceivedGift(req *GetReceivedGiftRequest) (*ReceivedGift, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getUserGift", Type: "getReceivedGift",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"message_id": req.MessageId, "received_gift_id": req.ReceivedGiftId,
}, },
}) })
if err != nil { if err != nil {
@ -19021,7 +19165,62 @@ func (client *Client) GetUserGift(req *GetUserGiftRequest) (*UserGift, error) {
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalUserGift(result.Data) return UnmarshalReceivedGift(result.Data)
}
type GetUpgradedGiftRequest struct {
// Unique name of the upgraded gift
Name string `json:"name"`
}
// Returns information about an upgraded gift by its name
func (client *Client) GetUpgradedGift(req *GetUpgradedGiftRequest) (*UpgradedGift, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getUpgradedGift",
},
Data: map[string]interface{}{
"name": req.Name,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalUpgradedGift(result.Data)
}
type GetUpgradedGiftWithdrawalUrlRequest struct {
// Identifier of the gift
ReceivedGiftId string `json:"received_gift_id"`
// The 2-step verification password of the current user
Password string `json:"password"`
}
// Returns a URL for upgraded gift withdrawal in the TON blockchain as an NFT; requires owner privileges for gifts owned by a chat
func (client *Client) GetUpgradedGiftWithdrawalUrl(req *GetUpgradedGiftWithdrawalUrlRequest) (*HttpUrl, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getUpgradedGiftWithdrawalUrl",
},
Data: map[string]interface{}{
"received_gift_id": req.ReceivedGiftId,
"password": req.Password,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalHttpUrl(result.Data)
} }
type CreateInvoiceLinkRequest struct { type CreateInvoiceLinkRequest struct {

File diff suppressed because it is too large Load diff

View file

@ -1055,6 +1055,40 @@ func UnmarshalListOfGiveawayPrize(dataList []json.RawMessage) ([]GiveawayPrize,
return list, nil return list, nil
} }
func UnmarshalEmojiStatusType(data json.RawMessage) (EmojiStatusType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeEmojiStatusTypeCustomEmoji:
return UnmarshalEmojiStatusTypeCustomEmoji(data)
case TypeEmojiStatusTypeUpgradedGift:
return UnmarshalEmojiStatusTypeUpgradedGift(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfEmojiStatusType(dataList []json.RawMessage) ([]EmojiStatusType, error) {
list := []EmojiStatusType{}
for _, data := range dataList {
entity, err := UnmarshalEmojiStatusType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) { func UnmarshalChatMemberStatus(data json.RawMessage) (ChatMemberStatus, error) {
var meta meta var meta meta
@ -2610,6 +2644,9 @@ func UnmarshalLinkPreviewType(data json.RawMessage) (LinkPreviewType, error) {
case TypeLinkPreviewTypeUnsupported: case TypeLinkPreviewTypeUnsupported:
return UnmarshalLinkPreviewTypeUnsupported(data) return UnmarshalLinkPreviewTypeUnsupported(data)
case TypeLinkPreviewTypeUpgradedGift:
return UnmarshalLinkPreviewTypeUpgradedGift(data)
case TypeLinkPreviewTypeUser: case TypeLinkPreviewTypeUser:
return UnmarshalLinkPreviewTypeUser(data) return UnmarshalLinkPreviewTypeUser(data)
@ -4093,6 +4130,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) {
case TypeStoryAreaTypeWeather: case TypeStoryAreaTypeWeather:
return UnmarshalStoryAreaTypeWeather(data) return UnmarshalStoryAreaTypeWeather(data)
case TypeStoryAreaTypeUpgradedGift:
return UnmarshalStoryAreaTypeUpgradedGift(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -4142,6 +4182,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro
case TypeInputStoryAreaTypeWeather: case TypeInputStoryAreaTypeWeather:
return UnmarshalInputStoryAreaTypeWeather(data) return UnmarshalInputStoryAreaTypeWeather(data)
case TypeInputStoryAreaTypeUpgradedGift:
return UnmarshalInputStoryAreaTypeUpgradedGift(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -7003,6 +7046,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypeUnsupportedProxy: case TypeInternalLinkTypeUnsupportedProxy:
return UnmarshalInternalLinkTypeUnsupportedProxy(data) return UnmarshalInternalLinkTypeUnsupportedProxy(data)
case TypeInternalLinkTypeUpgradedGift:
return UnmarshalInternalLinkTypeUpgradedGift(data)
case TypeInternalLinkTypeUserPhoneNumber: case TypeInternalLinkTypeUserPhoneNumber:
return UnmarshalInternalLinkTypeUserPhoneNumber(data) return UnmarshalInternalLinkTypeUserPhoneNumber(data)
@ -9743,6 +9789,14 @@ func UnmarshalUpgradedGiftSymbol(data json.RawMessage) (*UpgradedGiftSymbol, err
return &resp, err return &resp, err
} }
func UnmarshalUpgradedGiftBackdropColors(data json.RawMessage) (*UpgradedGiftBackdropColors, error) {
var resp UpgradedGiftBackdropColors
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradedGiftBackdrop(data json.RawMessage) (*UpgradedGiftBackdrop, error) { func UnmarshalUpgradedGiftBackdrop(data json.RawMessage) (*UpgradedGiftBackdrop, error) {
var resp UpgradedGiftBackdrop var resp UpgradedGiftBackdrop
@ -9807,16 +9861,16 @@ func UnmarshalSentGiftUpgraded(data json.RawMessage) (*SentGiftUpgraded, error)
return &resp, err return &resp, err
} }
func UnmarshalUserGift(data json.RawMessage) (*UserGift, error) { func UnmarshalReceivedGift(data json.RawMessage) (*ReceivedGift, error) {
var resp UserGift var resp ReceivedGift
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalUserGifts(data json.RawMessage) (*UserGifts, error) { func UnmarshalReceivedGifts(data json.RawMessage) (*ReceivedGifts, error) {
var resp UserGifts var resp ReceivedGifts
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
@ -10175,6 +10229,22 @@ func UnmarshalProfileAccentColor(data json.RawMessage) (*ProfileAccentColor, err
return &resp, err return &resp, err
} }
func UnmarshalEmojiStatusTypeCustomEmoji(data json.RawMessage) (*EmojiStatusTypeCustomEmoji, error) {
var resp EmojiStatusTypeCustomEmoji
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalEmojiStatusTypeUpgradedGift(data json.RawMessage) (*EmojiStatusTypeUpgradedGift, error) {
var resp EmojiStatusTypeUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) { func UnmarshalEmojiStatus(data json.RawMessage) (*EmojiStatus, error) {
var resp EmojiStatus var resp EmojiStatus
@ -10191,6 +10261,14 @@ func UnmarshalEmojiStatuses(data json.RawMessage) (*EmojiStatuses, error) {
return &resp, err return &resp, err
} }
func UnmarshalEmojiStatusCustomEmojis(data json.RawMessage) (*EmojiStatusCustomEmojis, error) {
var resp EmojiStatusCustomEmojis
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) { func UnmarshalUsernames(data json.RawMessage) (*Usernames, error) {
var resp Usernames var resp Usernames
@ -12639,6 +12717,14 @@ func UnmarshalLinkPreviewTypeUnsupported(data json.RawMessage) (*LinkPreviewType
return &resp, err return &resp, err
} }
func UnmarshalLinkPreviewTypeUpgradedGift(data json.RawMessage) (*LinkPreviewTypeUpgradedGift, error) {
var resp LinkPreviewTypeUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalLinkPreviewTypeUser(data json.RawMessage) (*LinkPreviewTypeUser, error) { func UnmarshalLinkPreviewTypeUser(data json.RawMessage) (*LinkPreviewTypeUser, error) {
var resp LinkPreviewTypeUser var resp LinkPreviewTypeUser
@ -15151,6 +15237,14 @@ func UnmarshalStoryAreaTypeWeather(data json.RawMessage) (*StoryAreaTypeWeather,
return &resp, err return &resp, err
} }
func UnmarshalStoryAreaTypeUpgradedGift(data json.RawMessage) (*StoryAreaTypeUpgradedGift, error) {
var resp StoryAreaTypeUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) { func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) {
var resp StoryArea var resp StoryArea
@ -15215,6 +15309,14 @@ func UnmarshalInputStoryAreaTypeWeather(data json.RawMessage) (*InputStoryAreaTy
return &resp, err return &resp, err
} }
func UnmarshalInputStoryAreaTypeUpgradedGift(data json.RawMessage) (*InputStoryAreaTypeUpgradedGift, error) {
var resp InputStoryAreaTypeUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) { func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) {
var resp InputStoryArea var resp InputStoryArea
@ -19439,6 +19541,14 @@ func UnmarshalInternalLinkTypeUnsupportedProxy(data json.RawMessage) (*InternalL
return &resp, err return &resp, err
} }
func UnmarshalInternalLinkTypeUpgradedGift(data json.RawMessage) (*InternalLinkTypeUpgradedGift, error) {
var resp InternalLinkTypeUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) { func UnmarshalInternalLinkTypeUserPhoneNumber(data json.RawMessage) (*InternalLinkTypeUserPhoneNumber, error) {
var resp InternalLinkTypeUserPhoneNumber var resp InternalLinkTypeUserPhoneNumber
@ -22433,6 +22543,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpgradedGiftSymbol: case TypeUpgradedGiftSymbol:
return UnmarshalUpgradedGiftSymbol(data) return UnmarshalUpgradedGiftSymbol(data)
case TypeUpgradedGiftBackdropColors:
return UnmarshalUpgradedGiftBackdropColors(data)
case TypeUpgradedGiftBackdrop: case TypeUpgradedGiftBackdrop:
return UnmarshalUpgradedGiftBackdrop(data) return UnmarshalUpgradedGiftBackdrop(data)
@ -22457,11 +22570,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSentGiftUpgraded: case TypeSentGiftUpgraded:
return UnmarshalSentGiftUpgraded(data) return UnmarshalSentGiftUpgraded(data)
case TypeUserGift: case TypeReceivedGift:
return UnmarshalUserGift(data) return UnmarshalReceivedGift(data)
case TypeUserGifts: case TypeReceivedGifts:
return UnmarshalUserGifts(data) return UnmarshalReceivedGifts(data)
case TypeGiftUpgradePreview: case TypeGiftUpgradePreview:
return UnmarshalGiftUpgradePreview(data) return UnmarshalGiftUpgradePreview(data)
@ -22595,12 +22708,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeProfileAccentColor: case TypeProfileAccentColor:
return UnmarshalProfileAccentColor(data) return UnmarshalProfileAccentColor(data)
case TypeEmojiStatusTypeCustomEmoji:
return UnmarshalEmojiStatusTypeCustomEmoji(data)
case TypeEmojiStatusTypeUpgradedGift:
return UnmarshalEmojiStatusTypeUpgradedGift(data)
case TypeEmojiStatus: case TypeEmojiStatus:
return UnmarshalEmojiStatus(data) return UnmarshalEmojiStatus(data)
case TypeEmojiStatuses: case TypeEmojiStatuses:
return UnmarshalEmojiStatuses(data) return UnmarshalEmojiStatuses(data)
case TypeEmojiStatusCustomEmojis:
return UnmarshalEmojiStatusCustomEmojis(data)
case TypeUsernames: case TypeUsernames:
return UnmarshalUsernames(data) return UnmarshalUsernames(data)
@ -23519,6 +23641,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeLinkPreviewTypeUnsupported: case TypeLinkPreviewTypeUnsupported:
return UnmarshalLinkPreviewTypeUnsupported(data) return UnmarshalLinkPreviewTypeUnsupported(data)
case TypeLinkPreviewTypeUpgradedGift:
return UnmarshalLinkPreviewTypeUpgradedGift(data)
case TypeLinkPreviewTypeUser: case TypeLinkPreviewTypeUser:
return UnmarshalLinkPreviewTypeUser(data) return UnmarshalLinkPreviewTypeUser(data)
@ -24461,6 +24586,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStoryAreaTypeWeather: case TypeStoryAreaTypeWeather:
return UnmarshalStoryAreaTypeWeather(data) return UnmarshalStoryAreaTypeWeather(data)
case TypeStoryAreaTypeUpgradedGift:
return UnmarshalStoryAreaTypeUpgradedGift(data)
case TypeStoryArea: case TypeStoryArea:
return UnmarshalStoryArea(data) return UnmarshalStoryArea(data)
@ -24485,6 +24613,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInputStoryAreaTypeWeather: case TypeInputStoryAreaTypeWeather:
return UnmarshalInputStoryAreaTypeWeather(data) return UnmarshalInputStoryAreaTypeWeather(data)
case TypeInputStoryAreaTypeUpgradedGift:
return UnmarshalInputStoryAreaTypeUpgradedGift(data)
case TypeInputStoryArea: case TypeInputStoryArea:
return UnmarshalInputStoryArea(data) return UnmarshalInputStoryArea(data)
@ -26069,6 +26200,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypeUnsupportedProxy: case TypeInternalLinkTypeUnsupportedProxy:
return UnmarshalInternalLinkTypeUnsupportedProxy(data) return UnmarshalInternalLinkTypeUnsupportedProxy(data)
case TypeInternalLinkTypeUpgradedGift:
return UnmarshalInternalLinkTypeUpgradedGift(data)
case TypeInternalLinkTypeUserPhoneNumber: case TypeInternalLinkTypeUserPhoneNumber:
return UnmarshalInternalLinkTypeUserPhoneNumber(data) return UnmarshalInternalLinkTypeUserPhoneNumber(data)

View file

@ -618,7 +618,7 @@ botVerificationParameters icon_custom_emoji_id:int64 organization_name:string de
//@description Describes verification status provided by a bot //@description Describes verification status provided by a bot
//@bot_user_id Identifier of the bot that provided the verification //@bot_user_id Identifier of the bot that provided the verification
//@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign //@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign
//@custom_description Custom description of verification reason set by the bot //@custom_description Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities
botVerification bot_user_id:int53 icon_custom_emoji_id:int64 custom_description:formattedText = BotVerification; botVerification bot_user_id:int53 icon_custom_emoji_id:int64 custom_description:formattedText = BotVerification;
//@description Contains information about verification status of a chat or a user //@description Contains information about verification status of a chat or a user
@ -1040,61 +1040,69 @@ upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedG
//@rarity_per_mille The number of upgraded gift that receive this symbol for each 1000 gifts upgraded //@rarity_per_mille The number of upgraded gift that receive this symbol for each 1000 gifts upgraded
upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol; upgradedGiftSymbol name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftSymbol;
//@description Describes a backdrop of an upgraded gift //@description Describes colors of a backdrop of an upgraded gift
//@name Name of the backdrop
//@center_color A color in the center of the backdrop in the RGB format //@center_color A color in the center of the backdrop in the RGB format
//@edge_color A color on the edges of the backdrop in the RGB format //@edge_color A color on the edges of the backdrop in the RGB format
//@symbol_color A color to be applied for the symbol in the RGB format //@symbol_color A color to be applied for the symbol in the RGB format
//@text_color A color for the text on the backdrop in the RGB format //@text_color A color for the text on the backdrop in the RGB format
upgradedGiftBackdropColors center_color:int32 edge_color:int32 symbol_color:int32 text_color:int32 = UpgradedGiftBackdropColors;
//@description Describes a backdrop of an upgraded gift
//@name Name of the backdrop
//@colors Colors of the backdrop
//@rarity_per_mille The number of upgraded gift that receive this backdrop for each 1000 gifts upgraded //@rarity_per_mille The number of upgraded gift that receive this backdrop for each 1000 gifts upgraded
upgradedGiftBackdrop name:string center_color:int32 edge_color:int32 symbol_color:int32 text_color:int32 rarity_per_mille:int32 = UpgradedGiftBackdrop; upgradedGiftBackdrop name:string colors:upgradedGiftBackdropColors rarity_per_mille:int32 = UpgradedGiftBackdrop;
//@description Describes the original details about the gift //@description Describes the original details about the gift
//@sender_user_id Identifier of the user that sent the gift; 0 if the gift was private //@sender_id Identifier of the user or the chat that sent the gift; may be null if the gift was private
//@receiver_user_id Identifier of the user that received the gift //@receiver_id Identifier of the user or the chat that received the gift
//@text Message added to the gift //@text Message added to the gift
//@date Point in time (Unix timestamp) when the gift was sent //@date Point in time (Unix timestamp) when the gift was sent
upgradedGiftOriginalDetails sender_user_id:int53 receiver_user_id:int53 text:formattedText date:int32 = UpgradedGiftOriginalDetails; upgradedGiftOriginalDetails sender_id:MessageSender receiver_id:MessageSender text:formattedText date:int32 = UpgradedGiftOriginalDetails;
//@description Describes a gift that can be sent to another user //@description Describes a gift that can be sent to another user or channel chat
//@id Unique identifier of the gift //@id Unique identifier of the gift
//@sticker The sticker representing the gift //@sticker The sticker representing the gift
//@star_count Number of Telegram Stars that must be paid for the gift //@star_count Number of Telegram Stars that must be paid for the gift
//@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed //@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed
//@upgrade_star_count Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible //@upgrade_star_count Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn't possible
//@is_for_birthday True, if the gift is a birthday gift //@is_for_birthday True, if the gift is a birthday gift
//@remaining_count Number of remaining times the gift can be purchased by all users; 0 if not limited or the gift was sold out //@remaining_count Number of remaining times the gift can be purchased; 0 if not limited or the gift was sold out
//@total_count Number of total times the gift can be purchased by all users; 0 if not limited //@total_count Number of total times the gift can be purchased; 0 if not limited
//@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only //@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only
//@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only
gift id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 is_for_birthday:Bool remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift; gift id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 upgrade_star_count:int53 is_for_birthday:Bool remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift;
//@description Contains a list of gifts that can be sent to another user @gifts The list of gifts //@description Contains a list of gifts that can be sent to another user or channel chat @gifts The list of gifts
gifts gifts:vector<gift> = Gifts; gifts gifts:vector<gift> = Gifts;
//@description Describes an upgraded gift that can be gifted to another user or transferred to TON blockchain as an NFT //@description Describes an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT
//@id Unique identifier of the gift //@id Unique identifier of the gift
//@title The title of the upgraded gift //@title The title of the upgraded gift
//@name Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift
//@number Unique number of the upgraded gift among gifts upgraded from the same gift //@number Unique number of the upgraded gift among gifts upgraded from the same gift
//@total_upgraded_count Total number of gifts that were upgraded from the same gift //@total_upgraded_count Total number of gifts that were upgraded from the same gift
//@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift //@max_upgraded_count The maximum number of gifts that can be upgraded from the same gift
//@owner_user_id User identifier of the user that owns the upgraded gift; 0 if none //@owner_id Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown
//@owner_address Address of the gift NFT owner in TON blockchain; may be empty if none
//@owner_name Name of the owner for the case when owner identifier and address aren't known
//@model Model of the upgraded gift //@model Model of the upgraded gift
//@symbol Symbol of the upgraded gift //@symbol Symbol of the upgraded gift
//@backdrop Backdrop of the upgraded gift //@backdrop Backdrop of the upgraded gift
//@original_details Information about the originally sent gift; may be null if unknown //@original_details Information about the originally sent gift; may be null if unknown
upgradedGift id:int64 title:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 owner_user_id:int53 model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails = UpgradedGift; upgradedGift id:int64 title:string name:string number:int32 total_upgraded_count:int32 max_upgraded_count:int32 owner_id:MessageSender owner_address:string owner_name:string model:upgradedGiftModel symbol:upgradedGiftSymbol backdrop:upgradedGiftBackdrop original_details:upgradedGiftOriginalDetails = UpgradedGift;
//@description Contains result of gift upgrading //@description Contains result of gift upgrading
//@gift The upgraded gift //@gift The upgraded gift
//@is_saved True, if the gift is displayed on the user's profile page //@received_gift_id Unique identifier of the received gift for the current user
//@can_be_transferred True, if the gift can be transferred to another user //@is_saved True, if the gift is displayed on the user's or the channel's profile page
//@can_be_transferred True, if the gift can be transferred to another owner
//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift //@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift
//@export_date Point in time (Unix timestamp) when the gift can be transferred to TON blockchain as an NFT //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT
upgradeGiftResult gift:upgradedGift is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 export_date:int32 = UpgradeGiftResult; upgradeGiftResult gift:upgradedGift received_gift_id:string is_saved:Bool can_be_transferred:Bool transfer_star_count:int53 export_date:int32 = UpgradeGiftResult;
//@class SentGift @description Represents a gift received by a user //@class SentGift @description Represents content of a gift received by a user or a channel chat
//@description Regular gift @gift The gift //@description Regular gift @gift The gift
sentGiftRegular gift:gift = SentGift; sentGiftRegular gift:gift = SentGift;
@ -1103,28 +1111,29 @@ sentGiftRegular gift:gift = SentGift;
sentGiftUpgraded gift:upgradedGift = SentGift; sentGiftUpgraded gift:upgradedGift = SentGift;
//@description Represents a gift received by a user //@description Represents a gift received by a user or a chat
//@sender_user_id Identifier of the user that sent the gift; 0 if unknown //@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift
//@sender_id Identifier of a user or a chat that sent the gift; may be null if unknown
//@text Message added to the gift //@text Message added to the gift
//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them
//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift //@is_saved True, if the gift is displayed on the chat's profile page; only for the receiver of the gift
//@can_be_upgraded True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift //@can_be_upgraded True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift
//@can_be_transferred True, if the gift is an upgraded gift that can be transferred to another user; only for the receiver of the gift //@can_be_transferred True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift
//@was_refunded True, if the gift was refunded and isn't available anymore //@was_refunded True, if the gift was refunded and isn't available anymore
//@date Point in time (Unix timestamp) when the gift was sent //@date Point in time (Unix timestamp) when the gift was sent
//@gift The gift //@gift The gift
//@message_id Identifier of the message with the gift in the chat with the sender of the gift; can be 0 or an identifier of a deleted message; only for the receiver of the gift
//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the current user //@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the current user
//@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift //@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift
//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift //@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift
//@export_date Point in time (Unix timestamp) when the upgraded gift can be transferred to TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift //@export_date Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift
userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool can_be_upgraded:Bool can_be_transferred:Bool was_refunded:Bool date:int32 gift:SentGift message_id:int53 sell_star_count:int53 prepaid_upgrade_star_count:int53 transfer_star_count:int53 export_date:int32 = UserGift; receivedGift received_gift_id:string sender_id:MessageSender text:formattedText is_private:Bool is_saved:Bool can_be_upgraded:Bool can_be_transferred:Bool was_refunded:Bool date:int32 gift:SentGift sell_star_count:int53 prepaid_upgrade_star_count:int53 transfer_star_count:int53 export_date:int32 = ReceivedGift;
//@description Represents a list of gifts received by a user //@description Represents a list of gifts received by a user or a chat
//@total_count The total number of received gifts //@total_count The total number of received gifts
//@gifts The list of gifts //@gifts The list of gifts
//@are_notifications_enabled True, if notifications about new gifts of the owner are enabled
//@next_offset The offset for the next request. If empty, then there are no more results //@next_offset The offset for the next request. If empty, then there are no more results
userGifts total_count:int32 gifts:vector<userGift> next_offset:string = UserGifts; receivedGifts total_count:int32 gifts:vector<receivedGift> are_notifications_enabled:Bool next_offset:string = ReceivedGifts;
//@description Contains examples of possible upgraded gifts for the given regular gift //@description Contains examples of possible upgraded gifts for the given regular gift
//@models Examples of possible models that can be chosen for the gift after upgrade //@models Examples of possible models that can be chosen for the gift after upgrade
@ -1235,13 +1244,13 @@ starTransactionTypeChannelSubscriptionPurchase chat_id:int53 subscription_period
//@subscription_period The number of seconds between consecutive Telegram Star debitings //@subscription_period The number of seconds between consecutive Telegram Star debitings
starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType; starTransactionTypeChannelSubscriptionSale user_id:int53 subscription_period:int32 = StarTransactionType;
//@description The transaction is a purchase of a regular gift to another user; for regular users and bots only @user_id Identifier of the user that received the gift @gift The gift //@description The transaction is a purchase of a regular gift; for regular users and bots only @owner_id Identifier of the user or the channel that received the gift @gift The gift
starTransactionTypeGiftPurchase user_id:int53 gift:gift = StarTransactionType; starTransactionTypeGiftPurchase owner_id:MessageSender gift:gift = StarTransactionType;
//@description The transaction is a transfer of an upgraded gift to another user; for regular users only @user_id Identifier of the user that received the gift @gift The gift //@description The transaction is a transfer of an upgraded gift; for regular users only @owner_id Identifier of the user or the channel that received the gift @gift The gift
starTransactionTypeGiftTransfer user_id:int53 gift:upgradedGift = StarTransactionType; starTransactionTypeGiftTransfer owner_id:MessageSender gift:upgradedGift = StarTransactionType;
//@description The transaction is a sale of a gift received from another user or bot; for regular users only @user_id Identifier of the user that sent the gift @gift The gift //@description The transaction is a sale of a received gift; for regular users and channel chats only @user_id Identifier of the user that sent the gift @gift The gift
starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType; starTransactionTypeGiftSale user_id:int53 gift:gift = StarTransactionType;
//@description The transaction is an upgrade of a gift; for regular users only @gift The upgraded gift //@description The transaction is an upgrade of a gift; for regular users only @gift The upgraded gift
@ -1351,13 +1360,32 @@ profileAccentColors palette_colors:vector<int32> background_colors:vector<int32>
//@min_channel_chat_boost_level The minimum chat boost level required to use the color in a channel chat //@min_channel_chat_boost_level The minimum chat boost level required to use the color in a channel chat
profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_supergroup_chat_boost_level:int32 min_channel_chat_boost_level:int32 = ProfileAccentColor; profileAccentColor id:int32 light_theme_colors:profileAccentColors dark_theme_colors:profileAccentColors min_supergroup_chat_boost_level:int32 min_channel_chat_boost_level:int32 = ProfileAccentColor;
//@description Describes a custom emoji to be shown instead of the Telegram Premium badge
//@custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format //@class EmojiStatusType @description Describes type of emoji status
//@description A custom emoji set as emoji status @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format
emojiStatusTypeCustomEmoji custom_emoji_id:int64 = EmojiStatusType;
//@description An upgraded gift set as emoji status
//@upgraded_gift_id Identifier of the upgraded gift
//@gift_title The title of the upgraded gift
//@gift_name Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift
//@model_custom_emoji_id Custom emoji identifier of the model of the upgraded gift
//@symbol_custom_emoji_id Custom emoji identifier of the symbol of the upgraded gift
//@backdrop_colors Colors of the backdrop of the upgraded gift
emojiStatusTypeUpgradedGift upgraded_gift_id:int64 gift_title:string gift_name:string model_custom_emoji_id:int64 symbol_custom_emoji_id:int64 backdrop_colors:upgradedGiftBackdropColors = EmojiStatusType;
//@description Describes an emoji to be shown instead of the Telegram Premium badge
//@type Type of the emoji status
//@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never //@expiration_date Point in time (Unix timestamp) when the status will expire; 0 if never
emojiStatus custom_emoji_id:int64 expiration_date:int32 = EmojiStatus; emojiStatus type:EmojiStatusType expiration_date:int32 = EmojiStatus;
//@description Contains a list of emoji statuses @emoji_statuses The list of emoji statuses identifiers
emojiStatuses emoji_statuses:vector<emojiStatus> = EmojiStatuses;
//@description Contains a list of custom emoji identifiers for emoji statuses @custom_emoji_ids The list of custom emoji identifiers //@description Contains a list of custom emoji identifiers for emoji statuses @custom_emoji_ids The list of custom emoji identifiers
emojiStatuses custom_emoji_ids:vector<int64> = EmojiStatuses; emojiStatusCustomEmojis custom_emoji_ids:vector<int64> = EmojiStatusCustomEmojis;
//@description Describes usernames assigned to a user, a supergroup, or a channel //@description Describes usernames assigned to a user, a supergroup, or a channel
@ -1443,7 +1471,7 @@ botInfo short_description:string description:string photo:photo animation:animat
//@bio A short user bio; may be null for bots //@bio A short user bio; may be null for bots
//@birthdate Birthdate of the user; may be null if unknown //@birthdate Birthdate of the user; may be null if unknown
//@personal_chat_id Identifier of the personal chat of the user; 0 if none //@personal_chat_id Identifier of the personal chat of the user; 0 if none
//@gift_count Number of gifts saved to profile by the user //@gift_count Number of saved to profile gifts for other users or the total number of received gifts for the current user
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user //@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
//@bot_verification Information about verification status of the user provided by a bot; may be null if none or unknown //@bot_verification Information about verification status of the user provided by a bot; may be null if none or unknown
//@business_info Information about business settings for Telegram Business accounts; may be null if none //@business_info Information about business settings for Telegram Business accounts; may be null if none
@ -1713,6 +1741,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat
//@can_get_statistics True, if the supergroup or channel statistics are available //@can_get_statistics True, if the supergroup or channel statistics are available
//@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available //@can_get_revenue_statistics True, if the supergroup or channel revenue statistics are available
//@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available //@can_get_star_revenue_statistics True, if the supergroup or channel Telegram Star revenue statistics are available
//@can_send_gift True, if the user can send a gift to the supergroup or channel using sendGift or transferGift
//@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available,
//-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators
@ -1720,6 +1749,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat
//@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators
//@has_paid_media_allowed True, if paid media can be sent and forwarded to the channel chat; for channels only //@has_paid_media_allowed True, if paid media can be sent and forwarded to the channel chat; for channels only
//@has_pinned_stories True, if the supergroup or channel has pinned stories //@has_pinned_stories True, if the supergroup or channel has pinned stories
//@gift_count Number of saved to profile gifts for channels without can_post_messages administrator right, otherwise, the total number of received gifts
//@my_boost_count Number of times the current user boosted the supergroup or channel //@my_boost_count Number of times the current user boosted the supergroup or channel
//@unrestrict_boost_count Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified //@unrestrict_boost_count Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified
//@sticker_set_id Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none //@sticker_set_id Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none
@ -1730,7 +1760,7 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat
//@bot_verification Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown //@bot_verification Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown
//@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none
//@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> bot_verification:botVerification upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_enable_paid_reaction:Bool can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_get_star_revenue_statistics:Bool can_send_gift:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool gift_count:int32 my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> bot_verification:botVerification upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
//@class SecretChatState @description Describes the current secret chat state //@class SecretChatState @description Describes the current secret chat state
@ -3124,6 +3154,9 @@ linkPreviewTypeTheme documents:vector<document> settings:themeSettings = LinkPre
//@description The link preview type is unsupported yet //@description The link preview type is unsupported yet
linkPreviewTypeUnsupported = LinkPreviewType; linkPreviewTypeUnsupported = LinkPreviewType;
//@description The link is a link to an upgraded gift @gift The gift
linkPreviewTypeUpgradedGift gift:upgradedGift = LinkPreviewType;
//@description The link is a link to a user @photo Photo of the user; may be null if none @is_bot True, if the user is a bot //@description The link is a link to a user @photo Photo of the user; may be null if none @is_bot True, if the user is a bot
linkPreviewTypeUser photo:chatPhoto is_bot:Bool = LinkPreviewType; linkPreviewTypeUser photo:chatPhoto is_bot:Bool = LinkPreviewType;
@ -3382,8 +3415,11 @@ paidMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumb
//@description The media is a photo @photo The photo //@description The media is a photo @photo The photo
paidMediaPhoto photo:photo = PaidMedia; paidMediaPhoto photo:photo = PaidMedia;
//@description The media is a video @video The video //@description The media is a video
paidMediaVideo video:video = PaidMedia; //@video The video
//@cover Cover of the video; may be null if none
//@start_timestamp Timestamp from which the video playing must start, in seconds
paidMediaVideo video:video cover:photo start_timestamp:int32 = PaidMedia;
//@description The media is unsupported //@description The media is unsupported
paidMediaUnsupported = PaidMedia; paidMediaUnsupported = PaidMedia;
@ -3725,11 +3761,13 @@ messageSticker sticker:sticker is_premium:Bool = MessageContent;
//@description A video message //@description A video message
//@video The video description //@video The video description
//@alternative_videos Alternative qualities of the video //@alternative_videos Alternative qualities of the video
//@cover Cover of the video; may be null if none
//@start_timestamp Timestamp from which the video playing must start, in seconds
//@caption Video caption //@caption Video caption
//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video //@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video
//@has_spoiler True, if the video preview must be covered by a spoiler animation //@has_spoiler True, if the video preview must be covered by a spoiler animation
//@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped //@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped
messageVideo video:video alternative_videos:vector<alternativeVideo> caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; messageVideo video:video alternative_videos:vector<alternativeVideo> cover:photo start_timestamp:int32 caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent;
//@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped //@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent; messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent;
@ -4003,33 +4041,39 @@ messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string a
//@sticker A sticker to be shown in the message; may be null if unknown //@sticker A sticker to be shown in the message; may be null if unknown
messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent; messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent;
//@description A regular gift was received or sent by the current user //@description A regular gift was received or sent by the current user, or the current user was notified about a channel gift
//@gift The gift //@gift The gift
//@sender_id Sender of the gift
//@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift
//@text Message added to the gift //@text Message added to the gift
//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver //@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver
//@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift //@prepaid_upgrade_star_count Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift
//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift //@is_saved True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift
//@can_be_upgraded True, if the gift can be upgraded to a unique gift; only for the receiver of the gift //@can_be_upgraded True, if the gift can be upgraded to a unique gift; only for the receiver of the gift
//@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift //@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift
//@was_upgraded True, if the gift was upgraded to a unique gift //@was_upgraded True, if the gift was upgraded to a unique gift
//@was_refunded True, if the gift was refunded and isn't available anymore //@was_refunded True, if the gift was refunded and isn't available anymore
//@upgrade_message_id Identifier of the service message messageUpgradedGift or messageRefundedUpgradedGift with upgraded version of the gift; can be 0 if none or an identifier of a deleted message. //@upgraded_received_gift_id Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift
//-Use getUserGift to get information about the gift messageGift gift:gift sender_id:MessageSender received_gift_id:string text:formattedText sell_star_count:int53 prepaid_upgrade_star_count:int53 is_private:Bool is_saved:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgraded_received_gift_id:string = MessageContent;
messageGift gift:gift text:formattedText sell_star_count:int53 prepaid_upgrade_star_count:int53 is_private:Bool is_saved:Bool can_be_upgraded:Bool was_converted:Bool was_upgraded:Bool was_refunded:Bool upgrade_message_id:int53 = MessageContent;
//@description An upgraded gift was received or sent by the current user //@description An upgraded gift was received or sent by the current user, or the current user was notified about a channel gift
//@gift The gift //@gift The gift
//@sender_id Sender of the gift; may be null for anonymous gifts
//@received_gift_id Unique identifier of the received gift for the current user; only for the receiver of the gift
//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift //@is_upgrade True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift
//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift //@is_saved True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift
//@can_be_transferred True, if the gift can be transferred to another user; only for the receiver of the gift //@can_be_transferred True, if the gift can be transferred to another owner; only for the receiver of the gift
//@was_transferred True, if the gift was transferred to another user; only for the receiver of the gift //@was_transferred True, if the gift was transferred to another owner; only for the receiver of the gift
//@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift //@transfer_star_count Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift
//@export_date Point in time (Unix timestamp) when the gift can be transferred to TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift //@export_date Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; 0 if NFT export isn't possible; only for the receiver of the gift
messageUpgradedGift gift:upgradedGift is_upgrade:Bool is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 export_date:int32 = MessageContent; messageUpgradedGift gift:upgradedGift sender_id:MessageSender received_gift_id:string is_upgrade:Bool is_saved:Bool can_be_transferred:Bool was_transferred:Bool transfer_star_count:int53 export_date:int32 = MessageContent;
//@description A gift which purchase, upgrade or transfer were refunded @gift The gift @is_upgrade True, if the gift was obtained by upgrading of a previously received gift //@description A gift which purchase, upgrade or transfer were refunded
messageRefundedUpgradedGift gift:gift is_upgrade:Bool = MessageContent; //@gift The gift
//@sender_id Sender of the gift
//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift
messageRefundedUpgradedGift gift:gift sender_id:MessageSender is_upgrade:Bool = MessageContent;
//@description A contact has registered with Telegram //@description A contact has registered with Telegram
messageContactRegistered = MessageContent; messageContactRegistered = MessageContent;
@ -4144,9 +4188,11 @@ inputThumbnail thumbnail:InputFile width:int32 height:int32 = InputThumbnail;
inputPaidMediaTypePhoto = InputPaidMediaType; inputPaidMediaTypePhoto = InputPaidMediaType;
//@description The media is a video //@description The media is a video
//@cover Cover of the video; pass null to skip cover uploading
//@start_timestamp Timestamp from which the video playing must start, in seconds
//@duration Duration of the video, in seconds //@duration Duration of the video, in seconds
//@supports_streaming True, if the video is expected to be streamed //@supports_streaming True, if the video is expected to be streamed
inputPaidMediaTypeVideo duration:int32 supports_streaming:Bool = InputPaidMediaType; inputPaidMediaTypeVideo cover:InputFile start_timestamp:int32 duration:int32 supports_streaming:Bool = InputPaidMediaType;
//@description Describes a paid media to be sent //@description Describes a paid media to be sent
@ -4270,6 +4316,8 @@ inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 heigh
//@description A video message //@description A video message
//@video Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender //@video Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender
//@thumbnail Video thumbnail; pass null to skip thumbnail uploading //@thumbnail Video thumbnail; pass null to skip thumbnail uploading
//@cover Cover of the video; pass null to skip cover uploading; not supported in secret chats and for self-destructing messages
//@start_timestamp Timestamp from which the video playing must start, in seconds
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable //@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Duration of the video, in seconds //@duration Duration of the video, in seconds
//@width Video width //@width Video width
@ -4279,7 +4327,7 @@ inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 heigh
//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats //@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats
//@self_destruct_type Video self-destruct type; pass null if none; private chats only //@self_destruct_type Video self-destruct type; pass null if none; private chats only
//@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats //@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats
inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; inputMessageVideo video:InputFile thumbnail:inputThumbnail cover:InputFile start_timestamp:int32 added_sticker_file_ids:vector<int32> duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent;
//@description A video note message //@description A video note message
//@video_note Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle //@video_note Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle
@ -4350,9 +4398,11 @@ inputMessageStory story_sender_chat_id:int53 story_id:int32 = InputMessageConten
//@description A forwarded message //@description A forwarded message
//@from_chat_id Identifier for the chat this forwarded message came from //@from_chat_id Identifier for the chat this forwarded message came from
//@message_id Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded //@message_id Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded
//@in_game_share True, if a game message is being shared from a launched game; applies only to game messages //@in_game_share Pass true if a game message is being shared from a launched game; applies only to game messages
//@replace_video_start_timestamp Pass true to replace video start timestamp in the forwarded message
//@new_video_start_timestamp The new video start timestamp; ignored if replace_video_start_timestamp == false
//@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual //@copy_options Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual
inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool copy_options:messageCopyOptions = InputMessageContent; inputMessageForwarded from_chat_id:int53 message_id:int53 in_game_share:Bool replace_video_start_timestamp:Bool new_video_start_timestamp:int32 copy_options:messageCopyOptions = InputMessageContent;
//@description Contains properties of a message and describes actions that can be done with the message right now //@description Contains properties of a message and describes actions that can be done with the message right now
@ -4656,6 +4706,10 @@ storyAreaTypeLink url:string = StoryAreaType;
//@background_color A color of the area background in the ARGB format //@background_color A color of the area background in the ARGB format
storyAreaTypeWeather temperature:double emoji:string background_color:int32 = StoryAreaType; storyAreaTypeWeather temperature:double emoji:string background_color:int32 = StoryAreaType;
//@description An area with an upgraded gift
//@gift_name Unique name of the upgraded gift
storyAreaTypeUpgradedGift gift_name:string = StoryAreaType;
//@description Describes a clickable rectangle area on a story media @position Position of the area @type Type of the area //@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; storyArea position:storyAreaPosition type:StoryAreaType = StoryArea;
@ -4697,6 +4751,9 @@ inputStoryAreaTypeLink url:string = InputStoryAreaType;
//@background_color A color of the area background in the ARGB format //@background_color A color of the area background in the ARGB format
inputStoryAreaTypeWeather temperature:double emoji:string background_color:int32 = InputStoryAreaType; inputStoryAreaTypeWeather temperature:double emoji:string background_color:int32 = InputStoryAreaType;
//@description An area with an upgraded gift @gift_name Unique name of the upgraded gift
inputStoryAreaTypeUpgradedGift gift_name: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 //@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; inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryArea;
@ -4705,8 +4762,9 @@ inputStoryArea position:storyAreaPosition type:InputStoryAreaType = InputStoryAr
//-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, //-up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas,
//-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, //-up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas,
//-up to 1 inputStoryAreaTypeMessage area, //-up to 1 inputStoryAreaTypeMessage area,
//-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, and //-up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user,
//-up to 3 inputStoryAreaTypeWeather areas //-up to 3 inputStoryAreaTypeWeather areas, and
//-up to 1 inputStoryAreaTypeUpgradedGift area
inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas; inputStoryAreas areas:vector<inputStoryArea> = InputStoryAreas;
@ -7217,6 +7275,9 @@ internalLinkTypeUnknownDeepLink link:string = InternalLinkType;
//@description The link is a link to an unsupported proxy. An alert can be shown to the user //@description The link is a link to an unsupported proxy. An alert can be shown to the user
internalLinkTypeUnsupportedProxy = InternalLinkType; internalLinkTypeUnsupportedProxy = InternalLinkType;
//@description The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link @name Name of the unique gift
internalLinkTypeUpgradedGift name:string = InternalLinkType;
//@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. //@description The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link.
//-If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field //-If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. If draft text isn't empty, then put the draft text in the input field
//@phone_number Phone number of the user //@phone_number Phone number of the user
@ -8886,6 +8947,19 @@ getChatSimilarChatCount chat_id:int53 return_local:Bool = Count;
//@opened_chat_id Identifier of the opened chat //@opened_chat_id Identifier of the opened chat
openChatSimilarChat chat_id:int53 opened_chat_id:int53 = Ok; openChatSimilarChat chat_id:int53 opened_chat_id:int53 = Ok;
//@description Returns a list of bots similar to the given bot @bot_user_id User identifier of the target bot
getBotSimilarBots bot_user_id:int53 = Users;
//@description Returns approximate number of bots similar to the given bot
//@bot_user_id User identifier of the target bot
//@return_local Pass true to get the number of bots without sending network requests, or -1 if the number of bots is unknown locally
getBotSimilarBotCount bot_user_id:int53 return_local:Bool = Count;
//@description Informs TDLib that a bot was opened from the list of similar bots
//@bot_user_id Identifier of the original bot, which similar bots were requested
//@opened_bot_user_id Identifier of the opened bot
openBotSimilarBot bot_user_id:int53 opened_bot_user_id:int53 = Ok;
//@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30 //@description Returns a list of frequently used chats @category Category of chats to be returned @limit The maximum number of chats to be returned; up to 30
getTopChats category:TopChatCategory limit:int32 = Chats; getTopChats category:TopChatCategory limit:int32 = Chats;
@ -9292,7 +9366,7 @@ addLocalMessage chat_id:int53 sender_id:MessageSender reply_to:InputMessageReply
//@revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats //@revoke Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats
deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok; deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok;
//@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete //@description Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator right @chat_id Chat identifier @sender_id Identifier of the sender of messages to delete
deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok; deleteChatMessagesBySender chat_id:int53 sender_id:MessageSender = Ok;
//@description Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted //@description Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted
@ -10549,26 +10623,29 @@ toggleBotIsAddedToAttachmentMenu bot_user_id:int53 is_added:Bool allow_write_acc
//@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status //@description Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status
getThemedEmojiStatuses = EmojiStatuses; getThemedEmojiStatuses = EmojiStatusCustomEmojis;
//@description Returns recent emoji statuses for self status //@description Returns recent emoji statuses for self status
getRecentEmojiStatuses = EmojiStatuses; getRecentEmojiStatuses = EmojiStatuses;
//@description Returns available upgraded gift emoji statuses for self status
getUpgradedGiftEmojiStatuses = EmojiStatuses;
//@description Returns default emoji statuses for self status //@description Returns default emoji statuses for self status
getDefaultEmojiStatuses = EmojiStatuses; getDefaultEmojiStatuses = EmojiStatusCustomEmojis;
//@description Clears the list of recently used emoji statuses for self status //@description Clears the list of recently used emoji statuses for self status
clearRecentEmojiStatuses = Ok; clearRecentEmojiStatuses = Ok;
//@description Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats //@description Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats
getThemedChatEmojiStatuses = EmojiStatuses; getThemedChatEmojiStatuses = EmojiStatusCustomEmojis;
//@description Returns default emoji statuses for chats //@description Returns default emoji statuses for chats
getDefaultChatEmojiStatuses = EmojiStatuses; getDefaultChatEmojiStatuses = EmojiStatusCustomEmojis;
//@description Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true //@description Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true
getDisallowedChatEmojiStatuses = EmojiStatuses; getDisallowedChatEmojiStatuses = EmojiStatusCustomEmojis;
//@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates //@description Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
@ -11652,52 +11729,67 @@ deleteSavedOrderInfo = Ok;
deleteSavedCredentials = Ok; deleteSavedCredentials = Ok;
//@description Returns gifts that can be sent to other users //@description Returns gifts that can be sent to other users and channel chats
getAvailableGifts = Gifts; getAvailableGifts = Gifts;
//@description Sends a gift to another user. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out //@description Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out
//@gift_id Identifier of the gift to send //@gift_id Identifier of the gift to send
//@user_id Identifier of the user that will receive the gift //@owner_id Identifier of the user or the channel chat that will receive the gift
//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed //@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
//@is_private Pass true to show the current user as sender and gift text only to the gift receiver; otherwise, everyone will be able to see them //@is_private Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them
//@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free //@pay_for_upgrade Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free
sendGift gift_id:int64 user_id:int53 text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok; sendGift gift_id:int64 owner_id:MessageSender text:formattedText is_private:Bool pay_for_upgrade:Bool = Ok;
//@description Sells a gift received by the current user for Telegram Stars //@description Sells a gift for Telegram Stars @received_gift_id Identifier of the gift
//@sender_user_id Identifier of the user that sent the gift sellGift received_gift_id:string = Ok;
//@message_id Identifier of the message with the gift in the chat with the user
sellGift sender_user_id:int53 message_id:int53 = Ok;
//@description Toggles whether a gift is shown on the current user's profile page //@description 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
//@sender_user_id Identifier of the user that sent the gift //@received_gift_id Identifier of the gift
//@message_id Identifier of the message with the gift in the chat with the user //@is_saved Pass true to display the gift on the user's or the channel's profile page; pass false to remove it from the profile page
//@is_saved Pass true to display the gift on the user's profile page; pass false to remove it from the profile page toggleGiftIsSaved received_gift_id:string is_saved:Bool = Ok;
toggleGiftIsSaved sender_user_id:int53 message_id:int53 is_saved:Bool = Ok;
//@description Toggles whether notifications for new gifts received by a channel chat are sent to the current user; requires can_post_messages administrator right in the chat
//@chat_id Identifier of the channel chat
//@are_enabled Pass true to enable notifications about new gifts owned by the channel chat; pass false to disable the notifications
toggleChatGiftNotifications chat_id:int53 are_enabled:Bool = Ok;
//@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift //@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift
getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview; getGiftUpgradePreview gift_id:int64 = GiftUpgradePreview;
//@description Upgrades a gift received by the current user. Unless the gift has prepaid_upgrade_star_count > 0, the user must pay gift.upgrade_star_count Telegram Stars for the upgrade //@description Upgrades a regular gift
//@sender_user_id Identifier of the user that sent the gift //@received_gift_id Identifier of the gift
//@message_id Identifier of the message with the gift in the chat with the user
//@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift //@keep_original_details Pass true to keep the original gift text, sender and receiver in the upgraded gift
upgradeGift sender_user_id:int53 message_id:int53 keep_original_details:Bool = UpgradeGiftResult; //@star_count The amount of Telegram Stars required to pay for the upgrade. It the gift has prepaid_upgrade_star_count > 0, then pass 0, otherwise, pass gift.upgrade_star_count
upgradeGift received_gift_id:string keep_original_details:Bool star_count:int53 = UpgradeGiftResult;
//@description Sends a gift upgraded by the current user to another user //@description Sends an upgraded gift to another user or a channel chat
//@sender_user_id Identifier of the user that sent the gift //@received_gift_id Identifier of the gift
//@message_id Identifier of the message with the upgraded gift in the chat with the user //@new_owner_id Identifier of the user or the channel chat that will receive the gift
//@receiver_user_id Identifier of the user that will receive the gift //@star_count The amount of Telegram Stars required to pay for the transfer
//@star_count The amount of Telegram Stars required for the transfer transferGift received_gift_id:string new_owner_id:MessageSender star_count:int53 = Ok;
transferGift sender_user_id:int53 message_id:int53 receiver_user_id:int53 star_count:int53 = Ok;
//@description Returns gifts saved to profile by the given user //@description Returns gifts received by the given user or chat
//@user_id Identifier of the user //@owner_id Identifier of the gift receiver
//@exclude_unsaved Pass true to exclude gifts that aren't saved to the chat's profile page. Always true for gifts received by other users and channel chats without can_post_messages administrator right
//@exclude_saved Pass true to exclude gifts that are saved to the chat's profile page; for channel chats with can_post_messages administrator right only
//@exclude_unlimited Pass true to exclude gifts that can be purchased unlimited number of times; for channel chats with can_post_messages administrator right only
//@exclude_limited Pass true to exclude gifts that can be purchased limited number of times; for channel chats with can_post_messages administrator right only
//@exclude_upgraded Pass true to exclude upgraded gifts; for channel chats with can_post_messages administrator right only
//@sort_by_price Pass true to sort results by gift price instead of send date; for channel chats with can_post_messages administrator right only
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@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 gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit //@limit The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit
getUserGifts user_id:int53 offset:string limit:int32 = UserGifts; getReceivedGifts owner_id:MessageSender exclude_unsaved:Bool exclude_saved:Bool exclude_unlimited:Bool exclude_limited:Bool exclude_upgraded:Bool sort_by_price:Bool offset:string limit:int32 = ReceivedGifts;
//@description Returns information about a gift received or sent by the current user @message_id Identifier of the message with the gift //@description Returns information about a received gift @received_gift_id Identifier of the gift
getUserGift message_id:int53 = UserGift; getReceivedGift received_gift_id:string = ReceivedGift;
//@description Returns information about an upgraded gift by its name @name Unique name of the upgraded gift
getUpgradedGift name:string = UpgradedGift;
//@description Returns a URL for upgraded gift withdrawal in the TON blockchain as an NFT; requires owner privileges for gifts owned by a chat
//@received_gift_id Identifier of the gift
//@password The 2-step verification password of the current user
getUpgradedGiftWithdrawalUrl received_gift_id:string password:string = HttpUrl;
//@description Creates a link for the given invoice; for bots only //@description Creates a link for the given invoice; for bots only