Update to TDLib 1.8.5

This commit is contained in:
c0re100 2022-08-13 23:24:07 +08:00
parent 51b9da9304
commit fffcf86198
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1307 additions and 252 deletions

View file

@ -243,11 +243,11 @@ func (client *Client) RegisterUser(req *RegisterUserRequest) (*Ok, error) {
} }
type CheckAuthenticationPasswordRequest struct { type CheckAuthenticationPasswordRequest struct {
// The password to check // The 2-step verification password to check
Password string `json:"password"` Password string `json:"password"`
} }
// Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword // Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword
func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswordRequest) (*Ok, error) { func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswordRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -268,7 +268,7 @@ func (client *Client) CheckAuthenticationPassword(req *CheckAuthenticationPasswo
return UnmarshalOk(result.Data) return UnmarshalOk(result.Data)
} }
// Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword // Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
func (client *Client) RequestAuthenticationPasswordRecovery() (*Ok, error) { func (client *Client) RequestAuthenticationPasswordRecovery() (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -292,7 +292,7 @@ type CheckAuthenticationPasswordRecoveryCodeRequest struct {
RecoveryCode string `json:"recovery_code"` RecoveryCode string `json:"recovery_code"`
} }
// Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword // Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword
func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenticationPasswordRecoveryCodeRequest) (*Ok, error) { func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenticationPasswordRecoveryCodeRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -316,13 +316,13 @@ func (client *Client) CheckAuthenticationPasswordRecoveryCode(req *CheckAuthenti
type RecoverAuthenticationPasswordRequest struct { type RecoverAuthenticationPasswordRequest struct {
// Recovery code to check // Recovery code to check
RecoveryCode string `json:"recovery_code"` RecoveryCode string `json:"recovery_code"`
// New password of the user; may be empty to remove the password // New 2-step verification password of the user; may be empty to remove the password
NewPassword string `json:"new_password"` NewPassword string `json:"new_password"`
// New password hint; may be empty // New password hint; may be empty
NewHint string `json:"new_hint"` NewHint string `json:"new_hint"`
} }
// Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword // Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPasswordRequest) (*Ok, error) { func (client *Client) RecoverAuthenticationPassword(req *RecoverAuthenticationPasswordRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -519,9 +519,9 @@ func (client *Client) GetPasswordState() (*PasswordState, error) {
} }
type SetPasswordRequest struct { type SetPasswordRequest struct {
// Previous password of the user // Previous 2-step verification password of the user
OldPassword string `json:"old_password"` OldPassword string `json:"old_password"`
// New password of the user; may be empty to remove the password // New 2-step verification password of the user; may be empty to remove the password
NewPassword string `json:"new_password"` NewPassword string `json:"new_password"`
// New password hint; may be empty // New password hint; may be empty
NewHint string `json:"new_hint"` NewHint string `json:"new_hint"`
@ -531,7 +531,7 @@ type SetPasswordRequest struct {
NewRecoveryEmailAddress string `json:"new_recovery_email_address"` NewRecoveryEmailAddress string `json:"new_recovery_email_address"`
} }
// Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed // Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed
func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, error) { func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -557,7 +557,7 @@ func (client *Client) SetPassword(req *SetPasswordRequest) (*PasswordState, erro
} }
type GetRecoveryEmailAddressRequest struct { type GetRecoveryEmailAddressRequest struct {
// The password for the current user // The 2-step verification password for the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -583,7 +583,7 @@ func (client *Client) GetRecoveryEmailAddress(req *GetRecoveryEmailAddressReques
} }
type SetRecoveryEmailAddressRequest struct { type SetRecoveryEmailAddressRequest struct {
// Password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
// New recovery email address // New recovery email address
NewRecoveryEmailAddress string `json:"new_recovery_email_address"` NewRecoveryEmailAddress string `json:"new_recovery_email_address"`
@ -704,7 +704,7 @@ func (client *Client) CheckPasswordRecoveryCode(req *CheckPasswordRecoveryCodeRe
type RecoverPasswordRequest struct { type RecoverPasswordRequest struct {
// Recovery code to check // Recovery code to check
RecoveryCode string `json:"recovery_code"` RecoveryCode string `json:"recovery_code"`
// New password of the user; may be empty to remove the password // New 2-step verification password of the user; may be empty to remove the password
NewPassword string `json:"new_password"` NewPassword string `json:"new_password"`
// New password hint; may be empty // New password hint; may be empty
NewHint string `json:"new_hint"` NewHint string `json:"new_hint"`
@ -784,7 +784,7 @@ func (client *Client) CancelPasswordReset() (*Ok, error) {
} }
type CreateTemporaryPasswordRequest struct { type CreateTemporaryPasswordRequest struct {
// Persistent user password // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
// Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 // Time during which the temporary password will be valid, in seconds; must be between 60 and 86400
ValidFor int32 `json:"valid_for"` ValidFor int32 `json:"valid_for"`
@ -3555,7 +3555,7 @@ type GetMessageAvailableReactionsRequest struct {
MessageId int64 `json:"message_id"` MessageId int64 `json:"message_id"`
} }
// Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message. The method will return Premium reactions, even the current user has no Premium subscription // Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) { func (client *Client) GetMessageAvailableReactions(req *GetMessageAvailableReactionsRequest) (*AvailableReactions, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -3688,7 +3688,7 @@ type ParseTextEntitiesRequest struct {
ParseMode TextParseMode `json:"parse_mode"` ParseMode TextParseMode `json:"parse_mode"`
} }
// Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously // Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously
func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
result, err := Execute(Request{ result, err := Execute(Request{
meta: meta{ meta: meta{
@ -3711,7 +3711,7 @@ func ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
} }
// deprecated // deprecated
// Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously // Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously
func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) { func (client *Client) ParseTextEntities(req *ParseTextEntitiesRequest) (*FormattedText, error) {
return ParseTextEntities(req)} return ParseTextEntities(req)}
@ -5049,6 +5049,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypeQrCodeAuthentication: case TypeInternalLinkTypeQrCodeAuthentication:
return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data) return UnmarshalInternalLinkTypeQrCodeAuthentication(result.Data)
case TypeInternalLinkTypeRestorePurchases:
return UnmarshalInternalLinkTypeRestorePurchases(result.Data)
case TypeInternalLinkTypeSettings: case TypeInternalLinkTypeSettings:
return UnmarshalInternalLinkTypeSettings(result.Data) return UnmarshalInternalLinkTypeSettings(result.Data)
@ -5847,7 +5850,7 @@ func (client *Client) SetChatDraftMessage(req *SetChatDraftMessageRequest) (*Ok,
type SetChatNotificationSettingsRequest struct { type SetChatNotificationSettingsRequest struct {
// Chat identifier // Chat identifier
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
// New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever // New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever
NotificationSettings *ChatNotificationSettings `json:"notification_settings"` NotificationSettings *ChatNotificationSettings `json:"notification_settings"`
} }
@ -6443,7 +6446,7 @@ type TransferChatOwnershipRequest struct {
ChatId int64 `json:"chat_id"` ChatId int64 `json:"chat_id"`
// Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user // Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user
UserId int64 `json:"user_id"` UserId int64 `json:"user_id"`
// The password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -7027,20 +7030,20 @@ func (client *Client) GetSuggestedFileName(req *GetSuggestedFileNameRequest) (*T
return UnmarshalText(result.Data) return UnmarshalText(result.Data)
} }
type UploadFileRequest struct { type PreliminaryUploadFileRequest struct {
// File to upload // File to upload
File InputFile `json:"file"` File InputFile `json:"file"`
// File type; pass null if unknown // File type; pass null if unknown
FileType FileType `json:"file_type"` FileType FileType `json:"file_type"`
// Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first // Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first
Priority int32 `json:"priority"` Priority int32 `json:"priority"`
} }
// Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message // Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message
func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) { func (client *Client) PreliminaryUploadFile(req *PreliminaryUploadFileRequest) (*File, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "uploadFile", Type: "preliminaryUploadFile",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"file": req.File, "file": req.File,
@ -7059,16 +7062,16 @@ func (client *Client) UploadFile(req *UploadFileRequest) (*File, error) {
return UnmarshalFile(result.Data) return UnmarshalFile(result.Data)
} }
type CancelUploadFileRequest struct { type CancelPreliminaryUploadFileRequest struct {
// Identifier of the file to stop uploading // Identifier of the file to stop uploading
FileId int32 `json:"file_id"` FileId int32 `json:"file_id"`
} }
// Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined // Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined
func (client *Client) CancelUploadFile(req *CancelUploadFileRequest) (*Ok, error) { func (client *Client) CancelPreliminaryUploadFile(req *CancelPreliminaryUploadFileRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "cancelUploadFile", Type: "cancelPreliminaryUploadFile",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"file_id": req.FileId, "file_id": req.FileId,
@ -9478,21 +9481,27 @@ func (client *Client) GetUserProfilePhotos(req *GetUserProfilePhotosRequest) (*C
} }
type GetStickersRequest struct { type GetStickersRequest struct {
// Type of the sticker sets to return
StickerType StickerType `json:"sticker_type"`
// String representation of emoji. If empty, returns all known installed stickers // String representation of emoji. If empty, returns all known installed stickers
Emoji string `json:"emoji"` Emoji string `json:"emoji"`
// The maximum number of stickers to be returned // The maximum number of stickers to be returned
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
// Chat identifier for which to return stickers. Available custom emoji may be different for different chats
ChatId int64 `json:"chat_id"`
} }
// Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned // Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, then favorite, recently used or trending stickers may also be returned
func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) { func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getStickers", Type: "getStickers",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sticker_type": req.StickerType,
"emoji": req.Emoji, "emoji": req.Emoji,
"limit": req.Limit, "limit": req.Limit,
"chat_id": req.ChatId,
}, },
}) })
if err != nil { if err != nil {
@ -9509,7 +9518,7 @@ func (client *Client) GetStickers(req *GetStickersRequest) (*Stickers, error) {
type SearchStickersRequest struct { type SearchStickersRequest struct {
// String representation of emoji; must be non-empty // String representation of emoji; must be non-empty
Emoji string `json:"emoji"` Emoji string `json:"emoji"`
// The maximum number of stickers to be returned // The maximum number of stickers to be returned; 0-100
Limit int32 `json:"limit"` Limit int32 `json:"limit"`
} }
@ -9535,9 +9544,35 @@ func (client *Client) SearchStickers(req *SearchStickersRequest) (*Stickers, err
return UnmarshalStickers(result.Data) return UnmarshalStickers(result.Data)
} }
type GetPremiumStickersRequest struct {
// The maximum number of stickers to be returned; 0-100
Limit int32 `json:"limit"`
}
// Returns premium stickers from regular sticker sets
func (client *Client) GetPremiumStickers(req *GetPremiumStickersRequest) (*Stickers, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPremiumStickers",
},
Data: map[string]interface{}{
"limit": req.Limit,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalStickers(result.Data)
}
type GetInstalledStickerSetsRequest struct { type GetInstalledStickerSetsRequest struct {
// Pass true to return mask sticker sets; pass false to return ordinary sticker sets // Type of the sticker sets to return
IsMasks bool `json:"is_masks"` StickerType StickerType `json:"sticker_type"`
} }
// Returns a list of installed sticker sets // Returns a list of installed sticker sets
@ -9547,7 +9582,7 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques
Type: "getInstalledStickerSets", Type: "getInstalledStickerSets",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"is_masks": req.IsMasks, "sticker_type": req.StickerType,
}, },
}) })
if err != nil { if err != nil {
@ -9562,8 +9597,8 @@ func (client *Client) GetInstalledStickerSets(req *GetInstalledStickerSetsReques
} }
type GetArchivedStickerSetsRequest struct { type GetArchivedStickerSetsRequest struct {
// Pass true to return mask stickers sets; pass false to return ordinary sticker sets // Type of the sticker sets to return
IsMasks bool `json:"is_masks"` StickerType StickerType `json:"sticker_type"`
// Identifier of the sticker set from which to return the result // Identifier of the sticker set from which to return the result
OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"` OffsetStickerSetId JsonInt64 `json:"offset_sticker_set_id"`
// The maximum number of sticker sets to return; up to 100 // The maximum number of sticker sets to return; up to 100
@ -9577,7 +9612,7 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest)
Type: "getArchivedStickerSets", Type: "getArchivedStickerSets",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"is_masks": req.IsMasks, "sticker_type": req.StickerType,
"offset_sticker_set_id": req.OffsetStickerSetId, "offset_sticker_set_id": req.OffsetStickerSetId,
"limit": req.Limit, "limit": req.Limit,
}, },
@ -9594,6 +9629,8 @@ func (client *Client) GetArchivedStickerSets(req *GetArchivedStickerSetsRequest)
} }
type GetTrendingStickerSetsRequest struct { type GetTrendingStickerSetsRequest struct {
// Type of the sticker sets to return
StickerType StickerType `json:"sticker_type"`
// The offset from which to return the sticker sets; must be non-negative // The offset from which to return the sticker sets; must be non-negative
Offset int32 `json:"offset"` Offset int32 `json:"offset"`
// The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached // The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached
@ -9607,6 +9644,7 @@ func (client *Client) GetTrendingStickerSets(req *GetTrendingStickerSetsRequest)
Type: "getTrendingStickerSets", Type: "getTrendingStickerSets",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"sticker_type": req.StickerType,
"offset": req.Offset, "offset": req.Offset,
"limit": req.Limit, "limit": req.Limit,
}, },
@ -9701,8 +9739,8 @@ func (client *Client) SearchStickerSet(req *SearchStickerSetRequest) (*StickerSe
} }
type SearchInstalledStickerSetsRequest struct { type SearchInstalledStickerSetsRequest struct {
// Pass true to return mask sticker sets; pass false to return ordinary sticker sets // Type of the sticker sets to search for
IsMasks bool `json:"is_masks"` StickerType StickerType `json:"sticker_type"`
// Query to search for // Query to search for
Query string `json:"query"` Query string `json:"query"`
// The maximum number of sticker sets to return // The maximum number of sticker sets to return
@ -9716,7 +9754,7 @@ func (client *Client) SearchInstalledStickerSets(req *SearchInstalledStickerSets
Type: "searchInstalledStickerSets", Type: "searchInstalledStickerSets",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"is_masks": req.IsMasks, "sticker_type": req.StickerType,
"query": req.Query, "query": req.Query,
"limit": req.Limit, "limit": req.Limit,
}, },
@ -9817,8 +9855,8 @@ func (client *Client) ViewTrendingStickerSets(req *ViewTrendingStickerSetsReques
} }
type ReorderInstalledStickerSetsRequest struct { type ReorderInstalledStickerSetsRequest struct {
// Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets // Type of the sticker sets to reorder
IsMasks bool `json:"is_masks"` StickerType StickerType `json:"sticker_type"`
// Identifiers of installed sticker sets in the new correct order // Identifiers of installed sticker sets in the new correct order
StickerSetIds []JsonInt64 `json:"sticker_set_ids"` StickerSetIds []JsonInt64 `json:"sticker_set_ids"`
} }
@ -9830,7 +9868,7 @@ func (client *Client) ReorderInstalledStickerSets(req *ReorderInstalledStickerSe
Type: "reorderInstalledStickerSets", Type: "reorderInstalledStickerSets",
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"is_masks": req.IsMasks, "sticker_type": req.StickerType,
"sticker_set_ids": req.StickerSetIds, "sticker_set_ids": req.StickerSetIds,
}, },
}) })
@ -9878,7 +9916,7 @@ type AddRecentStickerRequest struct {
Sticker InputFile `json:"sticker"` Sticker InputFile `json:"sticker"`
} }
// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list // Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers
func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) { func (client *Client) AddRecentSticker(req *AddRecentStickerRequest) (*Stickers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -9979,7 +10017,7 @@ type AddFavoriteStickerRequest struct {
Sticker InputFile `json:"sticker"` Sticker InputFile `json:"sticker"`
} }
// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list // Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers
func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) { func (client *Client) AddFavoriteSticker(req *AddFavoriteStickerRequest) (*Ok, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
@ -10110,25 +10148,6 @@ func (client *Client) GetAnimatedEmoji(req *GetAnimatedEmojiRequest) (*AnimatedE
return UnmarshalAnimatedEmoji(result.Data) return UnmarshalAnimatedEmoji(result.Data)
} }
// Returns all emojis, which has a corresponding animated emoji
func (client *Client) GetAllAnimatedEmojis() (*Emojis, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getAllAnimatedEmojis",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojis(result.Data)
}
type GetEmojiSuggestionsUrlRequest struct { type GetEmojiSuggestionsUrlRequest struct {
// Language code for which the emoji replacements will be suggested // Language code for which the emoji replacements will be suggested
LanguageCode string `json:"language_code"` LanguageCode string `json:"language_code"`
@ -10155,6 +10174,32 @@ func (client *Client) GetEmojiSuggestionsUrl(req *GetEmojiSuggestionsUrlRequest)
return UnmarshalHttpUrl(result.Data) return UnmarshalHttpUrl(result.Data)
} }
type GetCustomEmojiStickersRequest struct {
// Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously
CustomEmojiIds []JsonInt64 `json:"custom_emoji_ids"`
}
// Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned
func (client *Client) GetCustomEmojiStickers(req *GetCustomEmojiStickersRequest) (*Stickers, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getCustomEmojiStickers",
},
Data: map[string]interface{}{
"custom_emoji_ids": req.CustomEmojiIds,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalStickers(result.Data)
}
// Returns saved animations // Returns saved animations
func (client *Client) GetSavedAnimations() (*Animations, error) { func (client *Client) GetSavedAnimations() (*Animations, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
@ -12134,9 +12179,9 @@ type GetOptionRequest struct {
Name string `json:"name"` Name string `json:"name"`
} }
// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization // Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash"
func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) { func GetOption(req *GetOptionRequest) (OptionValue, error) {
result, err := client.Send(Request{ result, err := Execute(Request{
meta: meta{ meta: meta{
Type: "getOption", Type: "getOption",
}, },
@ -12170,6 +12215,11 @@ func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) {
} }
} }
// deprecated
// Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash"
func (client *Client) GetOption(req *GetOptionRequest) (OptionValue, error) {
return GetOption(req)}
type SetOptionRequest struct { type SetOptionRequest struct {
// The name of the option // The name of the option
Name string `json:"name"` Name string `json:"name"`
@ -12247,6 +12297,8 @@ func (client *Client) GetAccountTtl() (*AccountTtl, error) {
type DeleteAccountRequest struct { type DeleteAccountRequest struct {
// The reason why the account was deleted; optional // The reason why the account was deleted; optional
Reason string `json:"reason"` Reason string `json:"reason"`
// The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week
Password string `json:"password"`
} }
// Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword // Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword
@ -12257,6 +12309,7 @@ func (client *Client) DeleteAccount(req *DeleteAccountRequest) (*Ok, error) {
}, },
Data: map[string]interface{}{ Data: map[string]interface{}{
"reason": req.Reason, "reason": req.Reason,
"password": req.Password,
}, },
}) })
if err != nil { if err != nil {
@ -12768,7 +12821,7 @@ func (client *Client) GetBankCardInfo(req *GetBankCardInfoRequest) (*BankCardInf
type GetPassportElementRequest struct { type GetPassportElementRequest struct {
// Telegram Passport element type // Telegram Passport element type
Type PassportElementType `json:"type"` Type PassportElementType `json:"type"`
// Password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -12837,7 +12890,7 @@ func (client *Client) GetPassportElement(req *GetPassportElementRequest) (Passpo
} }
type GetAllPassportElementsRequest struct { type GetAllPassportElementsRequest struct {
// Password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -12865,7 +12918,7 @@ func (client *Client) GetAllPassportElements(req *GetAllPassportElementsRequest)
type SetPassportElementRequest struct { type SetPassportElementRequest struct {
// Input Telegram Passport element // Input Telegram Passport element
Element InputPassportElement `json:"element"` Element InputPassportElement `json:"element"`
// Password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -13197,7 +13250,7 @@ func (client *Client) GetPassportAuthorizationForm(req *GetPassportAuthorization
type GetPassportAuthorizationFormAvailableElementsRequest struct { type GetPassportAuthorizationFormAvailableElementsRequest struct {
// Authorization form identifier // Authorization form identifier
AutorizationFormId int32 `json:"autorization_form_id"` AutorizationFormId int32 `json:"autorization_form_id"`
// Password of the current user // The 2-step verification password of the current user
Password string `json:"password"` Password string `json:"password"`
} }
@ -13458,6 +13511,8 @@ type CreateNewStickerSetRequest struct {
Title string `json:"title"` Title string `json:"title"`
// Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters // Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters
Name string `json:"name"` Name string `json:"name"`
// Type of the stickers in the set
StickerType StickerType `json:"sticker_type"`
// List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown // List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown
Stickers []*InputSticker `json:"stickers"` Stickers []*InputSticker `json:"stickers"`
// Source of the sticker set; may be empty if unknown // Source of the sticker set; may be empty if unknown
@ -13474,6 +13529,7 @@ func (client *Client) CreateNewStickerSet(req *CreateNewStickerSetRequest) (*Sti
"user_id": req.UserId, "user_id": req.UserId,
"title": req.Title, "title": req.Title,
"name": req.Name, "name": req.Name,
"sticker_type": req.StickerType,
"stickers": req.Stickers, "stickers": req.Stickers,
"source": req.Source, "source": req.Source,
}, },
@ -13702,10 +13758,10 @@ func (client *Client) GetPremiumFeatures(req *GetPremiumFeaturesRequest) (*Premi
} }
// Returns examples of premium stickers for demonstration purposes // Returns examples of premium stickers for demonstration purposes
func (client *Client) GetPremiumStickers() (*Stickers, error) { func (client *Client) GetPremiumStickerExamples() (*Stickers, error) {
result, err := client.Send(Request{ result, err := client.Send(Request{
meta: meta{ meta: meta{
Type: "getPremiumStickers", Type: "getPremiumStickerExamples",
}, },
Data: map[string]interface{}{}, Data: map[string]interface{}{},
}) })
@ -13784,6 +13840,96 @@ func (client *Client) GetPremiumState() (*PremiumState, error) {
return UnmarshalPremiumState(result.Data) return UnmarshalPremiumState(result.Data)
} }
type CanPurchasePremiumRequest struct {
// Transaction purpose
Purpose StorePaymentPurpose `json:"purpose"`
}
// Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase
func (client *Client) CanPurchasePremium(req *CanPurchasePremiumRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "canPurchasePremium",
},
Data: map[string]interface{}{
"purpose": req.Purpose,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AssignAppStoreTransactionRequest struct {
// App Store receipt
Receipt []byte `json:"receipt"`
// Transaction purpose
Purpose StorePaymentPurpose `json:"purpose"`
}
// Informs server about a purchase through App Store. For official applications only
func (client *Client) AssignAppStoreTransaction(req *AssignAppStoreTransactionRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "assignAppStoreTransaction",
},
Data: map[string]interface{}{
"receipt": req.Receipt,
"purpose": req.Purpose,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AssignGooglePlayTransactionRequest struct {
// Application package name
PackageName string `json:"package_name"`
// Identifier of the purchased store product
StoreProductId string `json:"store_product_id"`
// Google Play purchase token
PurchaseToken string `json:"purchase_token"`
// Transaction purpose
Purpose StorePaymentPurpose `json:"purpose"`
}
// Informs server about a purchase through Google Play. For official applications only
func (client *Client) AssignGooglePlayTransaction(req *AssignGooglePlayTransactionRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "assignGooglePlayTransaction",
},
Data: map[string]interface{}{
"package_name": req.PackageName,
"store_product_id": req.StoreProductId,
"purchase_token": req.PurchaseToken,
"purpose": req.Purpose,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AcceptTermsOfServiceRequest struct { type AcceptTermsOfServiceRequest struct {
// Terms of service identifier // Terms of service identifier
TermsOfServiceId string `json:"terms_of_service_id"` TermsOfServiceId string `json:"terms_of_service_id"`

File diff suppressed because it is too large Load diff

View file

@ -240,6 +240,43 @@ func UnmarshalListOfMaskPoint(dataList []json.RawMessage) ([]MaskPoint, error) {
return list, nil return list, nil
} }
func UnmarshalStickerFormat(data json.RawMessage) (StickerFormat, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStickerFormatWebp:
return UnmarshalStickerFormatWebp(data)
case TypeStickerFormatTgs:
return UnmarshalStickerFormatTgs(data)
case TypeStickerFormatWebm:
return UnmarshalStickerFormatWebm(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStickerFormat(dataList []json.RawMessage) ([]StickerFormat, error) {
list := []StickerFormat{}
for _, data := range dataList {
entity, err := UnmarshalStickerFormat(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalStickerType(data json.RawMessage) (StickerType, error) { func UnmarshalStickerType(data json.RawMessage) (StickerType, error) {
var meta meta var meta meta
@ -249,18 +286,15 @@ func UnmarshalStickerType(data json.RawMessage) (StickerType, error) {
} }
switch meta.Type { switch meta.Type {
case TypeStickerTypeStatic: case TypeStickerTypeRegular:
return UnmarshalStickerTypeStatic(data) return UnmarshalStickerTypeRegular(data)
case TypeStickerTypeAnimated:
return UnmarshalStickerTypeAnimated(data)
case TypeStickerTypeVideo:
return UnmarshalStickerTypeVideo(data)
case TypeStickerTypeMask: case TypeStickerTypeMask:
return UnmarshalStickerTypeMask(data) return UnmarshalStickerTypeMask(data)
case TypeStickerTypeCustomEmoji:
return UnmarshalStickerTypeCustomEmoji(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -1917,6 +1951,9 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessagePaymentSuccessfulBot: case TypeMessagePaymentSuccessfulBot:
return UnmarshalMessagePaymentSuccessfulBot(data) return UnmarshalMessagePaymentSuccessfulBot(data)
case TypeMessageGiftedPremium:
return UnmarshalMessageGiftedPremium(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -2023,6 +2060,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) {
case TypeTextEntityTypeMentionName: case TypeTextEntityTypeMentionName:
return UnmarshalTextEntityTypeMentionName(data) return UnmarshalTextEntityTypeMentionName(data)
case TypeTextEntityTypeCustomEmoji:
return UnmarshalTextEntityTypeCustomEmoji(data)
case TypeTextEntityTypeMediaTimestamp: case TypeTextEntityTypeMediaTimestamp:
return UnmarshalTextEntityTypeMediaTimestamp(data) return UnmarshalTextEntityTypeMediaTimestamp(data)
@ -2605,6 +2645,43 @@ func UnmarshalListOfDiceStickers(dataList []json.RawMessage) ([]DiceStickers, er
return list, nil return list, nil
} }
func UnmarshalSpeechRecognitionResult(data json.RawMessage) (SpeechRecognitionResult, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeSpeechRecognitionResultPending:
return UnmarshalSpeechRecognitionResultPending(data)
case TypeSpeechRecognitionResultText:
return UnmarshalSpeechRecognitionResultText(data)
case TypeSpeechRecognitionResultError:
return UnmarshalSpeechRecognitionResultError(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfSpeechRecognitionResult(dataList []json.RawMessage) ([]SpeechRecognitionResult, error) {
list := []SpeechRecognitionResult{}
for _, data := range dataList {
entity, err := UnmarshalSpeechRecognitionResult(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) { func UnmarshalInputInlineQueryResult(data json.RawMessage) (InputInlineQueryResult, error) {
var meta meta var meta meta
@ -3028,6 +3105,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) {
case TypePremiumFeatureUniqueStickers: case TypePremiumFeatureUniqueStickers:
return UnmarshalPremiumFeatureUniqueStickers(data) return UnmarshalPremiumFeatureUniqueStickers(data)
case TypePremiumFeatureCustomEmoji:
return UnmarshalPremiumFeatureCustomEmoji(data)
case TypePremiumFeatureAdvancedChatManagement: case TypePremiumFeatureAdvancedChatManagement:
return UnmarshalPremiumFeatureAdvancedChatManagement(data) return UnmarshalPremiumFeatureAdvancedChatManagement(data)
@ -3099,6 +3179,40 @@ func UnmarshalListOfPremiumSource(dataList []json.RawMessage) ([]PremiumSource,
return list, nil return list, nil
} }
func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposeGiftedPremium:
return UnmarshalStorePaymentPurposeGiftedPremium(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStorePaymentPurpose(dataList []json.RawMessage) ([]StorePaymentPurpose, error) {
list := []StorePaymentPurpose{}
for _, data := range dataList {
entity, err := UnmarshalStorePaymentPurpose(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) { func UnmarshalDeviceToken(data json.RawMessage) (DeviceToken, error) {
var meta meta var meta meta
@ -3828,6 +3942,9 @@ func UnmarshalUserPrivacySetting(data json.RawMessage) (UserPrivacySetting, erro
case TypeUserPrivacySettingAllowFindingByPhoneNumber: case TypeUserPrivacySettingAllowFindingByPhoneNumber:
return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data)
case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages:
return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data)
default: default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type) return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
} }
@ -4099,6 +4216,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypeQrCodeAuthentication: case TypeInternalLinkTypeQrCodeAuthentication:
return UnmarshalInternalLinkTypeQrCodeAuthentication(data) return UnmarshalInternalLinkTypeQrCodeAuthentication(data)
case TypeInternalLinkTypeRestorePurchases:
return UnmarshalInternalLinkTypeRestorePurchases(data)
case TypeInternalLinkTypeSettings: case TypeInternalLinkTypeSettings:
return UnmarshalInternalLinkTypeSettings(data) return UnmarshalInternalLinkTypeSettings(data)
@ -5475,24 +5595,32 @@ func UnmarshalMaskPosition(data json.RawMessage) (*MaskPosition, error) {
return &resp, err return &resp, err
} }
func UnmarshalStickerTypeStatic(data json.RawMessage) (*StickerTypeStatic, error) { func UnmarshalStickerFormatWebp(data json.RawMessage) (*StickerFormatWebp, error) {
var resp StickerTypeStatic var resp StickerFormatWebp
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalStickerTypeAnimated(data json.RawMessage) (*StickerTypeAnimated, error) { func UnmarshalStickerFormatTgs(data json.RawMessage) (*StickerFormatTgs, error) {
var resp StickerTypeAnimated var resp StickerFormatTgs
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
return &resp, err return &resp, err
} }
func UnmarshalStickerTypeVideo(data json.RawMessage) (*StickerTypeVideo, error) { func UnmarshalStickerFormatWebm(data json.RawMessage) (*StickerFormatWebm, error) {
var resp StickerTypeVideo var resp StickerFormatWebm
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStickerTypeRegular(data json.RawMessage) (*StickerTypeRegular, error) {
var resp StickerTypeRegular
err := json.Unmarshal(data, &resp) err := json.Unmarshal(data, &resp)
@ -5507,6 +5635,14 @@ func UnmarshalStickerTypeMask(data json.RawMessage) (*StickerTypeMask, error) {
return &resp, err return &resp, err
} }
func UnmarshalStickerTypeCustomEmoji(data json.RawMessage) (*StickerTypeCustomEmoji, error) {
var resp StickerTypeCustomEmoji
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) { func UnmarshalClosedVectorPath(data json.RawMessage) (*ClosedVectorPath, error) {
var resp ClosedVectorPath var resp ClosedVectorPath
@ -5795,6 +5931,14 @@ func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorR
return &resp, err return &resp, err
} }
func UnmarshalPremiumGiftOption(data json.RawMessage) (*PremiumGiftOption, error) {
var resp PremiumGiftOption
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUser(data json.RawMessage) (*User, error) { func UnmarshalUser(data json.RawMessage) (*User, error) {
var resp User var resp User
@ -7467,6 +7611,14 @@ func UnmarshalPaymentProviderOther(data json.RawMessage) (*PaymentProviderOther,
return &resp, err return &resp, err
} }
func UnmarshalPaymentOption(data json.RawMessage) (*PaymentOption, error) {
var resp PaymentOption
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) { func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) {
var resp PaymentForm var resp PaymentForm
@ -8443,6 +8595,14 @@ func UnmarshalMessagePaymentSuccessfulBot(data json.RawMessage) (*MessagePayment
return &resp, err return &resp, err
} }
func UnmarshalMessageGiftedPremium(data json.RawMessage) (*MessageGiftedPremium, error) {
var resp MessageGiftedPremium
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
@ -8651,6 +8811,14 @@ func UnmarshalTextEntityTypeMentionName(data json.RawMessage) (*TextEntityTypeMe
return &resp, err return &resp, err
} }
func UnmarshalTextEntityTypeCustomEmoji(data json.RawMessage) (*TextEntityTypeCustomEmoji, error) {
var resp TextEntityTypeCustomEmoji
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) { func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTypeMediaTimestamp, error) {
var resp TextEntityTypeMediaTimestamp var resp TextEntityTypeMediaTimestamp
@ -9571,6 +9739,30 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error)
return &resp, err return &resp, err
} }
func UnmarshalSpeechRecognitionResultPending(data json.RawMessage) (*SpeechRecognitionResultPending, error) {
var resp SpeechRecognitionResultPending
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSpeechRecognitionResultText(data json.RawMessage) (*SpeechRecognitionResultText, error) {
var resp SpeechRecognitionResultText
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSpeechRecognitionResultError(data json.RawMessage) (*SpeechRecognitionResultError, error) {
var resp SpeechRecognitionResultError
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) { func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) {
var resp AttachmentMenuBotColor var resp AttachmentMenuBotColor
@ -10355,6 +10547,14 @@ func UnmarshalPremiumFeatureUniqueStickers(data json.RawMessage) (*PremiumFeatur
return &resp, err return &resp, err
} }
func UnmarshalPremiumFeatureCustomEmoji(data json.RawMessage) (*PremiumFeatureCustomEmoji, error) {
var resp PremiumFeatureCustomEmoji
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) { func UnmarshalPremiumFeatureAdvancedChatManagement(data json.RawMessage) (*PremiumFeatureAdvancedChatManagement, error) {
var resp PremiumFeatureAdvancedChatManagement var resp PremiumFeatureAdvancedChatManagement
@ -10451,6 +10651,22 @@ func UnmarshalPremiumState(data json.RawMessage) (*PremiumState, error) {
return &resp, err return &resp, err
} }
func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*StorePaymentPurposePremiumSubscription, error) {
var resp StorePaymentPurposePremiumSubscription
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) {
var resp StorePaymentPurposeGiftedPremium
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) { func UnmarshalDeviceTokenFirebaseCloudMessaging(data json.RawMessage) (*DeviceTokenFirebaseCloudMessaging, error) {
var resp DeviceTokenFirebaseCloudMessaging var resp DeviceTokenFirebaseCloudMessaging
@ -11347,6 +11563,14 @@ func UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data json.RawMessage)
return &resp, err return &resp, err
} }
func UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data json.RawMessage) (*UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages, error) {
var resp UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) { func UnmarshalAccountTtl(data json.RawMessage) (*AccountTtl, error) {
var resp AccountTtl var resp AccountTtl
@ -11811,6 +12035,14 @@ func UnmarshalInternalLinkTypeQrCodeAuthentication(data json.RawMessage) (*Inter
return &resp, err return &resp, err
} }
func UnmarshalInternalLinkTypeRestorePurchases(data json.RawMessage) (*InternalLinkTypeRestorePurchases, error) {
var resp InternalLinkTypeRestorePurchases
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) { func UnmarshalInternalLinkTypeSettings(data json.RawMessage) (*InternalLinkTypeSettings, error) {
var resp InternalLinkTypeSettings var resp InternalLinkTypeSettings
@ -13714,18 +13946,24 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMaskPosition: case TypeMaskPosition:
return UnmarshalMaskPosition(data) return UnmarshalMaskPosition(data)
case TypeStickerTypeStatic: case TypeStickerFormatWebp:
return UnmarshalStickerTypeStatic(data) return UnmarshalStickerFormatWebp(data)
case TypeStickerTypeAnimated: case TypeStickerFormatTgs:
return UnmarshalStickerTypeAnimated(data) return UnmarshalStickerFormatTgs(data)
case TypeStickerTypeVideo: case TypeStickerFormatWebm:
return UnmarshalStickerTypeVideo(data) return UnmarshalStickerFormatWebm(data)
case TypeStickerTypeRegular:
return UnmarshalStickerTypeRegular(data)
case TypeStickerTypeMask: case TypeStickerTypeMask:
return UnmarshalStickerTypeMask(data) return UnmarshalStickerTypeMask(data)
case TypeStickerTypeCustomEmoji:
return UnmarshalStickerTypeCustomEmoji(data)
case TypeClosedVectorPath: case TypeClosedVectorPath:
return UnmarshalClosedVectorPath(data) return UnmarshalClosedVectorPath(data)
@ -13834,6 +14072,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatAdministratorRights: case TypeChatAdministratorRights:
return UnmarshalChatAdministratorRights(data) return UnmarshalChatAdministratorRights(data)
case TypePremiumGiftOption:
return UnmarshalPremiumGiftOption(data)
case TypeUser: case TypeUser:
return UnmarshalUser(data) return UnmarshalUser(data)
@ -14461,6 +14702,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePaymentProviderOther: case TypePaymentProviderOther:
return UnmarshalPaymentProviderOther(data) return UnmarshalPaymentProviderOther(data)
case TypePaymentOption:
return UnmarshalPaymentOption(data)
case TypePaymentForm: case TypePaymentForm:
return UnmarshalPaymentForm(data) return UnmarshalPaymentForm(data)
@ -14827,6 +15071,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessagePaymentSuccessfulBot: case TypeMessagePaymentSuccessfulBot:
return UnmarshalMessagePaymentSuccessfulBot(data) return UnmarshalMessagePaymentSuccessfulBot(data)
case TypeMessageGiftedPremium:
return UnmarshalMessageGiftedPremium(data)
case TypeMessageContactRegistered: case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data) return UnmarshalMessageContactRegistered(data)
@ -14905,6 +15152,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeTextEntityTypeMentionName: case TypeTextEntityTypeMentionName:
return UnmarshalTextEntityTypeMentionName(data) return UnmarshalTextEntityTypeMentionName(data)
case TypeTextEntityTypeCustomEmoji:
return UnmarshalTextEntityTypeCustomEmoji(data)
case TypeTextEntityTypeMediaTimestamp: case TypeTextEntityTypeMediaTimestamp:
return UnmarshalTextEntityTypeMediaTimestamp(data) return UnmarshalTextEntityTypeMediaTimestamp(data)
@ -15250,6 +15500,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeImportedContacts: case TypeImportedContacts:
return UnmarshalImportedContacts(data) return UnmarshalImportedContacts(data)
case TypeSpeechRecognitionResultPending:
return UnmarshalSpeechRecognitionResultPending(data)
case TypeSpeechRecognitionResultText:
return UnmarshalSpeechRecognitionResultText(data)
case TypeSpeechRecognitionResultError:
return UnmarshalSpeechRecognitionResultError(data)
case TypeAttachmentMenuBotColor: case TypeAttachmentMenuBotColor:
return UnmarshalAttachmentMenuBotColor(data) return UnmarshalAttachmentMenuBotColor(data)
@ -15544,6 +15803,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumFeatureUniqueStickers: case TypePremiumFeatureUniqueStickers:
return UnmarshalPremiumFeatureUniqueStickers(data) return UnmarshalPremiumFeatureUniqueStickers(data)
case TypePremiumFeatureCustomEmoji:
return UnmarshalPremiumFeatureCustomEmoji(data)
case TypePremiumFeatureAdvancedChatManagement: case TypePremiumFeatureAdvancedChatManagement:
return UnmarshalPremiumFeatureAdvancedChatManagement(data) return UnmarshalPremiumFeatureAdvancedChatManagement(data)
@ -15580,6 +15842,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumState: case TypePremiumState:
return UnmarshalPremiumState(data) return UnmarshalPremiumState(data)
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposeGiftedPremium:
return UnmarshalStorePaymentPurposeGiftedPremium(data)
case TypeDeviceTokenFirebaseCloudMessaging: case TypeDeviceTokenFirebaseCloudMessaging:
return UnmarshalDeviceTokenFirebaseCloudMessaging(data) return UnmarshalDeviceTokenFirebaseCloudMessaging(data)
@ -15916,6 +16184,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUserPrivacySettingAllowFindingByPhoneNumber: case TypeUserPrivacySettingAllowFindingByPhoneNumber:
return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data) return UnmarshalUserPrivacySettingAllowFindingByPhoneNumber(data)
case TypeUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages:
return UnmarshalUserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages(data)
case TypeAccountTtl: case TypeAccountTtl:
return UnmarshalAccountTtl(data) return UnmarshalAccountTtl(data)
@ -16090,6 +16361,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypeQrCodeAuthentication: case TypeInternalLinkTypeQrCodeAuthentication:
return UnmarshalInternalLinkTypeQrCodeAuthentication(data) return UnmarshalInternalLinkTypeQrCodeAuthentication(data)
case TypeInternalLinkTypeRestorePurchases:
return UnmarshalInternalLinkTypeRestorePurchases(data)
case TypeInternalLinkTypeSettings: case TypeInternalLinkTypeSettings:
return UnmarshalInternalLinkTypeSettings(data) return UnmarshalInternalLinkTypeSettings(data)

View file

@ -101,7 +101,7 @@ authorizationStateWaitOtherDeviceConfirmation link:string = AuthorizationState;
//@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration @terms_of_service Telegram terms of service //@description The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration @terms_of_service Telegram terms of service
authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState; authorizationStateWaitRegistration terms_of_service:termsOfService = AuthorizationState;
//@description The user has been authorized, but needs to enter a password to start using the application @password_hint Hint for the password; may be empty @has_recovery_email_address True, if a recovery email address has been set up //@description The user has been authorized, but needs to enter a 2-step verification password to start using the application @password_hint Hint for the password; may be empty @has_recovery_email_address True, if a recovery email address has been set up
//@recovery_email_address_pattern Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent //@recovery_email_address_pattern Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool recovery_email_address_pattern:string = AuthorizationState; authorizationStateWaitPassword password_hint:string has_recovery_email_address:Bool recovery_email_address_pattern:string = AuthorizationState;
@ -122,7 +122,7 @@ authorizationStateClosed = AuthorizationState;
//@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty //@description Represents the current state of 2-step verification @has_password True, if a 2-step verification password is set @password_hint Hint for the password; may be empty
//@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved //@has_recovery_email_address True, if a recovery email is set @has_passport_data True, if some Telegram Passport elements were saved
//@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null //@recovery_email_address_code_info Information about the recovery email address to which the confirmation email was sent; may be null
//@pending_reset_date If not 0, point in time (Unix timestamp) after which the password can be reset immediately using resetPassword //@pending_reset_date If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword
passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState; passwordState has_password:Bool password_hint:string has_recovery_email_address:Bool has_passport_data:Bool recovery_email_address_code_info:emailAddressAuthenticationCodeInfo pending_reset_date:int32 = PasswordState;
//@description Contains information about the current recovery email address @recovery_email_address Recovery email address //@description Contains information about the current recovery email address @recovery_email_address Recovery email address
@ -241,19 +241,28 @@ maskPointChin = MaskPoint;
maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition; maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPosition;
//@class StickerType @description Describes type of a sticker //@class StickerFormat @description Describes format of a sticker
//@description The sticker is an image in WEBP format //@description The sticker is an image in WEBP format
stickerTypeStatic = StickerType; stickerFormatWebp = StickerFormat;
//@description The sticker is an animation in TGS format //@description The sticker is an animation in TGS format
stickerTypeAnimated = StickerType; stickerFormatTgs = StickerFormat;
//@description The sticker is a video in WEBM format //@description The sticker is a video in WEBM format
stickerTypeVideo = StickerType; stickerFormatWebm = StickerFormat;
//@description The sticker is a mask in WEBP format to be placed on photos or videos @mask_position Position where the mask is placed; may be null
stickerTypeMask mask_position:maskPosition = StickerType; //@class StickerType @description Describes type of a sticker
//@description The sticker is a regular sticker
stickerTypeRegular = StickerType;
//@description The sticker is a mask in WEBP format to be placed on photos or videos
stickerTypeMask = StickerType;
//@description The sticker is a custom emoji to be used inside message text and caption
stickerTypeCustomEmoji = StickerType;
//@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands //@description Represents a closed vector path. The path begins at the end point of the last command @commands List of vector path commands
@ -284,8 +293,9 @@ animation duration:int32 width:int32 height:int32 file_name:string mime_type:str
//@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender //@description Describes an audio file. Audio is usually in MP3 or M4A format @duration Duration of the audio, in seconds; as defined by the sender @title Title of the audio; as defined by the sender @performer Performer of the audio; as defined by the sender
//@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null //@file_name Original name of the file; as defined by the sender @mime_type The MIME type of the file; as defined by the sender @album_cover_minithumbnail The minithumbnail of the album cover; may be null
//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded file; may be null @audio File containing the audio //@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null
audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail audio:file = Audio; //@external_album_covers Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate @audio File containing the audio
audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector<thumbnail> audio:file = Audio;
//@description Describes a document of any type @file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender //@description Describes a document of any type @file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender
//@minithumbnail Document minithumbnail; may be null @thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null @document File containing the document //@minithumbnail Document minithumbnail; may be null @thumbnail Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null @document File containing the document
@ -296,9 +306,11 @@ document file_name:string mime_type:string minithumbnail:minithumbnail thumbnail
photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector<photoSize> = Photo; photo has_stickers:Bool minithumbnail:minithumbnail sizes:vector<photoSize> = Photo;
//@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender //@description Describes a sticker @set_id The identifier of the sticker set to which the sticker belongs; 0 if none @width Sticker width; as defined by the sender @height Sticker height; as defined by the sender
//@emoji Emoji corresponding to the sticker @type Sticker type @outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@emoji Emoji corresponding to the sticker @format Sticker format @type Sticker type @mask_position Position where the mask is placed; may be null even the sticker is a mask
//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @premium_animation Premium animation of the sticker; may be null. If present, only Premium users can send the sticker @sticker File containing the sticker //@custom_emoji_id Identifier of the emoji if the sticker is a custom emoji
sticker set_id:int64 width:int32 height:int32 emoji:string type:StickerType outline:vector<closedVectorPath> thumbnail:thumbnail premium_animation:file sticker:file = Sticker; //@outline Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
//@thumbnail Sticker thumbnail in WEBP or JPEG format; may be null @is_premium True, if only Premium users can use the sticker @premium_animation Premium animation of the sticker; may be null @sticker File containing the sticker
sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat type:StickerType mask_position:maskPosition custom_emoji_id:int64 outline:vector<closedVectorPath> thumbnail:thumbnail is_premium:Bool premium_animation:file sticker:file = Sticker;
//@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender //@description Describes a video file @duration Duration of the video, in seconds; as defined by the sender @width Video width; as defined by the sender @height Video height; as defined by the sender
//@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender //@file_name Original name of the file; as defined by the sender @mime_type MIME type of the file; as defined by the sender
@ -314,14 +326,13 @@ videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thum
//@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel //@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
//@duration Duration of the voice note, in seconds; as defined by the sender @waveform A waveform representation of the voice note in 5-bit format //@duration Duration of the voice note, in seconds; as defined by the sender @waveform A waveform representation of the voice note in 5-bit format
//@mime_type MIME type of the file; as defined by the sender @is_recognized True, if speech recognition is completed; Premium users only //@mime_type MIME type of the file; as defined by the sender @speech_recognition_result Result of speech recognition in the voice note; may be null @voice File containing the voice note
//@recognized_text Recognized text of the voice note; Premium users only. Call recognizeSpeech to get recognized text of the voice note @voice File containing the voice note voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_result:SpeechRecognitionResult voice:file = VoiceNote;
voiceNote duration:int32 waveform:bytes mime_type:string is_recognized:Bool recognized_text:string voice:file = VoiceNote;
//@description Describes an animated representation of an emoji //@description Describes an animated or custom representation of an emoji
//@sticker Animated sticker for the emoji //@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs
//@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none
//@sound File containing the sound to be played when the animated emoji is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container //@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container
animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji;
//@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0
@ -459,6 +470,16 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol
chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights;
//@description Describes an option for gifting Telegram Premium to a user
//@currency ISO 4217 currency code for Telegram Premium subscription payment
//@amount The amount to pay, in the smallest units of the currency
//@discount_percentage The discount associated with this gift option, as a percentage
//@month_count Number of month the Telegram Premium subscription will be active
//@store_product_id Identifier of the store product associated with the option
//@payment_link An internal link to be opened for gifting Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available
premiumGiftOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumGiftOption;
//@description Represents a user //@description Represents a user
//@id User identifier //@id User identifier
//@access_hash User access hash //@access_hash User access hash
@ -482,6 +503,7 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa
//@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 username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake: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 username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake: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
//@share_text The text that is shown on the bot's profile page and is sent together with the link when users share the bot //@share_text The text that is shown on the bot's profile page and is sent together with the link when users share the bot
//@param_description The text shown in the chat with the bot if the chat is empty //@param_description The text shown in the chat with the bot if the chat is empty
@ -493,7 +515,6 @@ user id:int53 access_hash:int64 first_name:string last_name:string username:stri
//@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null
botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector<botCommand> default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo;
//@description Contains full information about a user //@description Contains full information about a user
//@photo User profile photo; may be null //@photo User profile photo; may be null
//@is_blocked True, if the user is blocked by the current user //@is_blocked True, if the user is blocked by the current user
@ -501,11 +522,13 @@ botInfo share_text:string description:string photo:photo animation:animation men
//@supports_video_calls True, if a video call can be created with the user //@supports_video_calls True, if a video call can be created with the user
//@has_private_calls True, if the user can't be called due to their privacy settings //@has_private_calls True, if the user can't be called due to their privacy settings
//@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings //@has_private_forwards True, if the user can't be linked in forwarded messages due to their privacy settings
//@has_restricted_voice_and_video_note_messages True, if voice and video notes can't be sent or forwarded to the user
//@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used //@need_phone_number_privacy_exception True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
//@bio A short user bio; may be null for bots //@bio A short user bio; may be null for bots
//@premium_gift_options The list of available options for gifting Telegram Premium to 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_info For bots, information about the bot; may be null //@bot_info For bots, information about the bot; may be null
userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool need_phone_number_privacy_exception:Bool bio:formattedText group_in_common_count:int32 bot_info:botInfo = UserFullInfo; userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool need_phone_number_privacy_exception:Bool bio:formattedText premium_gift_options:vector<premiumGiftOption> group_in_common_count:int32 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;
@ -751,7 +774,7 @@ secretChatStateClosed = SecretChatState;
//@is_outbound True, if the chat was created by the current user; otherwise false //@is_outbound True, if the chat was created by the current user; otherwise false
//@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. //@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9.
//-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers //-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers
//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143 //@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144
secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat; secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat;
@ -855,7 +878,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n
//@can_be_deleted_for_all_users True, if the message can be deleted for all users //@can_be_deleted_for_all_users True, if the message can be deleted for all users
//@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions //@can_get_added_reactions True, if the list of added reactions is available through getMessageAddedReactions
//@can_get_statistics True, if the message statistics are available through getMessageStatistics //@can_get_statistics True, if the message statistics are available through getMessageStatistics
//@can_get_message_thread True, if information about the message thread is available through getMessageThread //@can_get_message_thread True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers //@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers
//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink //@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink
//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
@ -982,7 +1005,7 @@ chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType;
//@description Represents a filter of user chats //@description Represents a filter of user chats
//@title The title of the filter; 1-12 characters without line feeds //@title The title of the filter; 1-12 characters without line feeds
//@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". //@icon_name The chosen icon name for short filter representation. If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette".
//-If empty, use getChatFilterDefaultIconName to get default icon name for the filter //-If empty, use getChatFilterDefaultIconName to get default icon name for the filter
//@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@pinned_chat_ids The chat identifiers of pinned chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
//@included_chat_ids The chat identifiers of always included chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium //@included_chat_ids The chat identifiers of always included chats in the filtered chat list. There can be up to GetOption("chat_filter_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
@ -1000,7 +1023,7 @@ chatFilter title:string icon_name:string pinned_chat_ids:vector<int53> included_
//@description Contains basic information about a chat filter //@description Contains basic information about a chat filter
//@id Unique chat filter identifier //@id Unique chat filter identifier
//@title The title of the filter; 1-12 characters without line feeds //@title The title of the filter; 1-12 characters without line feeds
//@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work" //@icon_name The chosen or default icon name for short filter representation. One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"
chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo; chatFilterInfo id:int32 title:string icon_name:string = ChatFilterInfo;
//@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description //@description Describes a recommended chat filter @filter The chat filter @param_description Chat filter description
@ -1169,7 +1192,7 @@ inlineKeyboardButtonTypeWebApp url:string = InlineKeyboardButtonType;
//@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query //@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query
inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType; inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType;
//@description A button that asks for password of the current user and then sends a callback query to a bot @data Data to be sent to the bot via a callback query //@description A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot @data Data to be sent to the bot via a callback query
inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonType; inlineKeyboardButtonTypeCallbackWithPassword data:bytes = InlineKeyboardButtonType;
//@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame //@description A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
@ -1516,7 +1539,7 @@ orderInfo name:string phone_number:string email_address:string shipping_address:
//@description One shipping option @id Shipping option identifier @title Option title @price_parts A list of objects used to calculate the total shipping costs //@description One shipping option @id Shipping option identifier @title Option title @price_parts A list of objects used to calculate the total shipping costs
shippingOption id:string title:string price_parts:vector<labeledPricePart> = ShippingOption; shippingOption id:string title:string price_parts:vector<labeledPricePart> = ShippingOption;
//@description Contains information about saved card credentials @id Unique identifier of the saved credentials @title Title of the saved credentials //@description Contains information about saved payment credentials @id Unique identifier of the saved credentials @title Title of the saved credentials
savedCredentials id:string title:string = SavedCredentials; savedCredentials id:string title:string = SavedCredentials;
@ -1547,20 +1570,25 @@ paymentProviderStripe publishable_key:string need_country:Bool need_postal_code:
paymentProviderOther url:string = PaymentProvider; paymentProviderOther url:string = PaymentProvider;
//@description Describes an additional payment option @title Title for the payment option @url Payment form URL to be opened in a web view
paymentOption title:string url:string = PaymentOption;
//@description Contains information about an invoice payment form //@description Contains information about an invoice payment form
//@id The payment form identifier //@id The payment form identifier
//@invoice Full information about the invoice //@invoice Full information about the invoice
//@seller_bot_user_id User identifier of the seller bot //@seller_bot_user_id User identifier of the seller bot
//@payment_provider_user_id User identifier of the payment provider bot //@payment_provider_user_id User identifier of the payment provider bot
//@payment_provider Information about the payment provider //@payment_provider Information about the payment provider
//@additional_payment_options The list of additional payment options
//@saved_order_info Saved server-side order information; may be null //@saved_order_info Saved server-side order information; may be null
//@saved_credentials Information about saved card credentials; may be null //@saved_credentials The list of saved payment credentials
//@can_save_credentials True, if the user can choose to save credentials //@can_save_credentials True, if the user can choose to save credentials
//@need_password True, if the user will be able to save credentials protected by a password they set up //@need_password True, if the user will be able to save credentials, if sets up a 2-step verification password
//@product_title Product title //@product_title Product title
//@product_description Product description //@product_description Product description
//@product_photo Product photo; may be null //@product_photo Product photo; may be null
paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm; paymentForm id:int64 invoice:invoice seller_bot_user_id:int53 payment_provider_user_id:int53 payment_provider:PaymentProvider additional_payment_options:vector<paymentOption> saved_order_info:orderInfo saved_credentials:vector<savedCredentials> can_save_credentials:Bool need_password:Bool product_title:string product_description:formattedText product_photo:photo = PaymentForm;
//@description Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options //@description Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options
validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo; validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo;
@ -1988,6 +2016,10 @@ messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency
//@telegram_payment_charge_id Telegram payment identifier @provider_payment_charge_id Provider payment identifier //@telegram_payment_charge_id Telegram payment identifier @provider_payment_charge_id Provider payment identifier
messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; messagePaymentSuccessfulBot currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent;
//@description Telegram Premium was gifted to the user @currency Currency for the paid amount @amount The paid amount, in the smallest units of the currency @month_count Number of month the Telegram Premium subscription will be active
//@sticker A sticker to be shown in the message; may be null if unknown
messageGiftedPremium currency:string amount:int53 month_count:int32 sticker:sticker = MessageContent;
//@description A contact has registered with Telegram //@description A contact has registered with Telegram
messageContactRegistered = MessageContent; messageContactRegistered = MessageContent;
@ -2051,7 +2083,7 @@ textEntityTypeUnderline = TextEntityType;
//@description A strikethrough text //@description A strikethrough text
textEntityTypeStrikethrough = TextEntityType; textEntityTypeStrikethrough = TextEntityType;
//@description A spoiler text. Not supported in secret chats //@description A spoiler text
textEntityTypeSpoiler = TextEntityType; textEntityTypeSpoiler = TextEntityType;
//@description Text that must be formatted as if inside a code HTML tag //@description Text that must be formatted as if inside a code HTML tag
@ -2069,6 +2101,9 @@ textEntityTypeTextUrl url:string = TextEntityType;
//@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user //@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user
textEntityTypeMentionName user_id:int53 = TextEntityType; textEntityTypeMentionName user_id:int53 = TextEntityType;
//@description A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji @custom_emoji_id Unique identifier of the custom emoji
textEntityTypeCustomEmoji custom_emoji_id:int64 = TextEntityType;
//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message //@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType; textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType;
@ -2105,7 +2140,7 @@ messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText
//@class InputMessageContent @description The content of a message to send //@class InputMessageContent @description The content of a message to send
//@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually //@description A text message @text Formatted text to be sent; 1-GetOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
//@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled @clear_draft True, if a chat message draft must be deleted //@disable_web_page_preview True, if rich web page previews for URLs in the message text must be disabled @clear_draft True, if a chat message draft must be deleted
inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent; inputMessageText text:formattedText disable_web_page_preview:Bool clear_draft:Bool = InputMessageContent;
@ -2307,17 +2342,17 @@ emojis emojis:vector<string> = Emojis;
//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed //@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
//@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets //@is_official True, if the sticker set is official @sticker_format Format of the stickers in the set @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets
//@stickers List of stickers in this set @emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object //@stickers List of stickers in this set @emojis A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool stickers:vector<sticker> emojis:vector<emojis> = StickerSet; stickerSet id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool stickers:vector<sticker> emojis:vector<emojis> = StickerSet;
//@description Represents short information about a sticker set //@description Represents short information about a sticker set
//@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null //@id Identifier of the sticker set @title Title of the sticker set @name Name of the sticker set @thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null
//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner //@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
//@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously //@is_installed True, if the sticker set has been installed by the current user @is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
//@is_official True, if the sticker set is official @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets //@is_official True, if the sticker set is official @sticker_format Format of the stickers in the set @sticker_type Type of the stickers in the set @is_viewed True for already viewed trending sticker sets
//@size Total number of stickers in the set @covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested //@size Total number of stickers in the set @covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested
stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo; stickerSetInfo id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector<closedVectorPath> is_installed:Bool is_archived:Bool is_official:Bool sticker_format:StickerFormat sticker_type:StickerType is_viewed:Bool size:int32 covers:vector<sticker> = StickerSetInfo;
//@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets //@description Represents a list of sticker sets @total_count Approximate total number of sticker sets found @sets List of sticker sets
stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets; stickerSets total_count:int32 sets:vector<stickerSetInfo> = StickerSets;
@ -2569,6 +2604,18 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente
importedContacts user_ids:vector<int53> importer_count:vector<int32> = ImportedContacts; importedContacts user_ids:vector<int53> importer_count:vector<int32> = ImportedContacts;
//@class SpeechRecognitionResult @description Describes result of speech recognition in a voice note
//@description The speech recognition is ongoing @partial_text Partially recognized text
speechRecognitionResultPending partial_text:string = SpeechRecognitionResult;
//@description The speech recognition successfully finished @text Recognized text
speechRecognitionResultText text:string = SpeechRecognitionResult;
//@description The speech recognition failed @error Received error
speechRecognitionResultError error:error = SpeechRecognitionResult;
//@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes //@description Describes a color to highlight a bot added to attachment menu @light_color Color in the RGB24 format for light themes @dark_color Color in the RGB24 format for dark themes
attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor; attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotColor;
@ -2724,7 +2771,7 @@ inlineQueryResults inline_query_id:int64 next_offset:string results:vector<Inlin
//@description The payload for a general callback button @data Data that was attached to the callback button //@description The payload for a general callback button @data Data that was attached to the callback button
callbackQueryPayloadData data:bytes = CallbackQueryPayload; callbackQueryPayloadData data:bytes = CallbackQueryPayload;
//@description The payload for a callback button requiring password @password The password for the current user @data Data that was attached to the callback button //@description The payload for a callback button requiring password @password The 2-step verification password for the current user @data Data that was attached to the callback button
callbackQueryPayloadDataWithPassword password:string data:bytes = CallbackQueryPayload; callbackQueryPayloadDataWithPassword password:string data:bytes = CallbackQueryPayload;
//@description The payload for a game callback button @game_short_name A short name of the game that was attached to the callback button //@description The payload for a game callback button @game_short_name A short name of the game that was attached to the callback button
@ -2965,6 +3012,9 @@ premiumFeatureUniqueReactions = PremiumFeature;
//@description Allowed to use premium stickers with unique effects //@description Allowed to use premium stickers with unique effects
premiumFeatureUniqueStickers = PremiumFeature; premiumFeatureUniqueStickers = PremiumFeature;
//@description Allowed to use custom emoji stickers in message texts and captions
premiumFeatureCustomEmoji = PremiumFeature;
//@description Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram //@description Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram
premiumFeatureAdvancedChatManagement = PremiumFeature; premiumFeatureAdvancedChatManagement = PremiumFeature;
@ -2982,7 +3032,7 @@ premiumFeatureAppIcons = PremiumFeature;
premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit; premiumLimit type:PremiumLimitType default_value:int32 premium_value:int32 = PremiumLimit;
//@description Contains information about features, available to Premium users @features The list of available features @limits The list of limits, increased for Premium users //@description Contains information about features, available to Premium users @features The list of available features @limits The list of limits, increased for Premium users
//@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available. If the link has type internalLinkTypeBotStart, then sendBotStartMessage must be called automatically //@payment_link An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available
premiumFeatures features:vector<PremiumFeature> limits:vector<premiumLimit> payment_link:InternalLinkType = PremiumFeatures; premiumFeatures features:vector<PremiumFeature> limits:vector<premiumLimit> payment_link:InternalLinkType = PremiumFeatures;
@ -3012,6 +3062,15 @@ premiumFeaturePromotionAnimation feature:PremiumFeature animation:animation = Pr
premiumState state:formattedText currency:string monthly_amount:int53 animations:vector<premiumFeaturePromotionAnimation> = PremiumState; premiumState state:formattedText currency:string monthly_amount:int53 animations:vector<premiumFeaturePromotionAnimation> = PremiumState;
//@class StorePaymentPurpose @description Describes a purpose of an in-store payment
//@description The user subscribed to Telegram Premium @is_restore Pass true if this is a restore of a Telegram Premium purchase; only for App Store
storePaymentPurposePremiumSubscription is_restore:Bool = StorePaymentPurpose;
//@description The user gifted Telegram Premium to another user @user_id Identifier of the user for which Premium was gifted @currency ISO 4217 currency code of the payment currency @amount Paid amount, in the smallest units of the currency
storePaymentPurposeGiftedPremium user_id:int53 currency:string amount:int53 = StorePaymentPurpose;
//@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org
//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted //@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to deregister a device @encrypt True, if push notifications must be additionally encrypted
@ -3441,6 +3500,9 @@ userPrivacySettingAllowPeerToPeerCalls = UserPrivacySetting;
//@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all" //@description A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting; userPrivacySettingAllowFindingByPhoneNumber = UserPrivacySetting;
//@description A privacy setting for managing whether the user can receive voice and video messages in private chats
userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages = UserPrivacySetting;
//@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days //@description Contains information about the period of inactivity after which the current user's account will automatically be deleted @days Number of days of inactivity before the account will be flagged for deletion; 30-366 days
accountTtl days:int32 = AccountTtl; accountTtl days:int32 = AccountTtl;
@ -3502,7 +3564,7 @@ sessionTypeXbox = SessionType;
//@description Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order //@description Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order
//@id Session identifier @is_current True, if this session is the current session //@id Session identifier @is_current True, if this session is the current session
//@is_password_pending True, if a password is needed to complete authorization of the session //@is_password_pending True, if a 2-step verification password is needed to complete authorization of the session
//@can_accept_secret_chats True, if incoming secret chats can be accepted by the session //@can_accept_secret_chats True, if incoming secret chats can be accepted by the session
//@can_accept_calls True, if incoming calls can be accepted by the session //@can_accept_calls True, if incoming calls can be accepted by the session
//@type Session type based on the system and application version, which can be used to display a corresponding icon //@type Session type based on the system and application version, which can be used to display a corresponding icon
@ -3604,7 +3666,8 @@ internalLinkTypeBackground background_name:string = InternalLinkType;
//@description The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, //@description The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot,
//-and then call sendBotStartMessage with the given start parameter after the button is pressed //-and then call sendBotStartMessage with the given start parameter after the button is pressed
//@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage //@bot_username Username of the bot @start_parameter The parameter to be passed to sendBotStartMessage
internalLinkTypeBotStart bot_username:string start_parameter:string = InternalLinkType; //@autostart True, if sendBotStartMessage must be called automatically without showing the START button
internalLinkTypeBotStart bot_username:string start_parameter:string autostart:Bool = InternalLinkType;
//@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, //@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups,
//-ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. //-ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup.
@ -3676,6 +3739,9 @@ internalLinkTypePublicChat chat_username:string = InternalLinkType;
//-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown //-"This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
internalLinkTypeQrCodeAuthentication = InternalLinkType; internalLinkTypeQrCodeAuthentication = InternalLinkType;
//@description The link forces restore of App Store purchases when opened. For official iOS application only
internalLinkTypeRestorePurchases = InternalLinkType;
//@description The link is a link to application settings //@description The link is a link to application settings
internalLinkTypeSettings = InternalLinkType; internalLinkTypeSettings = InternalLinkType;
@ -3980,8 +4046,9 @@ proxies proxies:vector<proxy> = Proxies;
//@description A sticker to be added to a sticker set //@description A sticker to be added to a sticker set
//@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements //@sticker File with the sticker; must fit in a 512x512 square. For WEBP stickers and masks the file must be in PNG format, which will be converted to WEBP server-side. Otherwise, the file must be local or uploaded within a week. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
//@emojis Emojis corresponding to the sticker //@emojis Emojis corresponding to the sticker
//@type Sticker type //@format Sticker format
inputSticker sticker:InputFile emojis:string type:StickerType = InputSticker; //@mask_position Position where the mask is placed; pass null if not specified
inputSticker sticker:InputFile emojis:string format:StickerFormat mask_position:maskPosition = InputSticker;
//@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends //@description Represents a date range @start_date Point in time (Unix timestamp) at which the date range begins @end_date Point in time (Unix timestamp) at which the date range ends
@ -4361,11 +4428,11 @@ updateOption name:string value:OptionValue = Update;
//@description A sticker set has changed @sticker_set The sticker set //@description A sticker set has changed @sticker_set The sticker set
updateStickerSet sticker_set:stickerSet = Update; updateStickerSet sticker_set:stickerSet = Update;
//@description The list of installed sticker sets was updated @is_masks True, if the list of installed mask sticker sets was updated @sticker_set_ids The new list of installed ordinary sticker sets //@description The list of installed sticker sets was updated @sticker_type Type of the affected stickers @sticker_set_ids The new list of installed ordinary sticker sets
updateInstalledStickerSets is_masks:Bool sticker_set_ids:vector<int64> = Update; updateInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int64> = Update;
//@description The list of trending sticker sets was updated or some of them were viewed @sticker_sets The prefix of the list of trending sticker sets with the newest trending sticker sets //@description The list of trending sticker sets was updated or some of them were viewed @sticker_type Type of the affected stickers @sticker_sets The prefix of the list of trending sticker sets with the newest trending sticker sets
updateTrendingStickerSets sticker_sets:trendingStickerSets = Update; updateTrendingStickerSets sticker_type:StickerType sticker_sets:trendingStickerSets = Update;
//@description The list of recently used stickers was updated @is_attached True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated @sticker_ids The new list of file identifiers of recently used stickers //@description The list of recently used stickers was updated @is_attached True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated @sticker_ids The new list of file identifiers of recently used stickers
updateRecentStickers is_attached:Bool sticker_ids:vector<int32> = Update; updateRecentStickers is_attached:Bool sticker_ids:vector<int32> = Update;
@ -4537,17 +4604,17 @@ requestQrCodeAuthentication other_user_ids:vector<int53> = Ok;
//@first_name The first name of the user; 1-64 characters @last_name The last name of the user; 0-64 characters //@first_name The first name of the user; 1-64 characters @last_name The last name of the user; 0-64 characters
registerUser first_name:string last_name:string = Ok; registerUser first_name:string last_name:string = Ok;
//@description Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword @password The password to check //@description Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword @password The 2-step verification password to check
checkAuthenticationPassword password:string = Ok; checkAuthenticationPassword password:string = Ok;
//@description Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword //@description Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
requestAuthenticationPasswordRecovery = Ok; requestAuthenticationPasswordRecovery = Ok;
//@description Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword @recovery_code Recovery code to check //@description Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword @recovery_code Recovery code to check
checkAuthenticationPasswordRecoveryCode recovery_code:string = Ok; checkAuthenticationPasswordRecoveryCode recovery_code:string = Ok;
//@description Recovers the password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword //@description Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
//@recovery_code Recovery code to check @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty //@recovery_code Recovery code to check @new_password New 2-step verification password of the user; may be empty to remove the password @new_hint New password hint; may be empty
recoverAuthenticationPassword recovery_code:string new_password:string new_hint:string = Ok; recoverAuthenticationPassword recovery_code:string new_password:string new_hint:string = Ok;
//@description Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in @token The bot token //@description Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in @token The bot token
@ -4578,15 +4645,15 @@ setDatabaseEncryptionKey new_encryption_key:bytes = Ok;
//@description Returns the current state of 2-step verification //@description Returns the current state of 2-step verification
getPasswordState = PasswordState; getPasswordState = PasswordState;
//@description Changes the password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed //@description Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed
//@old_password Previous password of the user @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true to change also the recovery email address @new_recovery_email_address New recovery email address; may be empty //@old_password Previous 2-step verification password of the user @new_password New 2-step verification password of the user; may be empty to remove the password @new_hint New password hint; may be empty @set_recovery_email_address Pass true to change also the recovery email address @new_recovery_email_address New recovery email address; may be empty
setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState; setPassword old_password:string new_password:string new_hint:string set_recovery_email_address:Bool new_recovery_email_address:string = PasswordState;
//@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The password for the current user //@description Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user @password The 2-step verification password for the current user
getRecoveryEmailAddress password:string = RecoveryEmailAddress; getRecoveryEmailAddress password:string = RecoveryEmailAddress;
//@description Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed. //@description Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed.
//-If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation @password Password of the current user @new_recovery_email_address New recovery email address //-If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation @password The 2-step verification password of the current user @new_recovery_email_address New recovery email address
setRecoveryEmailAddress password:string new_recovery_email_address:string = PasswordState; setRecoveryEmailAddress password:string new_recovery_email_address:string = PasswordState;
//@description Checks the 2-step verification recovery email address verification code @code Verification code to check //@description Checks the 2-step verification recovery email address verification code @code Verification code to check
@ -4602,7 +4669,7 @@ requestPasswordRecovery = EmailAddressAuthenticationCodeInfo;
checkPasswordRecoveryCode recovery_code:string = Ok; checkPasswordRecoveryCode recovery_code:string = Ok;
//@description Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up //@description Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up
//@recovery_code Recovery code to check @new_password New password of the user; may be empty to remove the password @new_hint New password hint; may be empty //@recovery_code Recovery code to check @new_password New 2-step verification password of the user; may be empty to remove the password @new_hint New password hint; may be empty
recoverPassword recovery_code:string new_password:string new_hint:string = PasswordState; recoverPassword recovery_code:string new_password:string new_hint:string = PasswordState;
//@description Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time //@description Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time
@ -4611,7 +4678,7 @@ resetPassword = ResetPasswordResult;
//@description Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0 //@description Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0
cancelPasswordReset = Ok; cancelPasswordReset = Ok;
//@description Creates a new temporary password for processing payments @password Persistent user password @valid_for Time during which the temporary password will be valid, in seconds; must be between 60 and 86400 //@description Creates a new temporary password for processing payments @password The 2-step verification password of the current user @valid_for Time during which the temporary password will be valid, in seconds; must be between 60 and 86400
createTemporaryPassword password:string valid_for:int32 = TemporaryPasswordState; createTemporaryPassword password:string valid_for:int32 = TemporaryPasswordState;
//@description Returns information about the current temporary password //@description Returns information about the current temporary password
@ -5043,7 +5110,7 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup =
editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok;
//@description Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message. The method will return Premium reactions, even the current user has no Premium subscription //@description Returns reactions, which can be added to a message. The list can change after updateReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
//@chat_id Identifier of the chat to which the message belongs //@chat_id Identifier of the chat to which the message belongs
//@message_id Identifier of the message //@message_id Identifier of the message
getMessageAvailableReactions chat_id:int53 message_id:int53 = AvailableReactions; getMessageAvailableReactions chat_id:int53 message_id:int53 = AvailableReactions;
@ -5067,7 +5134,7 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction:string offset:s
//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites //@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites
getTextEntities text:string = TextEntities; getTextEntities text:string = TextEntities;
//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode //@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode
parseTextEntities text:string parse_mode:TextParseMode = FormattedText; parseTextEntities text:string parse_mode:TextParseMode = FormattedText;
//@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
@ -5343,7 +5410,7 @@ setChatTheme chat_id:int53 theme_name:string = Ok;
setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok; setChatDraftMessage chat_id:int53 message_thread_id:int53 draft_message:draftMessage = Ok;
//@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed //@description Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed
//@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 1 week, it is considered to be muted forever //@chat_id Chat identifier @notification_settings New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever
setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok; setChatNotificationSettings chat_id:int53 notification_settings:chatNotificationSettings = Ok;
//@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges //@description Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
@ -5418,7 +5485,7 @@ banChatMember chat_id:int53 member_id:MessageSender banned_until_date:int32 revo
canTransferOwnership = CanTransferOwnershipResult; canTransferOwnership = CanTransferOwnershipResult;
//@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats //@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
//@chat_id Chat identifier @user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user @password The password of the current user //@chat_id Chat identifier @user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user @password The 2-step verification password of the current user
transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok;
//@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier //@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier
@ -5499,14 +5566,14 @@ cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok;
//@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved //@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved
getSuggestedFileName file_id:int32 directory:string = Text; getSuggestedFileName file_id:int32 directory:string = Text;
//@description Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message //@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message
//@file File to upload //@file File to upload
//@file_type File type; pass null if unknown //@file_type File type; pass null if unknown
//@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded first //@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first
uploadFile file:InputFile file_type:FileType priority:int32 = File; preliminaryUploadFile file:InputFile file_type:FileType priority:int32 = File;
//@description Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading //@description Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading
cancelUploadFile file_id:int32 = Ok; cancelPreliminaryUploadFile file_id:int32 = Ok;
//@description Writes a part of a generated file. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file //@description Writes a part of a generated file. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file
//@generation_id The identifier of the generation process @offset The offset from which to write the data to the file @data The data to write //@generation_id The identifier of the generation process @offset The offset from which to write the data to the file @data The data to write
@ -5856,22 +5923,30 @@ sharePhoneNumber user_id:int53 = Ok;
getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos;
//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit The maximum number of stickers to be returned //@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, then favorite, recently used or trending stickers may also be returned
getStickers emoji:string limit:int32 = Stickers; //@sticker_type Type of the sticker sets to return
//@emoji String representation of emoji. If empty, returns all known installed stickers
//@limit The maximum number of stickers to be returned
//@chat_id Chat identifier for which to return stickers. Available custom emoji may be different for different chats
getStickers sticker_type:StickerType emoji:string limit:int32 chat_id:int53 = Stickers;
//@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned //@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned; 0-100
searchStickers emoji:string limit:int32 = Stickers; searchStickers emoji:string limit:int32 = Stickers;
//@description Returns a list of installed sticker sets @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets //@description Returns premium stickers from regular sticker sets @limit The maximum number of stickers to be returned; 0-100
getInstalledStickerSets is_masks:Bool = StickerSets; getPremiumStickers limit:int32 = Stickers;
//@description Returns a list of archived sticker sets @is_masks Pass true to return mask stickers sets; pass false to return ordinary sticker sets @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100 //@description Returns a list of installed sticker sets @sticker_type Type of the sticker sets to return
getArchivedStickerSets is_masks:Bool offset_sticker_set_id:int64 limit:int32 = StickerSets; getInstalledStickerSets sticker_type:StickerType = StickerSets;
//@description Returns a list of archived sticker sets @sticker_type Type of the sticker sets to return @offset_sticker_set_id Identifier of the sticker set from which to return the result @limit The maximum number of sticker sets to return; up to 100
getArchivedStickerSets sticker_type:StickerType offset_sticker_set_id:int64 limit:int32 = StickerSets;
//@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib //@description Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib
//@sticker_type Type of the sticker sets to return
//@offset The offset from which to return the sticker sets; must be non-negative //@offset The offset from which to return the sticker sets; must be non-negative
//@limit The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached //@limit The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached
getTrendingStickerSets offset:int32 limit:int32 = TrendingStickerSets; getTrendingStickerSets sticker_type:StickerType offset:int32 limit:int32 = TrendingStickerSets;
//@description Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets @file_id File identifier //@description Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets @file_id File identifier
getAttachedStickerSets file_id:int32 = StickerSets; getAttachedStickerSets file_id:int32 = StickerSets;
@ -5882,8 +5957,8 @@ getStickerSet set_id:int64 = StickerSet;
//@description Searches for a sticker set by its name @name Name of the sticker set //@description Searches for a sticker set by its name @name Name of the sticker set
searchStickerSet name:string = StickerSet; searchStickerSet name:string = StickerSet;
//@description Searches for installed sticker sets by looking for specified query in their title and name @is_masks Pass true to return mask sticker sets; pass false to return ordinary sticker sets @query Query to search for @limit The maximum number of sticker sets to return //@description Searches for installed sticker sets by looking for specified query in their title and name @sticker_type Type of the sticker sets to search for @query Query to search for @limit The maximum number of sticker sets to return
searchInstalledStickerSets is_masks:Bool query:string limit:int32 = StickerSets; searchInstalledStickerSets sticker_type:StickerType query:string limit:int32 = StickerSets;
//@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for //@description Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results @query Query to search for
searchStickerSets query:string = StickerSets; searchStickerSets query:string = StickerSets;
@ -5894,13 +5969,13 @@ changeStickerSet set_id:int64 is_installed:Bool is_archived:Bool = Ok;
//@description Informs the server that some trending sticker sets have been viewed by the user @sticker_set_ids Identifiers of viewed trending sticker sets //@description Informs the server that some trending sticker sets have been viewed by the user @sticker_set_ids Identifiers of viewed trending sticker sets
viewTrendingStickerSets sticker_set_ids:vector<int64> = Ok; viewTrendingStickerSets sticker_set_ids:vector<int64> = Ok;
//@description Changes the order of installed sticker sets @is_masks Pass true to change the order of mask sticker sets; pass false to change the order of ordinary sticker sets @sticker_set_ids Identifiers of installed sticker sets in the new correct order //@description Changes the order of installed sticker sets @sticker_type Type of the sticker sets to reorder @sticker_set_ids Identifiers of installed sticker sets in the new correct order
reorderInstalledStickerSets is_masks:Bool sticker_set_ids:vector<int64> = Ok; reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int64> = Ok;
//@description Returns a list of recently used stickers @is_attached Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers //@description Returns a list of recently used stickers @is_attached Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers
getRecentStickers is_attached:Bool = Stickers; getRecentStickers is_attached:Bool = Stickers;
//@description Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list //@description Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers
//@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers @sticker Sticker file to add //@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers @sticker Sticker file to add
addRecentSticker is_attached:Bool sticker:InputFile = Stickers; addRecentSticker is_attached:Bool sticker:InputFile = Stickers;
@ -5913,7 +5988,7 @@ clearRecentStickers is_attached:Bool = Ok;
//@description Returns favorite stickers //@description Returns favorite stickers
getFavoriteStickers = Stickers; getFavoriteStickers = Stickers;
//@description Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list //@description Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers
//@sticker Sticker file to add //@sticker Sticker file to add
addFavoriteSticker sticker:InputFile = Ok; addFavoriteSticker sticker:InputFile = Ok;
@ -5929,12 +6004,12 @@ searchEmojis text:string exact_match:Bool input_language_codes:vector<string> =
//@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji //@description Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji @emoji The emoji
getAnimatedEmoji emoji:string = AnimatedEmoji; getAnimatedEmoji emoji:string = AnimatedEmoji;
//@description Returns all emojis, which has a corresponding animated emoji
getAllAnimatedEmojis = Emojis;
//@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested //@description Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation @language_code Language code for which the emoji replacements will be suggested
getEmojiSuggestionsUrl language_code:string = HttpUrl; getEmojiSuggestionsUrl language_code:string = HttpUrl;
//@description Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned @custom_emoji_ids Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously
getCustomEmojiStickers custom_emoji_ids:vector<int64> = Stickers;
//@description Returns saved animations //@description Returns saved animations
getSavedAnimations = Animations; getSavedAnimations = Animations;
@ -6202,7 +6277,7 @@ setUserPrivacySettingRules setting:UserPrivacySetting rules:userPrivacySettingRu
getUserPrivacySettingRules setting:UserPrivacySetting = UserPrivacySettingRules; getUserPrivacySettingRules setting:UserPrivacySetting = UserPrivacySettingRules;
//@description Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization //@description Returns the value of an option by its name. (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash"
//@name The name of the option //@name The name of the option
getOption name:string = OptionValue; getOption name:string = OptionValue;
@ -6217,8 +6292,8 @@ setAccountTtl ttl:accountTtl = Ok;
//@description Returns the period of inactivity after which the account of the current user will automatically be deleted //@description Returns the period of inactivity after which the account of the current user will automatically be deleted
getAccountTtl = AccountTtl; getAccountTtl = AccountTtl;
//@description Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword @reason The reason why the account was deleted; optional //@description Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account. Can be called before authorization when the current authorization state is authorizationStateWaitPassword @reason The reason why the account was deleted; optional @password The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week
deleteAccount reason:string = Ok; deleteAccount reason:string password:string = Ok;
//@description Removes a chat action bar without any other action @chat_id Chat identifier //@description Removes a chat action bar without any other action @chat_id Chat identifier
@ -6288,13 +6363,13 @@ setAutoDownloadSettings settings:autoDownloadSettings type:NetworkType = Ok;
getBankCardInfo bank_card_number:string = BankCardInfo; getBankCardInfo bank_card_number:string = BankCardInfo;
//@description Returns one of the available Telegram Passport elements @type Telegram Passport element type @password Password of the current user //@description Returns one of the available Telegram Passport elements @type Telegram Passport element type @password The 2-step verification password of the current user
getPassportElement type:PassportElementType password:string = PassportElement; getPassportElement type:PassportElementType password:string = PassportElement;
//@description Returns all available Telegram Passport elements @password Password of the current user //@description Returns all available Telegram Passport elements @password The 2-step verification password of the current user
getAllPassportElements password:string = PassportElements; getAllPassportElements password:string = PassportElements;
//@description Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first @element Input Telegram Passport element @password Password of the current user //@description Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first @element Input Telegram Passport element @password The 2-step verification password of the current user
setPassportElement element:InputPassportElement password:string = PassportElement; setPassportElement element:InputPassportElement password:string = PassportElement;
//@description Deletes a Telegram Passport element @type Element type //@description Deletes a Telegram Passport element @type Element type
@ -6332,7 +6407,7 @@ checkEmailAddressVerificationCode code:string = Ok;
//@description Returns a Telegram Passport authorization form for sharing data with a service @bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service //@description Returns a Telegram Passport authorization form for sharing data with a service @bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service
getPassportAuthorizationForm bot_user_id:int53 scope:string public_key:string nonce:string = PassportAuthorizationForm; getPassportAuthorizationForm bot_user_id:int53 scope:string public_key:string nonce:string = PassportAuthorizationForm;
//@description Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form @autorization_form_id Authorization form identifier @password Password of the current user //@description Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form @autorization_form_id Authorization form identifier @password The 2-step verification password of the current user
getPassportAuthorizationFormAvailableElements autorization_form_id:int32 password:string = PassportElementsWithErrors; getPassportAuthorizationFormAvailableElements autorization_form_id:int32 password:string = PassportElementsWithErrors;
//@description Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused //@description Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused
@ -6367,9 +6442,10 @@ checkStickerSetName name:string = CheckStickerSetNameResult;
//@user_id Sticker set owner; ignored for regular users //@user_id Sticker set owner; ignored for regular users
//@title Sticker set title; 1-64 characters //@title Sticker set title; 1-64 characters
//@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters //@name Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters
//@sticker_type Type of the stickers in the set
//@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown //@stickers List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown
//@source Source of the sticker set; may be empty if unknown //@source Source of the sticker set; may be empty if unknown
createNewStickerSet user_id:int53 title:string name:string stickers:vector<inputSticker> source:string = StickerSet; createNewStickerSet user_id:int53 title:string name:string sticker_type:StickerType stickers:vector<inputSticker> source:string = StickerSet;
//@description Adds a new sticker to a set; for bots only. Returns the sticker set //@description Adds a new sticker to a set; for bots only. Returns the sticker set
//@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set //@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set
@ -6399,7 +6475,7 @@ getPremiumLimit limit_type:PremiumLimitType = PremiumLimit;
getPremiumFeatures source:PremiumSource = PremiumFeatures; getPremiumFeatures source:PremiumSource = PremiumFeatures;
//@description Returns examples of premium stickers for demonstration purposes //@description Returns examples of premium stickers for demonstration purposes
getPremiumStickers = Stickers; getPremiumStickerExamples = Stickers;
//@description Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen @feature The viewed premium feature //@description Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen @feature The viewed premium feature
viewPremiumFeature feature:PremiumFeature = Ok; viewPremiumFeature feature:PremiumFeature = Ok;
@ -6410,6 +6486,15 @@ clickPremiumSubscriptionButton = Ok;
//@description Returns state of Telegram Premium subscription and promotion videos for Premium features //@description Returns state of Telegram Premium subscription and promotion videos for Premium features
getPremiumState = PremiumState; getPremiumState = PremiumState;
//@description Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase @purpose Transaction purpose
canPurchasePremium purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through App Store. For official applications only @receipt App Store receipt @purpose Transaction purpose
assignAppStoreTransaction receipt:bytes purpose:StorePaymentPurpose = Ok;
//@description Informs server about a purchase through Google Play. For official applications only @package_name Application package name @store_product_id Identifier of the purchased store product @purchase_token Google Play purchase token @purpose Transaction purpose
assignGooglePlayTransaction package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok;
//@description Accepts Telegram terms of services @terms_of_service_id Terms of service identifier //@description Accepts Telegram terms of services @terms_of_service_id Terms of service identifier
acceptTermsOfService terms_of_service_id:string = Ok; acceptTermsOfService terms_of_service_id:string = Ok;