Update to TDLib 1.8.42

This commit is contained in:
c0re100 2025-01-03 06:02:55 +08:00
parent 58adcc4804
commit 626ffe1a7b
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1854 additions and 195 deletions

View file

@ -2696,8 +2696,6 @@ func (client *Client) SearchChatMessages(req *SearchChatMessagesRequest) (*Found
type SearchMessagesRequest struct { type SearchMessagesRequest struct {
// Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported // Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported
ChatList ChatList `json:"chat_list"` ChatList ChatList `json:"chat_list"`
// Pass true to search only for messages in channels
OnlyInChannels bool `json:"only_in_channels"`
// Query to search for // Query to search for
Query string `json:"query"` Query string `json:"query"`
// 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
@ -2706,6 +2704,8 @@ type SearchMessagesRequest struct {
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
// Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function // Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function
Filter SearchMessagesFilter `json:"filter"` Filter SearchMessagesFilter `json:"filter"`
// Additional filter for type of the chat of the searched messages; pass null to search for messages in all chats
ChatTypeFilter SearchMessagesChatTypeFilter `json:"chat_type_filter"`
// If not 0, the minimum date of the messages to return // If not 0, the minimum date of the messages to return
MinDate int32 `json:"min_date"` MinDate int32 `json:"min_date"`
// If not 0, the maximum date of the messages to return // If not 0, the maximum date of the messages to return
@ -2720,11 +2720,11 @@ func (client *Client) SearchMessages(req *SearchMessagesRequest) (*FoundMessages
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_list": req.ChatList, "chat_list": req.ChatList,
"only_in_channels": req.OnlyInChannels,
"query": req.Query, "query": req.Query,
"offset": req.Offset, "offset": req.Offset,
"limit": req.Limit, "limit": req.Limit,
"filter": req.Filter, "filter": req.Filter,
"chat_type_filter": req.ChatTypeFilter,
"min_date": req.MinDate, "min_date": req.MinDate,
"max_date": req.MaxDate, "max_date": req.MaxDate,
}, },
@ -13120,6 +13120,8 @@ type CreateCallRequest struct {
Protocol *CallProtocol `json:"protocol"` Protocol *CallProtocol `json:"protocol"`
// Pass true to create a video call // Pass true to create a video call
IsVideo bool `json:"is_video"` IsVideo bool `json:"is_video"`
// Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none; currently, ignored
GroupCallId int32 `json:"group_call_id"`
} }
// Creates a new call // Creates a new call
@ -13132,6 +13134,7 @@ func (client *Client) CreateCall(req *CreateCallRequest) (*CallId, error) {
"user_id": req.UserId, "user_id": req.UserId,
"protocol": req.Protocol, "protocol": req.Protocol,
"is_video": req.IsVideo, "is_video": req.IsVideo,
"group_call_id": req.GroupCallId,
}, },
}) })
if err != nil { if err != nil {
@ -13424,6 +13427,32 @@ func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId
return UnmarshalGroupCallId(result.Data) return UnmarshalGroupCallId(result.Data)
} }
type CreateGroupCallRequest struct {
// Call identifier
CallId int32 `json:"call_id"`
}
// Creates a group call from a one-to-one call
func (client *Client) CreateGroupCall(req *CreateGroupCallRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "createGroupCall",
},
Data: map[string]interface{}{
"call_id": req.CallId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetVideoChatRtmpUrlRequest struct { type GetVideoChatRtmpUrlRequest struct {
// Chat identifier // Chat identifier
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
@ -17596,6 +17625,67 @@ func (client *Client) GetBotInfoShortDescription(req *GetBotInfoShortDescription
return UnmarshalText(result.Data) return UnmarshalText(result.Data)
} }
type SetMessageSenderBotVerificationRequest struct {
// Identifier of the owned bot, which will verify the user or the chat
BotUserId int64 `json:"bot_user_id"`
// Identifier of the user or the supergroup or channel chat, which will be verified by the bot
VerifiedId MessageSender `json:"verified_id"`
// Custom description of verification reason; 0-getOption("bot_verification_custom_description_length_max"). If empty, then "was verified by organization "organization_name"" will be used as description. Can be specified only if the bot is allowed to provide custom description
CustomDescription string `json:"custom_description"`
}
// Changes the verification status of a user or a chat by an owned bot
func (client *Client) SetMessageSenderBotVerification(req *SetMessageSenderBotVerificationRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setMessageSenderBotVerification",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"verified_id": req.VerifiedId,
"custom_description": req.CustomDescription,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type RemoveMessageSenderBotVerificationRequest struct {
// Identifier of the owned bot, which verified the user or the chat
BotUserId int64 `json:"bot_user_id"`
// Identifier of the user or the supergroup or channel chat, which verification is removed
VerifiedId MessageSender `json:"verified_id"`
}
// Removes the verification status of a user or a chat by an owned bot
func (client *Client) RemoveMessageSenderBotVerification(req *RemoveMessageSenderBotVerificationRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "removeMessageSenderBotVerification",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"verified_id": req.VerifiedId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
// Returns all active sessions of the current user // Returns all active sessions of the current user
func (client *Client) GetActiveSessions() (*Sessions, error) { func (client *Client) GetActiveSessions() (*Sessions, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
@ -18693,6 +18783,8 @@ type SendGiftRequest struct {
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 the current user as sender and gift text 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
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. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out
@ -18706,6 +18798,7 @@ func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) {
"user_id": req.UserId, "user_id": req.UserId,
"text": req.Text, "text": req.Text,
"is_private": req.IsPrivate, "is_private": req.IsPrivate,
"pay_for_upgrade": req.PayForUpgrade,
}, },
}) })
if err != nil { if err != nil {
@ -18780,6 +18873,99 @@ func (client *Client) ToggleGiftIsSaved(req *ToggleGiftIsSavedRequest) (*Ok, err
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
type GetGiftUpgradePreviewRequest struct {
// Identifier of the gift
GiftId JsonInt64 `json:"gift_id"`
}
// Returns examples of possible upgraded gifts for a regular gift
func (client *Client) GetGiftUpgradePreview(req *GetGiftUpgradePreviewRequest) (*GiftUpgradePreview, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getGiftUpgradePreview",
},
Data: map[string]interface{}{
"gift_id": req.GiftId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalGiftUpgradePreview(result.Data)
}
type UpgradeGiftRequest struct {
// Identifier of the user that sent the gift
SenderUserId int64 `json:"sender_user_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
KeepOriginalDetails bool `json:"keep_original_details"`
}
// 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
func (client *Client) UpgradeGift(req *UpgradeGiftRequest) (*UpgradeGiftResult, error) {
result, err := client.Send(Request{
meta: meta{
Type: "upgradeGift",
},
Data: map[string]interface{}{
"sender_user_id": req.SenderUserId,
"message_id": req.MessageId,
"keep_original_details": req.KeepOriginalDetails,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalUpgradeGiftResult(result.Data)
}
type TransferGiftRequest struct {
// Identifier of the user that sent the gift
SenderUserId int64 `json:"sender_user_id"`
// Identifier of the message with the upgraded gift in the chat with the user
MessageId int64 `json:"message_id"`
// Identifier of the user that will receive the gift
ReceiverUserId int64 `json:"receiver_user_id"`
// The amount of Telegram Stars required for the transfer
StarCount int64 `json:"star_count"`
}
// Sends a gift upgraded by the current user to another user
func (client *Client) TransferGift(req *TransferGiftRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "transferGift",
},
Data: map[string]interface{}{
"sender_user_id": req.SenderUserId,
"message_id": req.MessageId,
"receiver_user_id": req.ReceiverUserId,
"star_count": req.StarCount,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetUserGiftsRequest struct { type GetUserGiftsRequest struct {
// Identifier of the user // Identifier of the user
UserId int64 `json:"user_id"` UserId int64 `json:"user_id"`
@ -18812,6 +18998,32 @@ func (client *Client) GetUserGifts(req *GetUserGiftsRequest) (*UserGifts, error)
return UnmarshalUserGifts(result.Data) return UnmarshalUserGifts(result.Data)
} }
type GetUserGiftRequest struct {
// Identifier of the message with the gift
MessageId int64 `json:"message_id"`
}
// Returns information about a gift received or sent by the current user
func (client *Client) GetUserGift(req *GetUserGiftRequest) (*UserGift, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getUserGift",
},
Data: map[string]interface{}{
"message_id": req.MessageId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalUserGift(result.Data)
}
type CreateInvoiceLinkRequest struct { type CreateInvoiceLinkRequest struct {
// Unique identifier of business connection on behalf of which to send the request // Unique identifier of business connection on behalf of which to send the request
BusinessConnectionId string `json:"business_connection_id"` BusinessConnectionId string `json:"business_connection_id"`
@ -22320,8 +22532,8 @@ func (client *Client) SearchChatAffiliateProgram(req *SearchChatAffiliateProgram
} }
type SearchAffiliateProgramsRequest struct { type SearchAffiliateProgramsRequest struct {
// Identifier of the chat for which affiliate programs are searched for. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right // The affiliate for which affiliate programs are searched for
ChatId int64 `json:"chat_id"` Affiliate AffiliateType `json:"affiliate"`
// Sort order for the results // Sort order for the results
SortOrder AffiliateProgramSortOrder `json:"sort_order"` SortOrder AffiliateProgramSortOrder `json:"sort_order"`
// Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results // Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results
@ -22330,14 +22542,14 @@ type SearchAffiliateProgramsRequest struct {
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
} }
// Searches affiliate programs that can be applied to the given chat // Searches affiliate programs that can be connected to the given affiliate
func (client *Client) SearchAffiliatePrograms(req *SearchAffiliateProgramsRequest) (*FoundAffiliatePrograms, error) { func (client *Client) SearchAffiliatePrograms(req *SearchAffiliateProgramsRequest) (*FoundAffiliatePrograms, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "searchAffiliatePrograms", Type: "searchAffiliatePrograms",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "affiliate": req.Affiliate,
"sort_order": req.SortOrder, "sort_order": req.SortOrder,
"offset": req.Offset, "offset": req.Offset,
"limit": req.Limit, "limit": req.Limit,
@ -22354,21 +22566,21 @@ func (client *Client) SearchAffiliatePrograms(req *SearchAffiliateProgramsReques
return UnmarshalFoundAffiliatePrograms(result.Data) return UnmarshalFoundAffiliatePrograms(result.Data)
} }
type ConnectChatAffiliateProgramRequest struct { type ConnectAffiliateProgramRequest struct {
// Identifier of the chat to which the affiliate program will be connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right // The affiliate to which the affiliate program will be connected
ChatId int64 `json:"chat_id"` Affiliate AffiliateType `json:"affiliate"`
// Identifier of the bot, which affiliate program is connected // Identifier of the bot, which affiliate program is connected
BotUserId int64 `json:"bot_user_id"` BotUserId int64 `json:"bot_user_id"`
} }
// Connects an affiliate program to the given chat. Returns information about the connected affiliate program // Connects an affiliate program to the given affiliate. Returns information about the connected affiliate program
func (client *Client) ConnectChatAffiliateProgram(req *ConnectChatAffiliateProgramRequest) (*ChatAffiliateProgram, error) { func (client *Client) ConnectAffiliateProgram(req *ConnectAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "connectChatAffiliateProgram", Type: "connectAffiliateProgram",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "affiliate": req.Affiliate,
"bot_user_id": req.BotUserId, "bot_user_id": req.BotUserId,
}, },
}) })
@ -22380,24 +22592,24 @@ func (client *Client) ConnectChatAffiliateProgram(req *ConnectChatAffiliateProgr
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalChatAffiliateProgram(result.Data) return UnmarshalConnectedAffiliateProgram(result.Data)
} }
type DisconnectChatAffiliateProgramRequest struct { type DisconnectAffiliateProgramRequest struct {
// Identifier of the chat for which the affiliate program is connected // The affiliate to which the affiliate program is connected
ChatId int64 `json:"chat_id"` Affiliate AffiliateType `json:"affiliate"`
// The referral link of the affiliate program // The referral link of the affiliate program
Url string `json:"url"` Url string `json:"url"`
} }
// Disconnects an affiliate program from the given chat and immediately deactivates its referral link. Returns updated information about the disconnected affiliate program // Disconnects an affiliate program from the given affiliate and immediately deactivates its referral link. Returns updated information about the disconnected affiliate program
func (client *Client) DisconnectChatAffiliateProgram(req *DisconnectChatAffiliateProgramRequest) (*ChatAffiliateProgram, error) { func (client *Client) DisconnectAffiliateProgram(req *DisconnectAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "disconnectChatAffiliateProgram", Type: "disconnectAffiliateProgram",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "affiliate": req.Affiliate,
"url": req.Url, "url": req.Url,
}, },
}) })
@ -22409,24 +22621,24 @@ func (client *Client) DisconnectChatAffiliateProgram(req *DisconnectChatAffiliat
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalChatAffiliateProgram(result.Data) return UnmarshalConnectedAffiliateProgram(result.Data)
} }
type GetChatAffiliateProgramRequest struct { type GetConnectedAffiliateProgramRequest struct {
// Identifier of the chat for which the affiliate program was connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right // The affiliate to which the affiliate program will be connected
ChatId int64 `json:"chat_id"` Affiliate AffiliateType `json:"affiliate"`
// Identifier of the bot that created the program // Identifier of the bot that created the program
BotUserId int64 `json:"bot_user_id"` BotUserId int64 `json:"bot_user_id"`
} }
// Returns an affiliate program that were connected to the given chat by identifier of the bot that created the program // Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program
func (client *Client) GetChatAffiliateProgram(req *GetChatAffiliateProgramRequest) (*ChatAffiliateProgram, error) { func (client *Client) GetConnectedAffiliateProgram(req *GetConnectedAffiliateProgramRequest) (*ConnectedAffiliateProgram, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getChatAffiliateProgram", Type: "getConnectedAffiliateProgram",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "affiliate": req.Affiliate,
"bot_user_id": req.BotUserId, "bot_user_id": req.BotUserId,
}, },
}) })
@ -22438,26 +22650,26 @@ func (client *Client) GetChatAffiliateProgram(req *GetChatAffiliateProgramReques
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalChatAffiliateProgram(result.Data) return UnmarshalConnectedAffiliateProgram(result.Data)
} }
type GetChatAffiliateProgramsRequest struct { type GetConnectedAffiliateProgramsRequest struct {
// Identifier of the chat for which the affiliate programs were connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right // The affiliate to which the affiliate program were connected
ChatId int64 `json:"chat_id"` Affiliate AffiliateType `json:"affiliate"`
// Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results // Offset of the first affiliate program 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 affiliate programs to return // The maximum number of affiliate programs to return
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
} }
// Returns affiliate programs that were connected to the given chat // Returns affiliate programs that were connected to the given affiliate
func (client *Client) GetChatAffiliatePrograms(req *GetChatAffiliateProgramsRequest) (*ChatAffiliatePrograms, error) { func (client *Client) GetConnectedAffiliatePrograms(req *GetConnectedAffiliateProgramsRequest) (*ConnectedAffiliatePrograms, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getChatAffiliatePrograms", Type: "getConnectedAffiliatePrograms",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"chat_id": req.ChatId, "affiliate": req.Affiliate,
"offset": req.Offset, "offset": req.Offset,
"limit": req.Limit, "limit": req.Limit,
}, },
@ -22470,7 +22682,7 @@ func (client *Client) GetChatAffiliatePrograms(req *GetChatAffiliateProgramsRequ
return nil, buildResponseError(result.Data) return nil, buildResponseError(result.Data)
} }
return UnmarshalChatAffiliatePrograms(result.Data) return UnmarshalConnectedAffiliatePrograms(result.Data)
} }
type GetBusinessFeaturesRequest struct { type GetBusinessFeaturesRequest struct {

File diff suppressed because it is too large Load diff

View file

@ -693,6 +693,43 @@ func UnmarshalListOfStarSubscriptionType(dataList []json.RawMessage) ([]StarSubs
return list, nil return list, nil
} }
func UnmarshalAffiliateType(data json.RawMessage) (AffiliateType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeAffiliateTypeCurrentUser:
return UnmarshalAffiliateTypeCurrentUser(data)
case TypeAffiliateTypeBot:
return UnmarshalAffiliateTypeBot(data)
case TypeAffiliateTypeChannel:
return UnmarshalAffiliateTypeChannel(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfAffiliateType(dataList []json.RawMessage) ([]AffiliateType, error) {
list := []AffiliateType{}
for _, data := range dataList {
entity, err := UnmarshalAffiliateType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalAffiliateProgramSortOrder(data json.RawMessage) (AffiliateProgramSortOrder, error) { func UnmarshalAffiliateProgramSortOrder(data json.RawMessage) (AffiliateProgramSortOrder, error) {
var meta meta var meta meta
@ -730,6 +767,40 @@ func UnmarshalListOfAffiliateProgramSortOrder(dataList []json.RawMessage) ([]Aff
return list, nil return list, nil
} }
func UnmarshalSentGift(data json.RawMessage) (SentGift, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeSentGiftRegular:
return UnmarshalSentGiftRegular(data)
case TypeSentGiftUpgraded:
return UnmarshalSentGiftUpgraded(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfSentGift(dataList []json.RawMessage) ([]SentGift, error) {
list := []SentGift{}
for _, data := range dataList {
entity, err := UnmarshalSentGift(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStarTransactionDirection(data json.RawMessage) (StarTransactionDirection, error) { func UnmarshalStarTransactionDirection(data json.RawMessage) (StarTransactionDirection, error) {
var meta meta var meta meta
@ -833,9 +904,15 @@ func UnmarshalStarTransactionType(data json.RawMessage) (StarTransactionType, er
case TypeStarTransactionTypeGiftPurchase: case TypeStarTransactionTypeGiftPurchase:
return UnmarshalStarTransactionTypeGiftPurchase(data) return UnmarshalStarTransactionTypeGiftPurchase(data)
case TypeStarTransactionTypeGiftTransfer:
return UnmarshalStarTransactionTypeGiftTransfer(data)
case TypeStarTransactionTypeGiftSale: case TypeStarTransactionTypeGiftSale:
return UnmarshalStarTransactionTypeGiftSale(data) return UnmarshalStarTransactionTypeGiftSale(data)
case TypeStarTransactionTypeGiftUpgrade:
return UnmarshalStarTransactionTypeGiftUpgrade(data)
case TypeStarTransactionTypeChannelPaidReactionSend: case TypeStarTransactionTypeChannelPaidReactionSend:
return UnmarshalStarTransactionTypeChannelPaidReactionSend(data) return UnmarshalStarTransactionTypeChannelPaidReactionSend(data)
@ -3341,6 +3418,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageGift: case TypeMessageGift:
return UnmarshalMessageGift(data) return UnmarshalMessageGift(data)
case TypeMessageUpgradedGift:
return UnmarshalMessageUpgradedGift(data)
case TypeMessageRefundedUpgradedGift:
return UnmarshalMessageRefundedUpgradedGift(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -3753,6 +3836,43 @@ func UnmarshalListOfSearchMessagesFilter(dataList []json.RawMessage) ([]SearchMe
return list, nil return list, nil
} }
func UnmarshalSearchMessagesChatTypeFilter(data json.RawMessage) (SearchMessagesChatTypeFilter, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeSearchMessagesChatTypeFilterPrivate:
return UnmarshalSearchMessagesChatTypeFilterPrivate(data)
case TypeSearchMessagesChatTypeFilterGroup:
return UnmarshalSearchMessagesChatTypeFilterGroup(data)
case TypeSearchMessagesChatTypeFilterChannel:
return UnmarshalSearchMessagesChatTypeFilterChannel(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfSearchMessagesChatTypeFilter(dataList []json.RawMessage) ([]SearchMessagesChatTypeFilter, error) {
list := []SearchMessagesChatTypeFilter{}
for _, data := range dataList {
entity, err := UnmarshalSearchMessagesChatTypeFilter(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) { func UnmarshalChatAction(data json.RawMessage) (ChatAction, error) {
var meta meta var meta meta
@ -4346,6 +4466,9 @@ func UnmarshalCallDiscardReason(data json.RawMessage) (CallDiscardReason, error)
case TypeCallDiscardReasonHungUp: case TypeCallDiscardReasonHungUp:
return UnmarshalCallDiscardReasonHungUp(data) return UnmarshalCallDiscardReasonHungUp(data)
case TypeCallDiscardReasonAllowGroupCall:
return UnmarshalCallDiscardReasonAllowGroupCall(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -6081,6 +6204,9 @@ func UnmarshalPushMessageContent(data json.RawMessage) (PushMessageContent, erro
case TypePushMessageContentGift: case TypePushMessageContentGift:
return UnmarshalPushMessageContentGift(data) return UnmarshalPushMessageContentGift(data)
case TypePushMessageContentUpgradedGift:
return UnmarshalPushMessageContentUpgradedGift(data)
case TypePushMessageContentScreenshotTaken: case TypePushMessageContentScreenshotTaken:
return UnmarshalPushMessageContentScreenshotTaken(data) return UnmarshalPushMessageContentScreenshotTaken(data)
@ -7333,6 +7459,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) {
case TypeSuggestedActionSetBirthdate: case TypeSuggestedActionSetBirthdate:
return UnmarshalSuggestedActionSetBirthdate(data) return UnmarshalSuggestedActionSetBirthdate(data)
case TypeSuggestedActionSetProfilePhoto:
return UnmarshalSuggestedActionSetProfilePhoto(data)
case TypeSuggestedActionExtendPremium: case TypeSuggestedActionExtendPremium:
return UnmarshalSuggestedActionExtendPremium(data) return UnmarshalSuggestedActionExtendPremium(data)
@ -9078,6 +9207,30 @@ func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) {
return &resp, err return &resp, err
} }
func UnmarshalBotVerificationParameters(data json.RawMessage) (*BotVerificationParameters, error) {
var resp BotVerificationParameters
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalBotVerification(data json.RawMessage) (*BotVerification, error) {
var resp BotVerification
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalVerificationStatus(data json.RawMessage) (*VerificationStatus, error) {
var resp VerificationStatus
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) { func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) {
var resp ChatLocation var resp ChatLocation
@ -9382,6 +9535,30 @@ func UnmarshalStarSubscriptions(data json.RawMessage) (*StarSubscriptions, error
return &resp, err return &resp, err
} }
func UnmarshalAffiliateTypeCurrentUser(data json.RawMessage) (*AffiliateTypeCurrentUser, error) {
var resp AffiliateTypeCurrentUser
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAffiliateTypeBot(data json.RawMessage) (*AffiliateTypeBot, error) {
var resp AffiliateTypeBot
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAffiliateTypeChannel(data json.RawMessage) (*AffiliateTypeChannel, error) {
var resp AffiliateTypeChannel
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAffiliateProgramSortOrderProfitability(data json.RawMessage) (*AffiliateProgramSortOrderProfitability, error) { func UnmarshalAffiliateProgramSortOrderProfitability(data json.RawMessage) (*AffiliateProgramSortOrderProfitability, error) {
var resp AffiliateProgramSortOrderProfitability var resp AffiliateProgramSortOrderProfitability
@ -9446,16 +9623,16 @@ func UnmarshalFoundAffiliatePrograms(data json.RawMessage) (*FoundAffiliateProgr
return &resp, err return &resp, err
} }
func UnmarshalChatAffiliateProgram(data json.RawMessage) (*ChatAffiliateProgram, error) { func UnmarshalConnectedAffiliateProgram(data json.RawMessage) (*ConnectedAffiliateProgram, error) {
var resp ChatAffiliateProgram var resp ConnectedAffiliateProgram
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalChatAffiliatePrograms(data json.RawMessage) (*ChatAffiliatePrograms, error) { func UnmarshalConnectedAffiliatePrograms(data json.RawMessage) (*ConnectedAffiliatePrograms, error) {
var resp ChatAffiliatePrograms var resp ConnectedAffiliatePrograms
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
@ -9550,6 +9727,38 @@ func UnmarshalStarGiveawayPaymentOptions(data json.RawMessage) (*StarGiveawayPay
return &resp, err return &resp, err
} }
func UnmarshalUpgradedGiftModel(data json.RawMessage) (*UpgradedGiftModel, error) {
var resp UpgradedGiftModel
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradedGiftSymbol(data json.RawMessage) (*UpgradedGiftSymbol, error) {
var resp UpgradedGiftSymbol
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradedGiftBackdrop(data json.RawMessage) (*UpgradedGiftBackdrop, error) {
var resp UpgradedGiftBackdrop
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradedGiftOriginalDetails(data json.RawMessage) (*UpgradedGiftOriginalDetails, error) {
var resp UpgradedGiftOriginalDetails
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalGift(data json.RawMessage) (*Gift, error) { func UnmarshalGift(data json.RawMessage) (*Gift, error) {
var resp Gift var resp Gift
@ -9566,6 +9775,38 @@ func UnmarshalGifts(data json.RawMessage) (*Gifts, error) {
return &resp, err return &resp, err
} }
func UnmarshalUpgradedGift(data json.RawMessage) (*UpgradedGift, error) {
var resp UpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpgradeGiftResult(data json.RawMessage) (*UpgradeGiftResult, error) {
var resp UpgradeGiftResult
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSentGiftRegular(data json.RawMessage) (*SentGiftRegular, error) {
var resp SentGiftRegular
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSentGiftUpgraded(data json.RawMessage) (*SentGiftUpgraded, error) {
var resp SentGiftUpgraded
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUserGift(data json.RawMessage) (*UserGift, error) { func UnmarshalUserGift(data json.RawMessage) (*UserGift, error) {
var resp UserGift var resp UserGift
@ -9582,6 +9823,14 @@ func UnmarshalUserGifts(data json.RawMessage) (*UserGifts, error) {
return &resp, err return &resp, err
} }
func UnmarshalGiftUpgradePreview(data json.RawMessage) (*GiftUpgradePreview, error) {
var resp GiftUpgradePreview
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionDirectionIncoming(data json.RawMessage) (*StarTransactionDirectionIncoming, error) { func UnmarshalStarTransactionDirectionIncoming(data json.RawMessage) (*StarTransactionDirectionIncoming, error) {
var resp StarTransactionDirectionIncoming var resp StarTransactionDirectionIncoming
@ -9758,6 +10007,14 @@ func UnmarshalStarTransactionTypeGiftPurchase(data json.RawMessage) (*StarTransa
return &resp, err return &resp, err
} }
func UnmarshalStarTransactionTypeGiftTransfer(data json.RawMessage) (*StarTransactionTypeGiftTransfer, error) {
var resp StarTransactionTypeGiftTransfer
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypeGiftSale(data json.RawMessage) (*StarTransactionTypeGiftSale, error) { func UnmarshalStarTransactionTypeGiftSale(data json.RawMessage) (*StarTransactionTypeGiftSale, error) {
var resp StarTransactionTypeGiftSale var resp StarTransactionTypeGiftSale
@ -9766,6 +10023,14 @@ func UnmarshalStarTransactionTypeGiftSale(data json.RawMessage) (*StarTransactio
return &resp, err return &resp, err
} }
func UnmarshalStarTransactionTypeGiftUpgrade(data json.RawMessage) (*StarTransactionTypeGiftUpgrade, error) {
var resp StarTransactionTypeGiftUpgrade
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionTypeChannelPaidReactionSend(data json.RawMessage) (*StarTransactionTypeChannelPaidReactionSend, error) { func UnmarshalStarTransactionTypeChannelPaidReactionSend(data json.RawMessage) (*StarTransactionTypeChannelPaidReactionSend, error) {
var resp StarTransactionTypeChannelPaidReactionSend var resp StarTransactionTypeChannelPaidReactionSend
@ -11054,6 +11319,14 @@ func UnmarshalChatFolderIcon(data json.RawMessage) (*ChatFolderIcon, error) {
return &resp, err return &resp, err
} }
func UnmarshalChatFolderName(data json.RawMessage) (*ChatFolderName, error) {
var resp ChatFolderName
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatFolder(data json.RawMessage) (*ChatFolder, error) { func UnmarshalChatFolder(data json.RawMessage) (*ChatFolder, error) {
var resp ChatFolder var resp ChatFolder
@ -13838,6 +14111,22 @@ func UnmarshalMessageGift(data json.RawMessage) (*MessageGift, error) {
return &resp, err return &resp, err
} }
func UnmarshalMessageUpgradedGift(data json.RawMessage) (*MessageUpgradedGift, error) {
var resp MessageUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageRefundedUpgradedGift(data json.RawMessage) (*MessageRefundedUpgradedGift, error) {
var resp MessageRefundedUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) { func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) {
var resp MessageContactRegistered var resp MessageContactRegistered
@ -14478,6 +14767,30 @@ func UnmarshalSearchMessagesFilterPinned(data json.RawMessage) (*SearchMessagesF
return &resp, err return &resp, err
} }
func UnmarshalSearchMessagesChatTypeFilterPrivate(data json.RawMessage) (*SearchMessagesChatTypeFilterPrivate, error) {
var resp SearchMessagesChatTypeFilterPrivate
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSearchMessagesChatTypeFilterGroup(data json.RawMessage) (*SearchMessagesChatTypeFilterGroup, error) {
var resp SearchMessagesChatTypeFilterGroup
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSearchMessagesChatTypeFilterChannel(data json.RawMessage) (*SearchMessagesChatTypeFilterChannel, error) {
var resp SearchMessagesChatTypeFilterChannel
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) { func UnmarshalChatActionTyping(data json.RawMessage) (*ChatActionTyping, error) {
var resp ChatActionTyping var resp ChatActionTyping
@ -15318,6 +15631,14 @@ func UnmarshalCallDiscardReasonHungUp(data json.RawMessage) (*CallDiscardReasonH
return &resp, err return &resp, err
} }
func UnmarshalCallDiscardReasonAllowGroupCall(data json.RawMessage) (*CallDiscardReasonAllowGroupCall, error) {
var resp CallDiscardReasonAllowGroupCall
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCallProtocol(data json.RawMessage) (*CallProtocol, error) { func UnmarshalCallProtocol(data json.RawMessage) (*CallProtocol, error) {
var resp CallProtocol var resp CallProtocol
@ -17838,6 +18159,14 @@ func UnmarshalPushMessageContentGift(data json.RawMessage) (*PushMessageContentG
return &resp, err return &resp, err
} }
func UnmarshalPushMessageContentUpgradedGift(data json.RawMessage) (*PushMessageContentUpgradedGift, error) {
var resp PushMessageContentUpgradedGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPushMessageContentScreenshotTaken(data json.RawMessage) (*PushMessageContentScreenshotTaken, error) { func UnmarshalPushMessageContentScreenshotTaken(data json.RawMessage) (*PushMessageContentScreenshotTaken, error) {
var resp PushMessageContentScreenshotTaken var resp PushMessageContentScreenshotTaken
@ -19814,6 +20143,14 @@ func UnmarshalSuggestedActionSetBirthdate(data json.RawMessage) (*SuggestedActio
return &resp, err return &resp, err
} }
func UnmarshalSuggestedActionSetProfilePhoto(data json.RawMessage) (*SuggestedActionSetProfilePhoto, error) {
var resp SuggestedActionSetProfilePhoto
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSuggestedActionExtendPremium(data json.RawMessage) (*SuggestedActionExtendPremium, error) { func UnmarshalSuggestedActionExtendPremium(data json.RawMessage) (*SuggestedActionExtendPremium, error) {
var resp SuggestedActionExtendPremium var resp SuggestedActionExtendPremium
@ -21895,6 +22232,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeBotMenuButton: case TypeBotMenuButton:
return UnmarshalBotMenuButton(data) return UnmarshalBotMenuButton(data)
case TypeBotVerificationParameters:
return UnmarshalBotVerificationParameters(data)
case TypeBotVerification:
return UnmarshalBotVerification(data)
case TypeVerificationStatus:
return UnmarshalVerificationStatus(data)
case TypeChatLocation: case TypeChatLocation:
return UnmarshalChatLocation(data) return UnmarshalChatLocation(data)
@ -22009,6 +22355,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarSubscriptions: case TypeStarSubscriptions:
return UnmarshalStarSubscriptions(data) return UnmarshalStarSubscriptions(data)
case TypeAffiliateTypeCurrentUser:
return UnmarshalAffiliateTypeCurrentUser(data)
case TypeAffiliateTypeBot:
return UnmarshalAffiliateTypeBot(data)
case TypeAffiliateTypeChannel:
return UnmarshalAffiliateTypeChannel(data)
case TypeAffiliateProgramSortOrderProfitability: case TypeAffiliateProgramSortOrderProfitability:
return UnmarshalAffiliateProgramSortOrderProfitability(data) return UnmarshalAffiliateProgramSortOrderProfitability(data)
@ -22033,11 +22388,11 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeFoundAffiliatePrograms: case TypeFoundAffiliatePrograms:
return UnmarshalFoundAffiliatePrograms(data) return UnmarshalFoundAffiliatePrograms(data)
case TypeChatAffiliateProgram: case TypeConnectedAffiliateProgram:
return UnmarshalChatAffiliateProgram(data) return UnmarshalConnectedAffiliateProgram(data)
case TypeChatAffiliatePrograms: case TypeConnectedAffiliatePrograms:
return UnmarshalChatAffiliatePrograms(data) return UnmarshalConnectedAffiliatePrograms(data)
case TypeProductInfo: case TypeProductInfo:
return UnmarshalProductInfo(data) return UnmarshalProductInfo(data)
@ -22072,18 +22427,45 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarGiveawayPaymentOptions: case TypeStarGiveawayPaymentOptions:
return UnmarshalStarGiveawayPaymentOptions(data) return UnmarshalStarGiveawayPaymentOptions(data)
case TypeUpgradedGiftModel:
return UnmarshalUpgradedGiftModel(data)
case TypeUpgradedGiftSymbol:
return UnmarshalUpgradedGiftSymbol(data)
case TypeUpgradedGiftBackdrop:
return UnmarshalUpgradedGiftBackdrop(data)
case TypeUpgradedGiftOriginalDetails:
return UnmarshalUpgradedGiftOriginalDetails(data)
case TypeGift: case TypeGift:
return UnmarshalGift(data) return UnmarshalGift(data)
case TypeGifts: case TypeGifts:
return UnmarshalGifts(data) return UnmarshalGifts(data)
case TypeUpgradedGift:
return UnmarshalUpgradedGift(data)
case TypeUpgradeGiftResult:
return UnmarshalUpgradeGiftResult(data)
case TypeSentGiftRegular:
return UnmarshalSentGiftRegular(data)
case TypeSentGiftUpgraded:
return UnmarshalSentGiftUpgraded(data)
case TypeUserGift: case TypeUserGift:
return UnmarshalUserGift(data) return UnmarshalUserGift(data)
case TypeUserGifts: case TypeUserGifts:
return UnmarshalUserGifts(data) return UnmarshalUserGifts(data)
case TypeGiftUpgradePreview:
return UnmarshalGiftUpgradePreview(data)
case TypeStarTransactionDirectionIncoming: case TypeStarTransactionDirectionIncoming:
return UnmarshalStarTransactionDirectionIncoming(data) return UnmarshalStarTransactionDirectionIncoming(data)
@ -22150,9 +22532,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarTransactionTypeGiftPurchase: case TypeStarTransactionTypeGiftPurchase:
return UnmarshalStarTransactionTypeGiftPurchase(data) return UnmarshalStarTransactionTypeGiftPurchase(data)
case TypeStarTransactionTypeGiftTransfer:
return UnmarshalStarTransactionTypeGiftTransfer(data)
case TypeStarTransactionTypeGiftSale: case TypeStarTransactionTypeGiftSale:
return UnmarshalStarTransactionTypeGiftSale(data) return UnmarshalStarTransactionTypeGiftSale(data)
case TypeStarTransactionTypeGiftUpgrade:
return UnmarshalStarTransactionTypeGiftUpgrade(data)
case TypeStarTransactionTypeChannelPaidReactionSend: case TypeStarTransactionTypeChannelPaidReactionSend:
return UnmarshalStarTransactionTypeChannelPaidReactionSend(data) return UnmarshalStarTransactionTypeChannelPaidReactionSend(data)
@ -22636,6 +23024,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatFolderIcon: case TypeChatFolderIcon:
return UnmarshalChatFolderIcon(data) return UnmarshalChatFolderIcon(data)
case TypeChatFolderName:
return UnmarshalChatFolderName(data)
case TypeChatFolder: case TypeChatFolder:
return UnmarshalChatFolder(data) return UnmarshalChatFolder(data)
@ -23680,6 +24071,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageGift: case TypeMessageGift:
return UnmarshalMessageGift(data) return UnmarshalMessageGift(data)
case TypeMessageUpgradedGift:
return UnmarshalMessageUpgradedGift(data)
case TypeMessageRefundedUpgradedGift:
return UnmarshalMessageRefundedUpgradedGift(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -23920,6 +24317,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSearchMessagesFilterPinned: case TypeSearchMessagesFilterPinned:
return UnmarshalSearchMessagesFilterPinned(data) return UnmarshalSearchMessagesFilterPinned(data)
case TypeSearchMessagesChatTypeFilterPrivate:
return UnmarshalSearchMessagesChatTypeFilterPrivate(data)
case TypeSearchMessagesChatTypeFilterGroup:
return UnmarshalSearchMessagesChatTypeFilterGroup(data)
case TypeSearchMessagesChatTypeFilterChannel:
return UnmarshalSearchMessagesChatTypeFilterChannel(data)
case TypeChatActionTyping: case TypeChatActionTyping:
return UnmarshalChatActionTyping(data) return UnmarshalChatActionTyping(data)
@ -24235,6 +24641,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeCallDiscardReasonHungUp: case TypeCallDiscardReasonHungUp:
return UnmarshalCallDiscardReasonHungUp(data) return UnmarshalCallDiscardReasonHungUp(data)
case TypeCallDiscardReasonAllowGroupCall:
return UnmarshalCallDiscardReasonAllowGroupCall(data)
case TypeCallProtocol: case TypeCallProtocol:
return UnmarshalCallProtocol(data) return UnmarshalCallProtocol(data)
@ -25180,6 +25589,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePushMessageContentGift: case TypePushMessageContentGift:
return UnmarshalPushMessageContentGift(data) return UnmarshalPushMessageContentGift(data)
case TypePushMessageContentUpgradedGift:
return UnmarshalPushMessageContentUpgradedGift(data)
case TypePushMessageContentScreenshotTaken: case TypePushMessageContentScreenshotTaken:
return UnmarshalPushMessageContentScreenshotTaken(data) return UnmarshalPushMessageContentScreenshotTaken(data)
@ -25921,6 +26333,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSuggestedActionSetBirthdate: case TypeSuggestedActionSetBirthdate:
return UnmarshalSuggestedActionSetBirthdate(data) return UnmarshalSuggestedActionSetBirthdate(data)
case TypeSuggestedActionSetProfilePhoto:
return UnmarshalSuggestedActionSetProfilePhoto(data)
case TypeSuggestedActionExtendPremium: case TypeSuggestedActionExtendPremium:
return UnmarshalSuggestedActionExtendPremium(data) return UnmarshalSuggestedActionExtendPremium(data)

View file

@ -608,6 +608,27 @@ botCommands bot_user_id:int53 commands:vector<botCommand> = BotCommands;
botMenuButton text:string url:string = BotMenuButton; botMenuButton text:string url:string = BotMenuButton;
//@description Describes parameters of verification that is provided by a bot
//@icon_custom_emoji_id Identifier of the custom emoji that is used as the verification sign
//@organization_name Name of the organization that provides verification
//@default_custom_description Default custom description of verification reason to be used as placeholder in setMessageSenderBotVerification; may be null if none
//@can_set_custom_description True, if the bot is allowed to provide custom description for verified entities
botVerificationParameters icon_custom_emoji_id:int64 organization_name:string default_custom_description:formattedText can_set_custom_description:Bool = BotVerificationParameters;
//@description Describes verification status provided by a bot
//@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
//@custom_description Custom description of verification reason set by the bot
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
//@is_verified True, if the chat or the user is verified by Telegram
//@is_scam True, if the chat or the user is marked as scam by Telegram
//@is_fake True, if the chat or the user is marked as fake by Telegram
//@bot_verification_icon_custom_emoji_id Identifier of the custom emoji to be shown as verification sign provided by a bot for the user; 0 if none
verificationStatus is_verified:Bool is_scam:Bool is_fake:Bool bot_verification_icon_custom_emoji_id:int64 = VerificationStatus;
//@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner //@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner
chatLocation location:location address:string = ChatLocation; chatLocation location:location address:string = ChatLocation;
@ -857,6 +878,18 @@ starSubscription id:string chat_id:int53 expiration_date:int32 is_canceled:Bool
starSubscriptions star_amount:starAmount subscriptions:vector<starSubscription> required_star_count:int53 next_offset:string = StarSubscriptions; starSubscriptions star_amount:starAmount subscriptions:vector<starSubscription> required_star_count:int53 next_offset:string = StarSubscriptions;
//@class AffiliateType @description Describes type of affiliate for an affiliate program
//@description The affiliate is the current user
affiliateTypeCurrentUser = AffiliateType;
//@description The affiliate is a bot owned by the current user @user_id User identifier of the bot
affiliateTypeBot user_id:int53 = AffiliateType;
//@description The affiliate is a channel chat where the current user has can_post_messages administrator right @chat_id Identifier of the channel chat
affiliateTypeChannel chat_id:int53 = AffiliateType;
//@class AffiliateProgramSortOrder @description Describes the order of the found affiliate programs //@class AffiliateProgramSortOrder @description Describes the order of the found affiliate programs
//@description The affiliate programs must be sorted by the profitability //@description The affiliate programs must be sorted by the profitability
@ -878,7 +911,7 @@ affiliateProgramParameters commission_per_mille:int32 month_count:int32 = Affili
//@description Contains information about an active affiliate program //@description Contains information about an active affiliate program
//@parameters Parameters of the affiliate program //@parameters Parameters of the affiliate program
//@end_date Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the affiliate program isn't scheduled to be closed. //@end_date Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the affiliate program isn't scheduled to be closed.
//-If positive, then the program can't be connected using connectChatAffiliateProgram, but active connections will work until the date //-If positive, then the program can't be connected using connectAffiliateProgram, but active connections will work until the date
//@daily_revenue_per_user_amount The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program //@daily_revenue_per_user_amount The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program
affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_revenue_per_user_amount:starAmount = AffiliateProgramInfo; affiliateProgramInfo parameters:affiliateProgramParameters end_date:int32 daily_revenue_per_user_amount:starAmount = AffiliateProgramInfo;
@ -890,8 +923,8 @@ affiliateInfo commission_per_mille:int32 affiliate_chat_id:int53 star_amount:sta
//@description Describes a found affiliate program //@description Describes a found affiliate program
//@bot_user_id User identifier of the bot created the program //@bot_user_id User identifier of the bot created the program
//@parameters Information about the affiliate program //@info Information about the affiliate program
foundAffiliateProgram bot_user_id:int53 parameters:affiliateProgramInfo = FoundAffiliateProgram; foundAffiliateProgram bot_user_id:int53 info:affiliateProgramInfo = FoundAffiliateProgram;
//@description Represents a list of found affiliate programs //@description Represents a list of found affiliate programs
//@total_count The total number of found affiliate programs //@total_count The total number of found affiliate programs
@ -899,7 +932,7 @@ foundAffiliateProgram bot_user_id:int53 parameters:affiliateProgramInfo = FoundA
//@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
foundAffiliatePrograms total_count:int32 programs:vector<foundAffiliateProgram> next_offset:string = FoundAffiliatePrograms; foundAffiliatePrograms total_count:int32 programs:vector<foundAffiliateProgram> next_offset:string = FoundAffiliatePrograms;
//@description Describes an affiliate program that was connected to a chat //@description Describes an affiliate program that was connected to an affiliate
//@url The link that can be used to refer users if the program is still active //@url The link that can be used to refer users if the program is still active
//@bot_user_id User identifier of the bot created the program //@bot_user_id User identifier of the bot created the program
//@parameters The parameters of the affiliate program //@parameters The parameters of the affiliate program
@ -907,13 +940,13 @@ foundAffiliatePrograms total_count:int32 programs:vector<foundAffiliateProgram>
//@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore //@is_disconnected True, if the program was canceled by the bot, or disconnected by the chat owner and isn't available anymore
//@user_count The number of users that used the affiliate program //@user_count The number of users that used the affiliate program
//@revenue_star_count The number of Telegram Stars that were earned by the affiliate program //@revenue_star_count The number of Telegram Stars that were earned by the affiliate program
chatAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int64 = ChatAffiliateProgram; connectedAffiliateProgram url:string bot_user_id:int53 parameters:affiliateProgramParameters connection_date:int32 is_disconnected:Bool user_count:int64 revenue_star_count:int64 = ConnectedAffiliateProgram;
//@description Represents a list of affiliate programs that were connected to a chat //@description Represents a list of affiliate programs that were connected to an affiliate
//@total_count The total number of affiliate programs that were connected to the chat //@total_count The total number of affiliate programs that were connected to the affiliate
//@programs The list of connected affiliate programs //@programs The list of connected affiliate programs
//@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
chatAffiliatePrograms total_count:int32 programs:vector<chatAffiliateProgram> next_offset:string = ChatAffiliatePrograms; connectedAffiliatePrograms total_count:int32 programs:vector<connectedAffiliateProgram> next_offset:string = ConnectedAffiliatePrograms;
//@description Contains information about a product that can be paid with invoice //@description Contains information about a product that can be paid with invoice
@ -994,31 +1027,98 @@ starGiveawayPaymentOption currency:string amount:int53 star_count:int53 store_pr
//@description Contains a list of options for creating Telegram Star giveaway @options The list of options //@description Contains a list of options for creating Telegram Star giveaway @options The list of options
starGiveawayPaymentOptions options:vector<starGiveawayPaymentOption> = StarGiveawayPaymentOptions; starGiveawayPaymentOptions options:vector<starGiveawayPaymentOption> = StarGiveawayPaymentOptions;
//@description Describes a model of an upgraded gift
//@name Name of the model
//@sticker The sticker representing the upgraded gift
//@rarity_per_mille The number of upgraded gift that receive this model for each 1000 gifts upgraded
upgradedGiftModel name:string sticker:sticker rarity_per_mille:int32 = UpgradedGiftModel;
//@description Describes a symbol shown on the pattern of an upgraded gift
//@name Name of the symbol
//@sticker The sticker representing the upgraded gift
//@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;
//@description Describes 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
//@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
//@text_color A color for the text on the backdrop in the RGB format
//@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;
//@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
//@receiver_user_id Identifier of the user that received the gift
//@text Message added to the gift
//@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;
//@description Describes a gift that can be sent to another user //@description Describes a gift that can be sent to another user
//@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 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
//@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 by all users; 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 by all users; 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 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 @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
//@id Unique identifier of the gift
//@title The title of the upgraded 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
//@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
//@model Model of the upgraded gift
//@symbol Symbol of the upgraded gift
//@backdrop Backdrop of the upgraded gift
//@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;
//@description Contains result of gift upgrading
//@gift The upgraded gift
//@is_saved True, if the gift is displayed on the user's profile page
//@can_be_transferred True, if the gift can be transferred to another user
//@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
upgradeGiftResult gift:upgradedGift 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
//@description Regular gift @gift The gift
sentGiftRegular gift:gift = SentGift;
//@description Upgraded gift @gift The gift
sentGiftUpgraded gift:upgradedGift = SentGift;
//@description Represents a gift received by a user //@description Represents a gift received by a user
//@sender_user_id Identifier of the user that sent the gift; 0 if unknown //@sender_user_id Identifier of the user that sent the gift; 0 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; may be false only for the receiver of the gift //@is_saved True, if the gift is displayed on the user'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_transferred True, if the gift is an upgraded gift that can be transferred to another user; only for the receiver of the gift
//@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 gift receiver //@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 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
userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool date:int32 gift:gift message_id:int53 sell_star_count:int53 = UserGift; //@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
//@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
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;
//@description Represents a list of gifts received by a user //@description Represents a list of gifts received by a user
//@total_count The total number of received gifts //@total_count The total number of received gifts
@ -1026,6 +1126,12 @@ userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool d
//@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; userGifts total_count:int32 gifts:vector<userGift> next_offset:string = UserGifts;
//@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
//@symbols Examples of possible symbols that can be chosen for the gift after upgrade
//@backdrops Examples of possible backdrops that can be chosen for the gift after upgrade
giftUpgradePreview models:vector<upgradedGiftModel> symbols:vector<upgradedGiftSymbol> backdrops:vector<upgradedGiftBackdrop> = GiftUpgradePreview;
//@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars //@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars
@ -1129,12 +1235,18 @@ 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 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 to another user; for regular users and bots only @user_id Identifier of the user that received the gift @gift The gift
starTransactionTypeGiftPurchase user_id:int53 gift:gift = StarTransactionType; starTransactionTypeGiftPurchase user_id:int53 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
starTransactionTypeGiftTransfer user_id:int53 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 gift received from another user or bot; for regular users 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
starTransactionTypeGiftUpgrade gift:upgradedGift = StarTransactionType;
//@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only //@description The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only
//@chat_id Identifier of the channel chat //@chat_id Identifier of the channel chat
//@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message //@message_id Identifier of the reacted message; can be 0 or an identifier of a deleted message
@ -1272,12 +1384,10 @@ usernames active_usernames:vector<string> disabled_usernames:vector<string> edit
//@is_contact The user is a contact of the current user //@is_contact The user is a contact of the current user
//@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user //@is_mutual_contact The user is a contact of the current user and the current user is a contact of the user
//@is_close_friend The user is a close friend of the current user; implies that the user is a contact //@is_close_friend The user is a close friend of the current user; implies that the user is a contact
//@is_verified True, if the user is verified //@verification_status Information about verification status of the user; may be null if none
//@is_premium True, if the user is a Telegram Premium user //@is_premium True, if the user is a Telegram Premium user
//@is_support True, if the user is Telegram support account //@is_support True, if the user is Telegram support account
//@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted //@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
//@is_scam True, if many users reported this user as a scam
//@is_fake True, if many users reported this user as a fake account
//@has_active_stories True, if the user has non-expired stories available to the current user //@has_active_stories True, if the user has non-expired stories available to the current user
//@has_unread_active_stories True, if the user has unread non-expired stories available to the current user //@has_unread_active_stories True, if the user has unread non-expired stories available to the current user
//@restricts_new_chats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them //@restricts_new_chats True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them
@ -1285,7 +1395,7 @@ usernames active_usernames:vector<string> disabled_usernames:vector<string> edit
//@type Type of the user //@type Type of the user
//@language_code IETF language tag of the user's language; only available to bots //@language_code IETF language tag of the user's language; only available to bots
//@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots
user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; user id:int53 access_hash:int64 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto accent_color_id:int32 background_custom_emoji_id:int64 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_close_friend:Bool verification_status:verificationStatus is_premium:Bool is_support:Bool restriction_reason:string has_active_stories:Bool has_unread_active_stories:Bool restricts_new_chats:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User;
//@description Contains information about a bot //@description Contains information about a bot
@ -1303,6 +1413,7 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use
//@web_app_background_dark_color Default dark background color for bot Web Apps; -1 if not specified //@web_app_background_dark_color Default dark background color for bot Web Apps; -1 if not specified
//@web_app_header_light_color Default light header color for bot Web Apps; -1 if not specified //@web_app_header_light_color Default light header color for bot Web Apps; -1 if not specified
//@web_app_header_dark_color Default dark header color for bot Web Apps; -1 if not specified //@web_app_header_dark_color Default dark header color for bot Web Apps; -1 if not specified
//@verification_parameters Parameters of the verification that can be provided by the bot; may be null if none or the current user isn't the owner of the bot
//@can_get_revenue_statistics True, if the bot's revenue statistics are available to the current user //@can_get_revenue_statistics True, if the bot's revenue statistics are available to the current user
//@can_manage_emoji_status True, if the bot can manage emoji status of the current user //@can_manage_emoji_status True, if the bot can manage emoji status of the current user
//@has_media_previews True, if the bot has media previews //@has_media_previews True, if the bot has media previews
@ -1310,7 +1421,7 @@ user id:int53 access_hash:int64 first_name:string last_name:string usernames:use
//@edit_description_link The internal link, which can be used to edit bot description; may be null //@edit_description_link The internal link, which can be used to edit bot description; may be null
//@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null //@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null
//@edit_settings_link The internal link, which can be used to edit bot settings; may be null //@edit_settings_link The internal link, which can be used to edit bot settings; may be null
botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights affiliate_program:affiliateProgramInfo web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; botInfo short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights affiliate_program:affiliateProgramInfo web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 verification_parameters:botVerificationParameters can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo;
//@description Contains full information about a user //@description Contains full information about a user
//@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown.
@ -1334,9 +1445,10 @@ botInfo short_description:string description:string photo:photo animation:animat
//@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 gifts saved to profile by the 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
//@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
//@bot_info For bots, information about the bot; may be null if the user isn't a bot //@bot_info For bots, information about the bot; may be null if the user isn't a bot
userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo; userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 gift_count:int32 group_in_common_count:int32 bot_verification:botVerification business_info:businessInfo bot_info:botInfo = UserFullInfo;
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers //@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
users total_count:int32 user_ids:vector<int53> = Users; users total_count:int32 user_ids:vector<int53> = Users;
@ -1518,10 +1630,8 @@ chatInviteLinkSubscriptionInfo pricing:starSubscriptionPricing can_reuse:Bool fo
//@subscription_info Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn't require subscription //@subscription_info Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn't require subscription
//@creates_join_request True, if the link only creates join request //@creates_join_request True, if the link only creates join request
//@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup //@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
//@is_verified True, if the chat is verified //@verification_status Information about verification status of the chat; may be null if none
//@is_scam True, if many users reported this chat as a scam chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector<int53> subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool verification_status:verificationStatus = ChatInviteLinkInfo;
//@is_fake True, if many users reported this chat as a fake account
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:InviteLinkChatType title:string photo:chatPhotoInfo accent_color_id:int32 description:string member_count:int32 member_user_ids:vector<int53> subscription_info:chatInviteLinkSubscriptionInfo creates_join_request:Bool is_public:Bool is_verified:Bool is_scam:Bool is_fake:Bool = ChatInviteLinkInfo;
//@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user //@description Describes a user that sent a join request and waits for administrator approval @user_id User identifier @date Point in time (Unix timestamp) when the user sent the join request @bio A short bio of the user
@ -1536,12 +1646,11 @@ chatJoinRequestsInfo total_count:int32 user_ids:vector<int53> = ChatJoinRequests
//@description Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users) //@description Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
//@id Group identifier //@id Group identifier
//@access_hash Group access hash
//@member_count Number of members in the group //@member_count Number of members in the group
//@status Status of the current user in the group //@status Status of the current user in the group
//@is_active True, if the group is active //@is_active True, if the group is active
//@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none //@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none
basicGroup id:int53 access_hash:int64 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup;
//@description Contains full information about a basic group //@description Contains full information about a basic group
//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
@ -1578,14 +1687,12 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb
//@is_channel True, if the supergroup is a channel //@is_channel True, if the supergroup is a channel
//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members //@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members
//@is_forum True, if the supergroup is a forum with topics //@is_forum True, if the supergroup is a forum with topics
//@is_verified True, if the supergroup or channel is verified //@verification_status Information about verification status of the supergroup or channel; may be null if none
//@has_sensitive_content True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler //@has_sensitive_content True, if content of media messages in the supergroup or channel chat must be hidden with 18+ spoiler
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
//@is_scam True, if many users reported this supergroup or channel as a scam
//@is_fake True, if many users reported this supergroup or channel as a fake account
//@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user //@has_active_stories True, if the supergroup or channel has non-expired stories available to the current user
//@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user //@has_unread_active_stories True, if the supergroup or channel has unread non-expired stories available to the current user
supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool is_verified:Bool has_sensitive_content:Bool restriction_reason:string is_scam:Bool is_fake:Bool has_active_stories:Bool has_unread_active_stories:Bool = Supergroup; supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 boost_level:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool show_message_sender:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum:Bool verification_status:verificationStatus has_sensitive_content:Bool restriction_reason:string has_active_stories:Bool has_unread_active_stories:Bool = Supergroup;
//@description Contains full information about a supergroup or channel //@description Contains full information about a supergroup or channel
//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
@ -1620,9 +1727,10 @@ supergroup id:int53 access_hash:int64 usernames:usernames date:int32 status:Chat
//@location Location to which the supergroup is connected; may be null if none //@location Location to which the supergroup is connected; may be null if none
//@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only //@invite_link Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
//@bot_commands List of commands of bots in the group //@bot_commands List of commands of bots in the group
//@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> 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_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;
//@class SecretChatState @description Describes the current secret chat state //@class SecretChatState @description Describes the current secret chat state
@ -2140,8 +2248,13 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType;
//-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette" //-"Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"
chatFolderIcon name:string = ChatFolderIcon; chatFolderIcon name:string = ChatFolderIcon;
//@description Describes name of a chat folder
//@text The text of the chat folder name; 1-12 characters without line feeds. May contain only CustomEmoji entities
//@animate_custom_emoji True, if custom emoji in the name must be animated
chatFolderName text:formattedText animate_custom_emoji:Bool = ChatFolderName;
//@description Represents a folder for user chats //@description Represents a folder for user chats
//@title The title of the folder; 1-12 characters without line feeds //@name The name of the folder
//@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder //@icon The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription //@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription
//@is_shareable True, if at least one link has been created for the folder //@is_shareable True, if at least one link has been created for the folder
@ -2156,16 +2269,16 @@ chatFolderIcon name:string = ChatFolderIcon;
//@include_bots True, if bots need to be included //@include_bots True, if bots need to be included
//@include_groups True, if basic groups and supergroups need to be included //@include_groups True, if basic groups and supergroups need to be included
//@include_channels True, if channels need to be included //@include_channels True, if channels need to be included
chatFolder title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder; chatFolder name:chatFolderName icon:chatFolderIcon color_id:int32 is_shareable:Bool pinned_chat_ids:vector<int53> included_chat_ids:vector<int53> excluded_chat_ids:vector<int53> exclude_muted:Bool exclude_read:Bool exclude_archived:Bool include_contacts:Bool include_non_contacts:Bool include_bots:Bool include_groups:Bool include_channels:Bool = ChatFolder;
//@description Contains basic information about a chat folder //@description Contains basic information about a chat folder
//@id Unique chat folder identifier //@id Unique chat folder identifier
//@title The title of the folder; 1-12 characters without line feeds //@name The name of the folder
//@icon The chosen or default icon for the chat folder //@icon The chosen or default icon for the chat folder
//@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled //@color_id The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled
//@is_shareable True, if at least one link has been created for the folder //@is_shareable True, if at least one link has been created for the folder
//@has_my_invite_links True, if the chat folder has invite links created by the current user //@has_my_invite_links True, if the chat folder has invite links created by the current user
chatFolderInfo id:int32 title:string icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo; chatFolderInfo id:int32 name:chatFolderName icon:chatFolderIcon color_id:int32 is_shareable:Bool has_my_invite_links:Bool = ChatFolderInfo;
//@description Contains a chat folder invite link //@description Contains a chat folder invite link
//@invite_link The chat folder invite link //@invite_link The chat folder invite link
@ -3890,14 +4003,33 @@ 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 gift was received or sent by the current user //@description A regular gift was received or sent by the current user
//@gift The gift //@gift 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 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
//@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 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
//@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
messageGift gift:gift text:formattedText sell_star_count:int53 is_private:Bool is_saved:Bool was_converted:Bool = MessageContent; //@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
//@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.
//-Use getUserGift to get information about the gift
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
//@gift The 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
//@can_be_transferred True, if the gift can be transferred to another user; 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
//@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
messageUpgradedGift gift:upgradedGift 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
messageRefundedUpgradedGift gift:gift is_upgrade:Bool = MessageContent;
//@description A contact has registered with Telegram //@description A contact has registered with Telegram
messageContactRegistered = MessageContent; messageContactRegistered = MessageContent;
@ -4308,6 +4440,18 @@ searchMessagesFilterFailedToSend = SearchMessagesFilter;
searchMessagesFilterPinned = SearchMessagesFilter; searchMessagesFilterPinned = SearchMessagesFilter;
//@class SearchMessagesChatTypeFilter @description Represents a filter for type of the chats in which to search messages
//@description Returns only messages in private chats
searchMessagesChatTypeFilterPrivate = SearchMessagesChatTypeFilter;
//@description Returns only messages in basic group and supergroup chats
searchMessagesChatTypeFilterGroup = SearchMessagesChatTypeFilter;
//@description Returns only messages in channel chats
searchMessagesChatTypeFilterChannel = SearchMessagesChatTypeFilter;
//@class ChatAction @description Describes the different types of activity in a chat //@class ChatAction @description Describes the different types of activity in a chat
//@description The user is typing a message //@description The user is typing a message
@ -4898,6 +5042,10 @@ callDiscardReasonDisconnected = CallDiscardReason;
//@description The call was ended because one of the parties hung up //@description The call was ended because one of the parties hung up
callDiscardReasonHungUp = CallDiscardReason; callDiscardReasonHungUp = CallDiscardReason;
//@description The call was ended because it has been used successfully to transfer private encryption key for the associated group call
//@encrypted_group_call_key Encrypted using the call private key encryption key for the associated group call
callDiscardReasonAllowGroupCall encrypted_group_call_key:bytes = CallDiscardReason;
//@description Specifies the supported call protocols //@description Specifies the supported call protocols
//@udp_p2p True, if UDP peer-to-peer connections are supported //@udp_p2p True, if UDP peer-to-peer connections are supported
@ -5088,7 +5236,8 @@ callProblemPixelatedVideo = CallProblem;
//@is_outgoing True, if the call is outgoing //@is_outgoing True, if the call is outgoing
//@is_video True, if the call is a video call //@is_video True, if the call is a video call
//@state Call state //@state Call state
call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call; //@group_call_id Identifier of the group call associated with the call; 0 if the group call isn't created yet. The group call can be received through the method getGroupCall
call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState group_call_id:int32 = Call;
//@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications //@class FirebaseAuthenticationSettings @description Contains settings for Firebase Authentication in the official applications
@ -5297,7 +5446,6 @@ inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thum
//@description Represents a link to an article or web page //@description Represents a link to an article or web page
//@id Unique identifier of the query result //@id Unique identifier of the query result
//@url URL of the result, if it exists //@url URL of the result, if it exists
//@hide_url True, if the URL must be not shown
//@title Title of the result //@title Title of the result
//@param_description A short description of the result //@param_description A short description of the result
//@thumbnail_url URL of the result thumbnail, if it exists //@thumbnail_url URL of the result thumbnail, if it exists
@ -5305,7 +5453,7 @@ inputInlineQueryResultAnimation id:string title:string thumbnail_url:string thum
//@thumbnail_height Thumbnail height, if known //@thumbnail_height Thumbnail height, if known
//@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null //@reply_markup The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
//@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact //@input_message_content The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
inputInlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult; inputInlineQueryResultArticle id:string url:string title:string description:string thumbnail_url:string thumbnail_width:int32 thumbnail_height:int32 reply_markup:ReplyMarkup input_message_content:InputMessageContent = InputInlineQueryResult;
//@description Represents a link to an MP3 audio file //@description Represents a link to an MP3 audio file
//@id Unique identifier of the query result //@id Unique identifier of the query result
@ -5419,11 +5567,10 @@ inputInlineQueryResultVoiceNote id:string title:string voice_note_url:string voi
//@description Represents a link to an article or web page //@description Represents a link to an article or web page
//@id Unique identifier of the query result //@id Unique identifier of the query result
//@url URL of the result, if it exists //@url URL of the result, if it exists
//@hide_url True, if the URL must be not shown
//@title Title of the result //@title Title of the result
//@param_description A short description of the result //@param_description A short description of the result
//@thumbnail Result thumbnail in JPEG format; may be null //@thumbnail Result thumbnail in JPEG format; may be null
inlineQueryResultArticle id:string url:string hide_url:Bool title:string description:string thumbnail:thumbnail = InlineQueryResult; inlineQueryResultArticle id:string url:string title:string description:string thumbnail:thumbnail = InlineQueryResult;
//@description Represents a user contact //@description Represents a user contact
//@id Unique identifier of the query result //@id Unique identifier of the query result
@ -6388,6 +6535,10 @@ pushMessageContentGiveaway winner_count:int32 prize:GiveawayPrize is_pinned:Bool
//@description A message with a gift @star_count Number of Telegram Stars that sender paid for the gift //@description A message with a gift @star_count Number of Telegram Stars that sender paid for the gift
pushMessageContentGift star_count:int53 = PushMessageContent; pushMessageContentGift star_count:int53 = PushMessageContent;
//@description A message with an upgraded gift
//@is_upgrade True, if the gift was obtained by upgrading of a previously received gift; otherwise, this is a transferred gift
pushMessageContentUpgradedGift is_upgrade:Bool = PushMessageContent;
//@description A screenshot of a message in the chat has been taken //@description A screenshot of a message in the chat has been taken
pushMessageContentScreenshotTaken = PushMessageContent; pushMessageContentScreenshotTaken = PushMessageContent;
@ -7434,6 +7585,9 @@ suggestedActionGiftPremiumForChristmas = SuggestedAction;
//@description Suggests the user to set birthdate //@description Suggests the user to set birthdate
suggestedActionSetBirthdate = SuggestedAction; suggestedActionSetBirthdate = SuggestedAction;
//@description Suggests the user to set profile photo
suggestedActionSetProfilePhoto = SuggestedAction;
//@description Suggests the user to extend their expiring Telegram Premium subscription @manage_premium_subscription_url A URL for managing Telegram Premium subscription //@description Suggests the user to extend their expiring Telegram Premium subscription @manage_premium_subscription_url A URL for managing Telegram Premium subscription
suggestedActionExtendPremium manage_premium_subscription_url:string = SuggestedAction; suggestedActionExtendPremium manage_premium_subscription_url:string = SuggestedAction;
@ -7698,7 +7852,7 @@ point x:double y:double = Point;
//@description A straight line to a given point @end_point The end point of the straight line //@description A straight line to a given point @end_point The end point of the straight line
vectorPathCommandLine end_point:point = VectorPathCommand; vectorPathCommandLine end_point:point = VectorPathCommand;
//@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve //@description A cubic Bézier curve to a given point @start_control_point The start control point of the curve @end_control_point The end control point of the curve @end_point The end point of the curve
vectorPathCommandCubicBezierCurve start_control_point:point end_control_point:point end_point:point = VectorPathCommand; vectorPathCommandCubicBezierCurve start_control_point:point end_control_point:point end_point:point = VectorPathCommand;
@ -8866,14 +9020,14 @@ searchChatMessages chat_id:int53 query:string sender_id:MessageSender from_messa
//@description Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). //@description Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)).
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported //@chat_list Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported
//@only_in_channels Pass true to search only for messages in channels
//@query Query to search for //@query Query to search for
//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit //@limit The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function //@filter Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function
//@chat_type_filter Additional filter for type of the chat of the searched messages; pass null to search for messages in all chats
//@min_date If not 0, the minimum date of the messages to return //@min_date If not 0, the minimum date of the messages to return
//@max_date If not 0, the maximum date of the messages to return //@max_date If not 0, the maximum date of the messages to return
searchMessages chat_list:ChatList only_in_channels:Bool query:string offset:string limit:int32 filter:SearchMessagesFilter min_date:int32 max_date:int32 = FoundMessages; searchMessages chat_list:ChatList query:string offset:string limit:int32 filter:SearchMessagesFilter chat_type_filter:SearchMessagesChatTypeFilter min_date:int32 max_date:int32 = FoundMessages;
//@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib //@description Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib
//@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats //@chat_id Identifier of the chat in which to search. Specify 0 to search in all secret chats
@ -10624,8 +10778,12 @@ processChatJoinRequest chat_id:int53 user_id:int53 approve:Bool = Ok;
processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok; processChatJoinRequests chat_id:int53 invite_link:string approve:Bool = Ok;
//@description Creates a new call @user_id Identifier of the user to be called @protocol The call protocols supported by the application @is_video Pass true to create a video call //@description Creates a new call
createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId; //@user_id Identifier of the user to be called
//@protocol The call protocols supported by the application
//@is_video Pass true to create a video call
//@group_call_id Identifier of the group call to which the user will be added after exchanging private key via the call; pass 0 if none; currently, ignored
createCall user_id:int53 protocol:callProtocol is_video:Bool group_call_id:int32 = CallId;
//@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application //@description Accepts an incoming call @call_id Call identifier @protocol The call protocols supported by the application
acceptCall call_id:int32 protocol:callProtocol = Ok; acceptCall call_id:int32 protocol:callProtocol = Ok;
@ -10668,6 +10826,9 @@ setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSende
//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat //@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat
createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId; createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId;
//@description Creates a group call from a one-to-one call @call_id Call identifier
createGroupCall call_id:int32 = Ok;
//@description Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right @chat_id Chat identifier //@description Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right @chat_id Chat identifier
getVideoChatRtmpUrl chat_id:int53 = RtmpUrl; getVideoChatRtmpUrl chat_id:int53 = RtmpUrl;
@ -11304,6 +11465,19 @@ setBotInfoShortDescription bot_user_id:int53 language_code:string short_descript
getBotInfoShortDescription bot_user_id:int53 language_code:string = Text; getBotInfoShortDescription bot_user_id:int53 language_code:string = Text;
//@description Changes the verification status of a user or a chat by an owned bot
//@bot_user_id Identifier of the owned bot, which will verify the user or the chat
//@verified_id Identifier of the user or the supergroup or channel chat, which will be verified by the bot
//@custom_description Custom description of verification reason; 0-getOption("bot_verification_custom_description_length_max").
//-If empty, then "was verified by organization "organization_name"" will be used as description. Can be specified only if the bot is allowed to provide custom description
setMessageSenderBotVerification bot_user_id:int53 verified_id:MessageSender custom_description:string = Ok;
//@description Removes the verification status of a user or a chat by an owned bot
//@bot_user_id Identifier of the owned bot, which verified the user or the chat
//@verified_id Identifier of the user or the supergroup or channel chat, which verification is removed
removeMessageSenderBotVerification bot_user_id:int53 verified_id:MessageSender = Ok;
//@description Returns all active sessions of the current user //@description Returns all active sessions of the current user
getActiveSessions = Sessions; getActiveSessions = Sessions;
@ -11486,7 +11660,8 @@ getAvailableGifts = Gifts;
//@user_id Identifier of the user that will receive the gift //@user_id Identifier of the user 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 the current user as sender and gift text only to the gift receiver; otherwise, everyone will be able to see them
sendGift gift_id:int64 user_id:int53 text:formattedText is_private:Bool = Ok; //@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;
//@description Sells a gift received by the current user for Telegram Stars //@description Sells a gift received by the current user for Telegram Stars
//@sender_user_id Identifier of the user that sent the gift //@sender_user_id Identifier of the user that sent the gift
@ -11499,12 +11674,31 @@ sellGift sender_user_id:int53 message_id:int53 = Ok;
//@is_saved Pass true to display the gift on the user'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 sender_user_id:int53 message_id:int53 is_saved:Bool = Ok; toggleGiftIsSaved sender_user_id:int53 message_id:int53 is_saved:Bool = Ok;
//@description Returns examples of possible upgraded gifts for a regular gift @gift_id Identifier of the gift
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
//@sender_user_id Identifier of the user that sent 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
upgradeGift sender_user_id:int53 message_id:int53 keep_original_details:Bool = UpgradeGiftResult;
//@description Sends a gift upgraded by the current user to another user
//@sender_user_id Identifier of the user that sent the gift
//@message_id Identifier of the message with the upgraded gift in the chat with the user
//@receiver_user_id Identifier of the user that will receive the gift
//@star_count The amount of Telegram Stars required for the transfer
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 saved to profile by the given user
//@user_id Identifier of the user //@user_id Identifier of the user
//@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; getUserGifts user_id:int53 offset:string limit:int32 = UserGifts;
//@description Returns information about a gift received or sent by the current user @message_id Identifier of the message with the gift
getUserGift message_id:int53 = UserGift;
//@description Creates a link for the given invoice; for bots only //@description Creates a link for the given invoice; for bots only
//@business_connection_id Unique identifier of business connection on behalf of which to send the request //@business_connection_id Unique identifier of business connection on behalf of which to send the request
@ -12042,33 +12236,33 @@ setChatAffiliateProgram chat_id:int53 parameters:affiliateProgramParameters = Ok
//@referrer The referrer from an internalLinkTypeChatAffiliateProgram link //@referrer The referrer from an internalLinkTypeChatAffiliateProgram link
searchChatAffiliateProgram username:string referrer:string = Chat; searchChatAffiliateProgram username:string referrer:string = Chat;
//@description Searches affiliate programs that can be applied to the given chat //@description Searches affiliate programs that can be connected to the given affiliate
//@chat_id Identifier of the chat for which affiliate programs are searched for. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right //@affiliate The affiliate for which affiliate programs are searched for
//@sort_order Sort order for the results //@sort_order Sort order for the results
//@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results //@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of affiliate programs to return //@limit The maximum number of affiliate programs to return
searchAffiliatePrograms chat_id:int53 sort_order:AffiliateProgramSortOrder offset:string limit:int32 = FoundAffiliatePrograms; searchAffiliatePrograms affiliate:AffiliateType sort_order:AffiliateProgramSortOrder offset:string limit:int32 = FoundAffiliatePrograms;
//@description Connects an affiliate program to the given chat. Returns information about the connected affiliate program //@description Connects an affiliate program to the given affiliate. Returns information about the connected affiliate program
//@chat_id Identifier of the chat to which the affiliate program will be connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right //@affiliate The affiliate to which the affiliate program will be connected
//@bot_user_id Identifier of the bot, which affiliate program is connected //@bot_user_id Identifier of the bot, which affiliate program is connected
connectChatAffiliateProgram chat_id:int53 bot_user_id:int53 = ChatAffiliateProgram; connectAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram;
//@description Disconnects an affiliate program from the given chat and immediately deactivates its referral link. Returns updated information about the disconnected affiliate program //@description Disconnects an affiliate program from the given affiliate and immediately deactivates its referral link. Returns updated information about the disconnected affiliate program
//@chat_id Identifier of the chat for which the affiliate program is connected //@affiliate The affiliate to which the affiliate program is connected
//@url The referral link of the affiliate program //@url The referral link of the affiliate program
disconnectChatAffiliateProgram chat_id:int53 url:string = ChatAffiliateProgram; disconnectAffiliateProgram affiliate:AffiliateType url:string = ConnectedAffiliateProgram;
//@description Returns an affiliate program that were connected to the given chat by identifier of the bot that created the program //@description Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the program
//@chat_id Identifier of the chat for which the affiliate program was connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right //@affiliate The affiliate to which the affiliate program will be connected
//@bot_user_id Identifier of the bot that created the program //@bot_user_id Identifier of the bot that created the program
getChatAffiliateProgram chat_id:int53 bot_user_id:int53 = ChatAffiliateProgram; getConnectedAffiliateProgram affiliate:AffiliateType bot_user_id:int53 = ConnectedAffiliateProgram;
//@description Returns affiliate programs that were connected to the given chat //@description Returns affiliate programs that were connected to the given affiliate
//@chat_id Identifier of the chat for which the affiliate programs were connected. Can be an identifier of the Saved Messages chat, of a chat with an owned bot, or of a channel chat with can_post_messages administrator right //@affiliate The affiliate to which the affiliate program were connected
//@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results //@offset Offset of the first affiliate program to return as received from the previous request; use empty string to get the first chunk of results
//@limit The maximum number of affiliate programs to return //@limit The maximum number of affiliate programs to return
getChatAffiliatePrograms chat_id:int53 offset:string limit:int32 = ChatAffiliatePrograms; getConnectedAffiliatePrograms affiliate:AffiliateType offset:string limit:int32 = ConnectedAffiliatePrograms;
//@description Returns information about features, available to Business users @source Source of the request; pass null if the method is called from settings or some non-standard source //@description Returns information about features, available to Business users @source Source of the request; pass null if the method is called from settings or some non-standard source