Update to TDLib 1.8.23

This commit is contained in:
c0re100 2023-12-30 05:43:03 +08:00
parent af41176160
commit e30af65ec7
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1865 additions and 587 deletions

View file

@ -1313,7 +1313,7 @@ type GetRepliedMessageRequest struct {
MessageId int64 `json:"message_id"`
}
// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without non-bundled replied message respectively
// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic messages without non-bundled replied message respectively
func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) {
result, err := client.Send(Request{
meta: meta{
@ -1784,6 +1784,35 @@ func (client *Client) GetChatSimilarChatCount(req *GetChatSimilarChatCountReques
return UnmarshalCount(result.Data)
}
type OpenChatSimilarChatRequest struct {
// Identifier of the original chat, which similar chats were requested
ChatId int64 `json:"chat_id"`
// Identifier of the opened chat
OpenedChatId int64 `json:"opened_chat_id"`
}
// Informs TDLib that a chat was opened from the list of similar chats. The method is independent from openChat and closeChat methods
func (client *Client) OpenChatSimilarChat(req *OpenChatSimilarChatRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "openChatSimilarChat",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"opened_chat_id": req.OpenedChatId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetTopChatsRequest struct {
// Category of chats to be returned
Category TopChatCategory `json:"category"`
@ -4414,6 +4443,41 @@ func (client *Client) RemoveMessageReaction(req *RemoveMessageReactionRequest) (
return UnmarshalOk(result.Data)
}
type SetMessageReactionsRequest struct {
// Identifier of the chat to which the message belongs
ChatId int64 `json:"chat_id"`
// Identifier of the message
MessageId int64 `json:"message_id"`
// Types of the reaction to set
ReactionTypes []ReactionType `json:"reaction_types"`
// Pass true if the reactions are added with a big animation
IsBig bool `json:"is_big"`
}
// Sets reactions on a message; for bots only
func (client *Client) SetMessageReactions(req *SetMessageReactionsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setMessageReactions",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_id": req.MessageId,
"reaction_types": req.ReactionTypes,
"is_big": req.IsBig,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetMessageAddedReactionsRequest struct {
// Identifier of the chat to which the message belongs
ChatId int64 `json:"chat_id"`
@ -5105,30 +5169,30 @@ func (client *Client) GetLoginUrl(req *GetLoginUrlRequest) (*HttpUrl, error) {
return UnmarshalHttpUrl(result.Data)
}
type ShareUserWithBotRequest struct {
type ShareUsersWithBotRequest struct {
// Identifier of the chat with the bot
ChatId int64 `json:"chat_id"`
// Identifier of the message with the button
MessageId int64 `json:"message_id"`
// Identifier of the button
ButtonId int32 `json:"button_id"`
// Identifier of the shared user
SharedUserId int64 `json:"shared_user_id"`
// Pass true to check that the user can be shared by the button instead of actually sharing them
// Identifiers of the shared users
SharedUserIds []int64 `json:"shared_user_ids"`
// Pass true to check that the users can be shared by the button instead of actually sharing them
OnlyCheck bool `json:"only_check"`
}
// Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot
func (client *Client) ShareUserWithBot(req *ShareUserWithBotRequest) (*Ok, error) {
// Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot
func (client *Client) ShareUsersWithBot(req *ShareUsersWithBotRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "shareUserWithBot",
Type: "shareUsersWithBot",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"message_id": req.MessageId,
"button_id": req.ButtonId,
"shared_user_id": req.SharedUserId,
"shared_user_ids": req.SharedUserIds,
"only_check": req.OnlyCheck,
},
})
@ -6101,6 +6165,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypePremiumFeatures:
return UnmarshalInternalLinkTypePremiumFeatures(result.Data)
case TypeInternalLinkTypePremiumGift:
return UnmarshalInternalLinkTypePremiumGift(result.Data)
case TypeInternalLinkTypePremiumGiftCode:
return UnmarshalInternalLinkTypePremiumGiftCode(result.Data)
@ -7235,13 +7302,13 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) {
type SetChatAccentColorRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the accent color to use
// Identifier of the accent color to use. The chat must have at least accentColor.min_chat_boost_level boost level to pass the corresponding color
AccentColorId int32 `json:"accent_color_id"`
// Identifier of a custom emoji to be shown on the reply header background; 0 if none
// Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
}
// Changes accent color and background custom emoji of a chat. Supported only for channels with getOption("channel_custom_accent_color_boost_level_min") boost level. Requires can_change_info administrator right
// Changes accent color and background custom emoji of a chat. Requires can_change_info administrator right
func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -7264,6 +7331,38 @@ func (client *Client) SetChatAccentColor(req *SetChatAccentColorRequest) (*Ok, e
return UnmarshalOk(result.Data)
}
type SetChatProfileAccentColorRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the accent color to use for profile; pass -1 if none. The chat must have at least profileAccentColor.min_chat_boost_level boost level to pass the corresponding color
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
// Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
}
// Changes accent color and background custom emoji for profile of a chat. Requires can_change_info administrator right
func (client *Client) SetChatProfileAccentColor(req *SetChatProfileAccentColorRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setChatProfileAccentColor",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"profile_accent_color_id": req.ProfileAccentColorId,
"profile_background_custom_emoji_id": req.ProfileBackgroundCustomEmojiId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetChatMessageAutoDeleteTimeRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -7293,6 +7392,35 @@ func (client *Client) SetChatMessageAutoDeleteTime(req *SetChatMessageAutoDelete
return UnmarshalOk(result.Data)
}
type SetChatEmojiStatusRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// New emoji status; pass null to remove emoji status
EmojiStatus *EmojiStatus `json:"emoji_status"`
}
// Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. Requires can_change_info administrator right
func (client *Client) SetChatEmojiStatus(req *SetChatEmojiStatusRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setChatEmojiStatus",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"emoji_status": req.EmojiStatus,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetChatPermissionsRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -7325,17 +7453,17 @@ func (client *Client) SetChatPermissions(req *SetChatPermissionsRequest) (*Ok, e
type SetChatBackgroundRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// The input background to use; pass null to create a new filled background
// The input background to use; pass null to create a new filled or chat theme background
Background InputBackground `json:"background"`
// Background type; pass null to use default background type for the chosen background
// Background type; pass null to use default background type for the chosen background; backgroundTypeChatTheme isn't supported for private and secret chats. Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to check whether the background type can be set in the boosted chat
Type BackgroundType `json:"type"`
// Dimming of the background in dark themes, as a percentage; 0-100
// Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background
DarkThemeDimming int32 `json:"dark_theme_dimming"`
// Pass true to set background only for self; pass false to set background for both chat users. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious
// Pass true to set background only for self; pass false to set background for all chat users. Always false for backgrounds set in boosted chats. Background can be set for both users only by Telegram Premium users and if set background isn't of the type inputBackgroundPrevious
OnlyForSelf bool `json:"only_for_self"`
}
// Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users
// Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and can_change_info administrator right
func (client *Client) SetChatBackground(req *SetChatBackgroundRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -9128,31 +9256,34 @@ func (client *Client) SetStoryReaction(req *SetStoryReactionRequest) (*Ok, error
return UnmarshalOk(result.Data)
}
type GetStoryViewersRequest struct {
type GetStoryInteractionsRequest struct {
// Story identifier
StoryId int32 `json:"story_id"`
// Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers
// Query to search for in names, usernames and titles; may be empty to get all relevant interactions
Query string `json:"query"`
// Pass true to get only contacts; pass false to get all relevant viewers
// Pass true to get only interactions by contacts; pass false to get all relevant interactions
OnlyContacts bool `json:"only_contacts"`
// Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date
// Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date
PreferForwards bool `json:"prefer_forwards"`
// Pass true to get interactions with reaction first; pass false to get interactions sorted just by interaction date. Ignored if prefer_forwards == true
PreferWithReaction bool `json:"prefer_with_reaction"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
Offset string `json:"offset"`
// The maximum number of story viewers to return
// The maximum number of story interactions to return
Limit int32 `json:"limit"`
}
// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user
func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewers, error) {
// Returns interactions with a story. The method can be called only for stories posted on behalf of the current user
func (client *Client) GetStoryInteractions(req *GetStoryInteractionsRequest) (*StoryInteractions, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getStoryViewers",
Type: "getStoryInteractions",
},
Data: map[string]interface{}{
"story_id": req.StoryId,
"query": req.Query,
"only_contacts": req.OnlyContacts,
"prefer_forwards": req.PreferForwards,
"prefer_with_reaction": req.PreferWithReaction,
"offset": req.Offset,
"limit": req.Limit,
@ -9166,7 +9297,48 @@ func (client *Client) GetStoryViewers(req *GetStoryViewersRequest) (*StoryViewer
return nil, buildResponseError(result.Data)
}
return UnmarshalStoryViewers(result.Data)
return UnmarshalStoryInteractions(result.Data)
}
type GetChatStoryInteractionsRequest struct {
// The identifier of the sender of the story
StorySenderChatId int64 `json:"story_sender_chat_id"`
// Story identifier
StoryId int32 `json:"story_id"`
// Pass the default heart reaction or a suggested reaction type to receive only interactions with the specified reaction type; pass null to receive all interactions
ReactionType ReactionType `json:"reaction_type"`
// Pass true to get forwards and reposts first, then reactions, then other views; pass false to get interactions sorted just by interaction date
PreferForwards bool `json:"prefer_forwards"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
Offset string `json:"offset"`
// The maximum number of story interactions to return
Limit int32 `json:"limit"`
}
// Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat
func (client *Client) GetChatStoryInteractions(req *GetChatStoryInteractionsRequest) (*StoryInteractions, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getChatStoryInteractions",
},
Data: map[string]interface{}{
"story_sender_chat_id": req.StorySenderChatId,
"story_id": req.StoryId,
"reaction_type": req.ReactionType,
"prefer_forwards": req.PreferForwards,
"offset": req.Offset,
"limit": req.Limit,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalStoryInteractions(result.Data)
}
type ReportStoryRequest struct {
@ -9235,7 +9407,7 @@ type GetStoryPublicForwardsRequest struct {
}
// Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib
func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) (*StoryPublicForwards, error) {
func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest) (*PublicForwards, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getStoryPublicForwards",
@ -9255,7 +9427,52 @@ func (client *Client) GetStoryPublicForwards(req *GetStoryPublicForwardsRequest)
return nil, buildResponseError(result.Data)
}
return UnmarshalStoryPublicForwards(result.Data)
return UnmarshalPublicForwards(result.Data)
}
type GetChatBoostLevelFeaturesRequest struct {
// Chat boost level
Level int32 `json:"level"`
}
// Returns list of features available on the specific chat boost level; this is an offline request
func (client *Client) GetChatBoostLevelFeatures(req *GetChatBoostLevelFeaturesRequest) (*ChatBoostLevelFeatures, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getChatBoostLevelFeatures",
},
Data: map[string]interface{}{
"level": req.Level,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalChatBoostLevelFeatures(result.Data)
}
// Returns list of features available on the first 10 chat boost levels; this is an offline request
func (client *Client) GetChatBoostFeatures() (*ChatBoostFeatures, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getChatBoostFeatures",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalChatBoostFeatures(result.Data)
}
// Returns the list of available chat boost slots for the current user
@ -9506,7 +9723,7 @@ func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAt
return UnmarshalOk(result.Data)
}
// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list
// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for self status
func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
@ -9525,7 +9742,7 @@ func (client *Client) GetThemedEmojiStatuses() (*EmojiStatuses, error) {
return UnmarshalEmojiStatuses(result.Data)
}
// Returns recent emoji statuses
// Returns recent emoji statuses for self status
func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
@ -9544,7 +9761,7 @@ func (client *Client) GetRecentEmojiStatuses() (*EmojiStatuses, error) {
return UnmarshalEmojiStatuses(result.Data)
}
// Returns default emoji statuses
// Returns default emoji statuses for self status
func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
@ -9563,7 +9780,7 @@ func (client *Client) GetDefaultEmojiStatuses() (*EmojiStatuses, error) {
return UnmarshalEmojiStatuses(result.Data)
}
// Clears the list of recently used emoji statuses
// Clears the list of recently used emoji statuses for self status
func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -9582,6 +9799,63 @@ func (client *Client) ClearRecentEmojiStatuses() (*Ok, error) {
return UnmarshalOk(result.Data)
}
// Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats
func (client *Client) GetThemedChatEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getThemedChatEmojiStatuses",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojiStatuses(result.Data)
}
// Returns default emoji statuses for chats
func (client *Client) GetDefaultChatEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getDefaultChatEmojiStatuses",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojiStatuses(result.Data)
}
// Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with is_allowed_as_chat_emoji_status == true
func (client *Client) GetDisallowedChatEmojiStatuses() (*EmojiStatuses, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getDisallowedChatEmojiStatuses",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalEmojiStatuses(result.Data)
}
type DownloadFileRequest struct {
// Identifier of the file to download
FileId int32 `json:"file_id"`
@ -13368,7 +13642,7 @@ func (client *Client) DeleteProfilePhoto(req *DeleteProfilePhotoRequest) (*Ok, e
type SetAccentColorRequest struct {
// Identifier of the accent color to use
AccentColorId int32 `json:"accent_color_id"`
// Identifier of a custom emoji to be shown on the reply header background; 0 if none
// Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none
BackgroundCustomEmojiId JsonInt64 `json:"background_custom_emoji_id"`
}
@ -13397,7 +13671,7 @@ func (client *Client) SetAccentColor(req *SetAccentColorRequest) (*Ok, error) {
type SetProfileAccentColorRequest struct {
// Identifier of the accent color to use for profile; pass -1 if none
ProfileAccentColorId int32 `json:"profile_accent_color_id"`
// Identifier of a custom emoji to be shown in the on the user's profile photo background; 0 if none
// Identifier of a custom emoji to be shown on the user's profile photo background; 0 if none
ProfileBackgroundCustomEmojiId JsonInt64 `json:"profile_background_custom_emoji_id"`
}
@ -15289,36 +15563,10 @@ func (client *Client) GetSupportUser() (*User, error) {
return UnmarshalUser(result.Data)
}
type GetBackgroundsRequest struct {
// Pass true to order returned backgrounds for a dark theme
ForDarkTheme bool `json:"for_dark_theme"`
}
// Returns backgrounds installed by the user
func (client *Client) GetBackgrounds(req *GetBackgroundsRequest) (*Backgrounds, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getBackgrounds",
},
Data: map[string]interface{}{
"for_dark_theme": req.ForDarkTheme,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalBackgrounds(result.Data)
}
type GetBackgroundUrlRequest struct {
// Background name
Name string `json:"name"`
// Background type
// Background type; backgroundTypeChatTheme isn't supported
Type BackgroundType `json:"type"`
}
@ -15370,20 +15618,20 @@ func (client *Client) SearchBackground(req *SearchBackgroundRequest) (*Backgroun
return UnmarshalBackground(result.Data)
}
type SetBackgroundRequest struct {
// The input background to use; pass null to create a new filled background or to remove the current background
type SetDefaultBackgroundRequest struct {
// The input background to use; pass null to create a new filled background
Background InputBackground `json:"background"`
// Background type; pass null to use the default type of the remote background or to remove the current background
// Background type; pass null to use the default type of the remote background; backgroundTypeChatTheme isn't supported
Type BackgroundType `json:"type"`
// Pass true if the background is changed for a dark theme
// Pass true if the background is set for a dark theme
ForDarkTheme bool `json:"for_dark_theme"`
}
// Changes the background selected by the user; adds background to the list of installed backgrounds
func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, error) {
// Sets default background for chats; adds the background to the list of installed backgrounds
func (client *Client) SetDefaultBackground(req *SetDefaultBackgroundRequest) (*Background, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setBackground",
Type: "setDefaultBackground",
},
Data: map[string]interface{}{
"background": req.Background,
@ -15402,16 +15650,68 @@ func (client *Client) SetBackground(req *SetBackgroundRequest) (*Background, err
return UnmarshalBackground(result.Data)
}
type RemoveBackgroundRequest struct {
type DeleteDefaultBackgroundRequest struct {
// Pass true if the background is deleted for a dark theme
ForDarkTheme bool `json:"for_dark_theme"`
}
// Deletes default background for chats
func (client *Client) DeleteDefaultBackground(req *DeleteDefaultBackgroundRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "deleteDefaultBackground",
},
Data: map[string]interface{}{
"for_dark_theme": req.ForDarkTheme,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetInstalledBackgroundsRequest struct {
// Pass true to order returned backgrounds for a dark theme
ForDarkTheme bool `json:"for_dark_theme"`
}
// Returns backgrounds installed by the user
func (client *Client) GetInstalledBackgrounds(req *GetInstalledBackgroundsRequest) (*Backgrounds, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getInstalledBackgrounds",
},
Data: map[string]interface{}{
"for_dark_theme": req.ForDarkTheme,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalBackgrounds(result.Data)
}
type RemoveInstalledBackgroundRequest struct {
// The background identifier
BackgroundId JsonInt64 `json:"background_id"`
}
// Removes background from the list of installed backgrounds
func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error) {
func (client *Client) RemoveInstalledBackground(req *RemoveInstalledBackgroundRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "removeBackground",
Type: "removeInstalledBackground",
},
Data: map[string]interface{}{
"background_id": req.BackgroundId,
@ -15429,10 +15729,10 @@ func (client *Client) RemoveBackground(req *RemoveBackgroundRequest) (*Ok, error
}
// Resets list of installed backgrounds to its default value
func (client *Client) ResetBackgrounds() (*Ok, error) {
func (client *Client) ResetInstalledBackgrounds() (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "resetBackgrounds",
Type: "resetInstalledBackgrounds",
},
Data: map[string]interface{}{},
})
@ -16256,12 +16556,12 @@ type GetMessagePublicForwardsRequest struct {
MessageId int64 `json:"message_id"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
Offset string `json:"offset"`
// The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
// The maximum number of messages and stories to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit
Limit int32 `json:"limit"`
}
// Returns forwarded copies of a channel message to different public channels. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages is chosen by TDLib
func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*FoundMessages, error) {
// Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used only if message.can_get_statistics == true. For optimal performance, the number of returned messages and stories is chosen by TDLib
func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequest) (*PublicForwards, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getMessagePublicForwards",
@ -16281,7 +16581,7 @@ func (client *Client) GetMessagePublicForwards(req *GetMessagePublicForwardsRequ
return nil, buildResponseError(result.Data)
}
return UnmarshalFoundMessages(result.Data)
return UnmarshalPublicForwards(result.Data)
}
type GetStoryStatisticsRequest struct {
@ -18024,7 +18324,7 @@ func (client *Client) LaunchPrepaidPremiumGiveaway(req *LaunchPrepaidPremiumGive
type GetPremiumGiveawayInfoRequest struct {
// Identifier of the channel chat which started the giveaway
ChatId int64 `json:"chat_id"`
// Identifier of the giveaway message in the chat
// Identifier of the giveaway or a giveaway winners message in the chat
MessageId int64 `json:"message_id"`
}
@ -18463,32 +18763,6 @@ func (client *Client) GetApplicationConfig() (JsonValue, error) {
}
}
type AddApplicationChangelogRequest struct {
// The previous application version
PreviousApplicationVersion string `json:"previous_application_version"`
}
// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed
func (client *Client) AddApplicationChangelog(req *AddApplicationChangelogRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "addApplicationChangelog",
},
Data: map[string]interface{}{
"previous_application_version": req.PreviousApplicationVersion,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SaveApplicationLogEventRequest struct {
// Event type
Type string `json:"type"`
@ -19416,11 +19690,8 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateChatPhoto:
return UnmarshalUpdateChatPhoto(result.Data)
case TypeUpdateChatAccentColor:
return UnmarshalUpdateChatAccentColor(result.Data)
case TypeUpdateChatBackgroundCustomEmoji:
return UnmarshalUpdateChatBackgroundCustomEmoji(result.Data)
case TypeUpdateChatAccentColors:
return UnmarshalUpdateChatAccentColors(result.Data)
case TypeUpdateChatPermissions:
return UnmarshalUpdateChatPermissions(result.Data)
@ -19446,6 +19717,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateChatDraftMessage:
return UnmarshalUpdateChatDraftMessage(result.Data)
case TypeUpdateChatEmojiStatus:
return UnmarshalUpdateChatEmojiStatus(result.Data)
case TypeUpdateChatMessageSender:
return UnmarshalUpdateChatMessageSender(result.Data)
@ -19641,8 +19915,8 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(result.Data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(result.Data)
case TypeUpdateDefaultBackground:
return UnmarshalUpdateDefaultBackground(result.Data)
case TypeUpdateChatThemes:
return UnmarshalUpdateChatThemes(result.Data)
@ -19740,6 +20014,12 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateChatBoost:
return UnmarshalUpdateChatBoost(result.Data)
case TypeUpdateMessageReaction:
return UnmarshalUpdateMessageReaction(result.Data)
case TypeUpdateMessageReactions:
return UnmarshalUpdateMessageReactions(result.Data)
default:
return nil, errors.New("invalid type")
}

File diff suppressed because it is too large Load diff

View file

@ -1477,8 +1477,8 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro
case TypeKeyboardButtonTypeRequestPoll:
return UnmarshalKeyboardButtonTypeRequestPoll(data)
case TypeKeyboardButtonTypeRequestUser:
return UnmarshalKeyboardButtonTypeRequestUser(data)
case TypeKeyboardButtonTypeRequestUsers:
return UnmarshalKeyboardButtonTypeRequestUsers(data)
case TypeKeyboardButtonTypeRequestChat:
return UnmarshalKeyboardButtonTypeRequestChat(data)
@ -2541,11 +2541,14 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessagePremiumGiveawayCompleted:
return UnmarshalMessagePremiumGiveawayCompleted(data)
case TypeMessagePremiumGiveawayWinners:
return UnmarshalMessagePremiumGiveawayWinners(data)
case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data)
case TypeMessageUserShared:
return UnmarshalMessageUserShared(data)
case TypeMessageUsersShared:
return UnmarshalMessageUsersShared(data)
case TypeMessageChatShared:
return UnmarshalMessageChatShared(data)
@ -3084,6 +3087,9 @@ func UnmarshalStoryAreaType(data json.RawMessage) (StoryAreaType, error) {
case TypeStoryAreaTypeSuggestedReaction:
return UnmarshalStoryAreaTypeSuggestedReaction(data)
case TypeStoryAreaTypeMessage:
return UnmarshalStoryAreaTypeMessage(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -3124,6 +3130,9 @@ func UnmarshalInputStoryAreaType(data json.RawMessage) (InputStoryAreaType, erro
case TypeInputStoryAreaTypeSuggestedReaction:
return UnmarshalInputStoryAreaTypeSuggestedReaction(data)
case TypeInputStoryAreaTypeMessage:
return UnmarshalInputStoryAreaTypeMessage(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -3282,7 +3291,7 @@ func UnmarshalListOfStoryOrigin(dataList []json.RawMessage) ([]StoryOrigin, erro
return list, nil
}
func UnmarshalStoryPublicForward(data json.RawMessage) (StoryPublicForward, error) {
func UnmarshalStoryInteractionType(data json.RawMessage) (StoryInteractionType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
@ -3291,22 +3300,59 @@ func UnmarshalStoryPublicForward(data json.RawMessage) (StoryPublicForward, erro
}
switch meta.Type {
case TypeStoryPublicForwardMessage:
return UnmarshalStoryPublicForwardMessage(data)
case TypeStoryInteractionTypeView:
return UnmarshalStoryInteractionTypeView(data)
case TypeStoryPublicForwardStory:
return UnmarshalStoryPublicForwardStory(data)
case TypeStoryInteractionTypeForward:
return UnmarshalStoryInteractionTypeForward(data)
case TypeStoryInteractionTypeRepost:
return UnmarshalStoryInteractionTypeRepost(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfStoryPublicForward(dataList []json.RawMessage) ([]StoryPublicForward, error) {
list := []StoryPublicForward{}
func UnmarshalListOfStoryInteractionType(dataList []json.RawMessage) ([]StoryInteractionType, error) {
list := []StoryInteractionType{}
for _, data := range dataList {
entity, err := UnmarshalStoryPublicForward(data)
entity, err := UnmarshalStoryInteractionType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalPublicForward(data json.RawMessage) (PublicForward, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypePublicForwardMessage:
return UnmarshalPublicForwardMessage(data)
case TypePublicForwardStory:
return UnmarshalPublicForwardStory(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfPublicForward(dataList []json.RawMessage) ([]PublicForward, error) {
list := []PublicForward{}
for _, data := range dataList {
entity, err := UnmarshalPublicForward(data)
if err != nil {
return nil, err
}
@ -3960,9 +4006,15 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventAvailableReactionsChanged:
return UnmarshalChatEventAvailableReactionsChanged(data)
case TypeChatEventBackgroundChanged:
return UnmarshalChatEventBackgroundChanged(data)
case TypeChatEventDescriptionChanged:
return UnmarshalChatEventDescriptionChanged(data)
case TypeChatEventEmojiStatusChanged:
return UnmarshalChatEventEmojiStatusChanged(data)
case TypeChatEventLinkedChatChanged:
return UnmarshalChatEventLinkedChatChanged(data)
@ -3996,8 +4048,8 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventAccentColorChanged:
return UnmarshalChatEventAccentColorChanged(data)
case TypeChatEventBackgroundCustomEmojiChanged:
return UnmarshalChatEventBackgroundCustomEmojiChanged(data)
case TypeChatEventProfileAccentColorChanged:
return UnmarshalChatEventProfileAccentColorChanged(data)
case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data)
@ -4564,6 +4616,9 @@ func UnmarshalBackgroundType(data json.RawMessage) (BackgroundType, error) {
case TypeBackgroundTypeFill:
return UnmarshalBackgroundTypeFill(data)
case TypeBackgroundTypeChatTheme:
return UnmarshalBackgroundTypeChatTheme(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -5564,6 +5619,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypePremiumFeatures:
return UnmarshalInternalLinkTypePremiumFeatures(data)
case TypeInternalLinkTypePremiumGift:
return UnmarshalInternalLinkTypePremiumGift(data)
case TypeInternalLinkTypePremiumGiftCode:
return UnmarshalInternalLinkTypePremiumGiftCode(data)
@ -6041,6 +6099,9 @@ func UnmarshalSuggestedAction(data json.RawMessage) (SuggestedAction, error) {
case TypeSuggestedActionSubscribeToAnnualPremium:
return UnmarshalSuggestedActionSubscribeToAnnualPremium(data)
case TypeSuggestedActionGiftPremiumForChristmas:
return UnmarshalSuggestedActionGiftPremiumForChristmas(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -6376,11 +6437,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatPhoto:
return UnmarshalUpdateChatPhoto(data)
case TypeUpdateChatAccentColor:
return UnmarshalUpdateChatAccentColor(data)
case TypeUpdateChatBackgroundCustomEmoji:
return UnmarshalUpdateChatBackgroundCustomEmoji(data)
case TypeUpdateChatAccentColors:
return UnmarshalUpdateChatAccentColors(data)
case TypeUpdateChatPermissions:
return UnmarshalUpdateChatPermissions(data)
@ -6406,6 +6464,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatDraftMessage:
return UnmarshalUpdateChatDraftMessage(data)
case TypeUpdateChatEmojiStatus:
return UnmarshalUpdateChatEmojiStatus(data)
case TypeUpdateChatMessageSender:
return UnmarshalUpdateChatMessageSender(data)
@ -6601,8 +6662,8 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(data)
case TypeUpdateDefaultBackground:
return UnmarshalUpdateDefaultBackground(data)
case TypeUpdateChatThemes:
return UnmarshalUpdateChatThemes(data)
@ -6700,6 +6761,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateChatBoost:
return UnmarshalUpdateChatBoost(data)
case TypeUpdateMessageReaction:
return UnmarshalUpdateMessageReaction(data)
case TypeUpdateMessageReactions:
return UnmarshalUpdateMessageReactions(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -9004,8 +9071,8 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt
return &resp, err
}
func UnmarshalKeyboardButtonTypeRequestUser(data json.RawMessage) (*KeyboardButtonTypeRequestUser, error) {
var resp KeyboardButtonTypeRequestUser
func UnmarshalKeyboardButtonTypeRequestUsers(data json.RawMessage) (*KeyboardButtonTypeRequestUsers, error) {
var resp KeyboardButtonTypeRequestUsers
err := json.Unmarshal(data, &resp)
@ -10972,6 +11039,14 @@ func UnmarshalMessagePremiumGiveawayCompleted(data json.RawMessage) (*MessagePre
return &resp, err
}
func UnmarshalMessagePremiumGiveawayWinners(data json.RawMessage) (*MessagePremiumGiveawayWinners, error) {
var resp MessagePremiumGiveawayWinners
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactRegistered, error) {
var resp MessageContactRegistered
@ -10980,8 +11055,8 @@ func UnmarshalMessageContactRegistered(data json.RawMessage) (*MessageContactReg
return &resp, err
}
func UnmarshalMessageUserShared(data json.RawMessage) (*MessageUserShared, error) {
var resp MessageUserShared
func UnmarshalMessageUsersShared(data json.RawMessage) (*MessageUsersShared, error) {
var resp MessageUsersShared
err := json.Unmarshal(data, &resp)
@ -11812,22 +11887,6 @@ func UnmarshalEmojiCategoryTypeChatPhoto(data json.RawMessage) (*EmojiCategoryTy
return &resp, err
}
func UnmarshalStoryViewer(data json.RawMessage) (*StoryViewer, error) {
var resp StoryViewer
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryViewers(data json.RawMessage) (*StoryViewers, error) {
var resp StoryViewers
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryAreaPosition(data json.RawMessage) (*StoryAreaPosition, error) {
var resp StoryAreaPosition
@ -11860,6 +11919,14 @@ func UnmarshalStoryAreaTypeSuggestedReaction(data json.RawMessage) (*StoryAreaTy
return &resp, err
}
func UnmarshalStoryAreaTypeMessage(data json.RawMessage) (*StoryAreaTypeMessage, error) {
var resp StoryAreaTypeMessage
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryArea(data json.RawMessage) (*StoryArea, error) {
var resp StoryArea
@ -11900,6 +11967,14 @@ func UnmarshalInputStoryAreaTypeSuggestedReaction(data json.RawMessage) (*InputS
return &resp, err
}
func UnmarshalInputStoryAreaTypeMessage(data json.RawMessage) (*InputStoryAreaTypeMessage, error) {
var resp InputStoryAreaTypeMessage
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputStoryArea(data json.RawMessage) (*InputStoryArea, error) {
var resp InputStoryArea
@ -12052,24 +12127,80 @@ func UnmarshalChatActiveStories(data json.RawMessage) (*ChatActiveStories, error
return &resp, err
}
func UnmarshalStoryPublicForwardMessage(data json.RawMessage) (*StoryPublicForwardMessage, error) {
var resp StoryPublicForwardMessage
func UnmarshalStoryInteractionTypeView(data json.RawMessage) (*StoryInteractionTypeView, error) {
var resp StoryInteractionTypeView
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryPublicForwardStory(data json.RawMessage) (*StoryPublicForwardStory, error) {
var resp StoryPublicForwardStory
func UnmarshalStoryInteractionTypeForward(data json.RawMessage) (*StoryInteractionTypeForward, error) {
var resp StoryInteractionTypeForward
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryPublicForwards(data json.RawMessage) (*StoryPublicForwards, error) {
var resp StoryPublicForwards
func UnmarshalStoryInteractionTypeRepost(data json.RawMessage) (*StoryInteractionTypeRepost, error) {
var resp StoryInteractionTypeRepost
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInteraction(data json.RawMessage) (*StoryInteraction, error) {
var resp StoryInteraction
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStoryInteractions(data json.RawMessage) (*StoryInteractions, error) {
var resp StoryInteractions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPublicForwardMessage(data json.RawMessage) (*PublicForwardMessage, error) {
var resp PublicForwardMessage
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPublicForwardStory(data json.RawMessage) (*PublicForwardStory, error) {
var resp PublicForwardStory
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPublicForwards(data json.RawMessage) (*PublicForwards, error) {
var resp PublicForwards
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatBoostLevelFeatures(data json.RawMessage) (*ChatBoostLevelFeatures, error) {
var resp ChatBoostLevelFeatures
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatBoostFeatures(data json.RawMessage) (*ChatBoostFeatures, error) {
var resp ChatBoostFeatures
err := json.Unmarshal(data, &resp)
@ -13028,6 +13159,14 @@ func UnmarshalChatEventAvailableReactionsChanged(data json.RawMessage) (*ChatEve
return &resp, err
}
func UnmarshalChatEventBackgroundChanged(data json.RawMessage) (*ChatEventBackgroundChanged, error) {
var resp ChatEventBackgroundChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescriptionChanged, error) {
var resp ChatEventDescriptionChanged
@ -13036,6 +13175,14 @@ func UnmarshalChatEventDescriptionChanged(data json.RawMessage) (*ChatEventDescr
return &resp, err
}
func UnmarshalChatEventEmojiStatusChanged(data json.RawMessage) (*ChatEventEmojiStatusChanged, error) {
var resp ChatEventEmojiStatusChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventLinkedChatChanged(data json.RawMessage) (*ChatEventLinkedChatChanged, error) {
var resp ChatEventLinkedChatChanged
@ -13124,8 +13271,8 @@ func UnmarshalChatEventAccentColorChanged(data json.RawMessage) (*ChatEventAccen
return &resp, err
}
func UnmarshalChatEventBackgroundCustomEmojiChanged(data json.RawMessage) (*ChatEventBackgroundCustomEmojiChanged, error) {
var resp ChatEventBackgroundCustomEmojiChanged
func UnmarshalChatEventProfileAccentColorChanged(data json.RawMessage) (*ChatEventProfileAccentColorChanged, error) {
var resp ChatEventProfileAccentColorChanged
err := json.Unmarshal(data, &resp)
@ -13988,6 +14135,14 @@ func UnmarshalBackgroundTypeFill(data json.RawMessage) (*BackgroundTypeFill, err
return &resp, err
}
func UnmarshalBackgroundTypeChatTheme(data json.RawMessage) (*BackgroundTypeChatTheme, error) {
var resp BackgroundTypeChatTheme
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputBackgroundLocal(data json.RawMessage) (*InputBackgroundLocal, error) {
var resp InputBackgroundLocal
@ -15364,6 +15519,14 @@ func UnmarshalInternalLinkTypePremiumFeatures(data json.RawMessage) (*InternalLi
return &resp, err
}
func UnmarshalInternalLinkTypePremiumGift(data json.RawMessage) (*InternalLinkTypePremiumGift, error) {
var resp InternalLinkTypePremiumGift
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypePremiumGiftCode(data json.RawMessage) (*InternalLinkTypePremiumGiftCode, error) {
var resp InternalLinkTypePremiumGiftCode
@ -16124,6 +16287,14 @@ func UnmarshalSuggestedActionSubscribeToAnnualPremium(data json.RawMessage) (*Su
return &resp, err
}
func UnmarshalSuggestedActionGiftPremiumForChristmas(data json.RawMessage) (*SuggestedActionGiftPremiumForChristmas, error) {
var resp SuggestedActionGiftPremiumForChristmas
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCount(data json.RawMessage) (*Count, error) {
var resp Count
@ -16556,16 +16727,8 @@ func UnmarshalUpdateChatPhoto(data json.RawMessage) (*UpdateChatPhoto, error) {
return &resp, err
}
func UnmarshalUpdateChatAccentColor(data json.RawMessage) (*UpdateChatAccentColor, error) {
var resp UpdateChatAccentColor
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateChatBackgroundCustomEmoji(data json.RawMessage) (*UpdateChatBackgroundCustomEmoji, error) {
var resp UpdateChatBackgroundCustomEmoji
func UnmarshalUpdateChatAccentColors(data json.RawMessage) (*UpdateChatAccentColors, error) {
var resp UpdateChatAccentColors
err := json.Unmarshal(data, &resp)
@ -16636,6 +16799,14 @@ func UnmarshalUpdateChatDraftMessage(data json.RawMessage) (*UpdateChatDraftMess
return &resp, err
}
func UnmarshalUpdateChatEmojiStatus(data json.RawMessage) (*UpdateChatEmojiStatus, error) {
var resp UpdateChatEmojiStatus
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateChatMessageSender(data json.RawMessage) (*UpdateChatMessageSender, error) {
var resp UpdateChatMessageSender
@ -17156,8 +17327,8 @@ func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedN
return &resp, err
}
func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) {
var resp UpdateSelectedBackground
func UnmarshalUpdateDefaultBackground(data json.RawMessage) (*UpdateDefaultBackground, error) {
var resp UpdateDefaultBackground
err := json.Unmarshal(data, &resp)
@ -17420,6 +17591,22 @@ func UnmarshalUpdateChatBoost(data json.RawMessage) (*UpdateChatBoost, error) {
return &resp, err
}
func UnmarshalUpdateMessageReaction(data json.RawMessage) (*UpdateMessageReaction, error) {
var resp UpdateMessageReaction
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateMessageReactions(data json.RawMessage) (*UpdateMessageReactions, error) {
var resp UpdateMessageReactions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdates(data json.RawMessage) (*Updates, error) {
var resp Updates
@ -18384,8 +18571,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeKeyboardButtonTypeRequestPoll:
return UnmarshalKeyboardButtonTypeRequestPoll(data)
case TypeKeyboardButtonTypeRequestUser:
return UnmarshalKeyboardButtonTypeRequestUser(data)
case TypeKeyboardButtonTypeRequestUsers:
return UnmarshalKeyboardButtonTypeRequestUsers(data)
case TypeKeyboardButtonTypeRequestChat:
return UnmarshalKeyboardButtonTypeRequestChat(data)
@ -19122,11 +19309,14 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessagePremiumGiveawayCompleted:
return UnmarshalMessagePremiumGiveawayCompleted(data)
case TypeMessagePremiumGiveawayWinners:
return UnmarshalMessagePremiumGiveawayWinners(data)
case TypeMessageContactRegistered:
return UnmarshalMessageContactRegistered(data)
case TypeMessageUserShared:
return UnmarshalMessageUserShared(data)
case TypeMessageUsersShared:
return UnmarshalMessageUsersShared(data)
case TypeMessageChatShared:
return UnmarshalMessageChatShared(data)
@ -19437,12 +19627,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeEmojiCategoryTypeChatPhoto:
return UnmarshalEmojiCategoryTypeChatPhoto(data)
case TypeStoryViewer:
return UnmarshalStoryViewer(data)
case TypeStoryViewers:
return UnmarshalStoryViewers(data)
case TypeStoryAreaPosition:
return UnmarshalStoryAreaPosition(data)
@ -19455,6 +19639,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStoryAreaTypeSuggestedReaction:
return UnmarshalStoryAreaTypeSuggestedReaction(data)
case TypeStoryAreaTypeMessage:
return UnmarshalStoryAreaTypeMessage(data)
case TypeStoryArea:
return UnmarshalStoryArea(data)
@ -19470,6 +19657,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInputStoryAreaTypeSuggestedReaction:
return UnmarshalInputStoryAreaTypeSuggestedReaction(data)
case TypeInputStoryAreaTypeMessage:
return UnmarshalInputStoryAreaTypeMessage(data)
case TypeInputStoryArea:
return UnmarshalInputStoryArea(data)
@ -19527,14 +19717,35 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatActiveStories:
return UnmarshalChatActiveStories(data)
case TypeStoryPublicForwardMessage:
return UnmarshalStoryPublicForwardMessage(data)
case TypeStoryInteractionTypeView:
return UnmarshalStoryInteractionTypeView(data)
case TypeStoryPublicForwardStory:
return UnmarshalStoryPublicForwardStory(data)
case TypeStoryInteractionTypeForward:
return UnmarshalStoryInteractionTypeForward(data)
case TypeStoryPublicForwards:
return UnmarshalStoryPublicForwards(data)
case TypeStoryInteractionTypeRepost:
return UnmarshalStoryInteractionTypeRepost(data)
case TypeStoryInteraction:
return UnmarshalStoryInteraction(data)
case TypeStoryInteractions:
return UnmarshalStoryInteractions(data)
case TypePublicForwardMessage:
return UnmarshalPublicForwardMessage(data)
case TypePublicForwardStory:
return UnmarshalPublicForwardStory(data)
case TypePublicForwards:
return UnmarshalPublicForwards(data)
case TypeChatBoostLevelFeatures:
return UnmarshalChatBoostLevelFeatures(data)
case TypeChatBoostFeatures:
return UnmarshalChatBoostFeatures(data)
case TypeChatBoostSourceGiftCode:
return UnmarshalChatBoostSourceGiftCode(data)
@ -19893,9 +20104,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventAvailableReactionsChanged:
return UnmarshalChatEventAvailableReactionsChanged(data)
case TypeChatEventBackgroundChanged:
return UnmarshalChatEventBackgroundChanged(data)
case TypeChatEventDescriptionChanged:
return UnmarshalChatEventDescriptionChanged(data)
case TypeChatEventEmojiStatusChanged:
return UnmarshalChatEventEmojiStatusChanged(data)
case TypeChatEventLinkedChatChanged:
return UnmarshalChatEventLinkedChatChanged(data)
@ -19929,8 +20146,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventAccentColorChanged:
return UnmarshalChatEventAccentColorChanged(data)
case TypeChatEventBackgroundCustomEmojiChanged:
return UnmarshalChatEventBackgroundCustomEmojiChanged(data)
case TypeChatEventProfileAccentColorChanged:
return UnmarshalChatEventProfileAccentColorChanged(data)
case TypeChatEventHasProtectedContentToggled:
return UnmarshalChatEventHasProtectedContentToggled(data)
@ -20253,6 +20470,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeBackgroundTypeFill:
return UnmarshalBackgroundTypeFill(data)
case TypeBackgroundTypeChatTheme:
return UnmarshalBackgroundTypeChatTheme(data)
case TypeInputBackgroundLocal:
return UnmarshalInputBackgroundLocal(data)
@ -20769,6 +20989,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypePremiumFeatures:
return UnmarshalInternalLinkTypePremiumFeatures(data)
case TypeInternalLinkTypePremiumGift:
return UnmarshalInternalLinkTypePremiumGift(data)
case TypeInternalLinkTypePremiumGiftCode:
return UnmarshalInternalLinkTypePremiumGiftCode(data)
@ -21054,6 +21277,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeSuggestedActionSubscribeToAnnualPremium:
return UnmarshalSuggestedActionSubscribeToAnnualPremium(data)
case TypeSuggestedActionGiftPremiumForChristmas:
return UnmarshalSuggestedActionGiftPremiumForChristmas(data)
case TypeCount:
return UnmarshalCount(data)
@ -21216,11 +21442,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatPhoto:
return UnmarshalUpdateChatPhoto(data)
case TypeUpdateChatAccentColor:
return UnmarshalUpdateChatAccentColor(data)
case TypeUpdateChatBackgroundCustomEmoji:
return UnmarshalUpdateChatBackgroundCustomEmoji(data)
case TypeUpdateChatAccentColors:
return UnmarshalUpdateChatAccentColors(data)
case TypeUpdateChatPermissions:
return UnmarshalUpdateChatPermissions(data)
@ -21246,6 +21469,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatDraftMessage:
return UnmarshalUpdateChatDraftMessage(data)
case TypeUpdateChatEmojiStatus:
return UnmarshalUpdateChatEmojiStatus(data)
case TypeUpdateChatMessageSender:
return UnmarshalUpdateChatMessageSender(data)
@ -21441,8 +21667,8 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(data)
case TypeUpdateDefaultBackground:
return UnmarshalUpdateDefaultBackground(data)
case TypeUpdateChatThemes:
return UnmarshalUpdateChatThemes(data)
@ -21540,6 +21766,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateChatBoost:
return UnmarshalUpdateChatBoost(data)
case TypeUpdateMessageReaction:
return UnmarshalUpdateMessageReaction(data)
case TypeUpdateMessageReactions:
return UnmarshalUpdateMessageReactions(data)
case TypeUpdates:
return UnmarshalUpdates(data)