Update to TDLib 1.8.3

This commit is contained in:
c0re100 2022-04-25 04:33:39 +08:00
parent 36a547a560
commit 94b077458b
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1679 additions and 242 deletions

View file

@ -1976,7 +1976,7 @@ type DeleteChatRequest struct {
ChatId int64 `json:"chat_id"`
}
// Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method
// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat
func (client *Client) DeleteChat(req *DeleteChatRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -2728,7 +2728,7 @@ type SendMessageRequest struct {
ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the message will be sent
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of the message to reply to or 0
// Identifier of the replied message; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Options to be used to send the message; pass null to use default options
Options *MessageSendOptions `json:"options"`
@ -2769,7 +2769,7 @@ type SendMessageAlbumRequest struct {
ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the messages will be sent
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of a message to reply to or 0
// Identifier of a replied message; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Options to be used to send the messages; pass null to use default options
Options *MessageSendOptions `json:"options"`
@ -2842,7 +2842,7 @@ type SendInlineQueryResultMessageRequest struct {
ChatId int64 `json:"chat_id"`
// If not 0, a message thread identifier in which the message will be sent
MessageThreadId int64 `json:"message_thread_id"`
// Identifier of a message to reply to or 0
// Identifier of a replied message; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Options to be used to send the message; pass null to use default options
Options *MessageSendOptions `json:"options"`
@ -2985,7 +2985,7 @@ type AddLocalMessageRequest struct {
ChatId int64 `json:"chat_id"`
// Identifier of the sender of the message
SenderId MessageSender `json:"sender_id"`
// Identifier of the message to reply to or 0
// Identifier of the replied message; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
// Pass true to disable notification for the message
DisableNotification bool `json:"disable_notification"`
@ -3944,6 +3944,37 @@ func GetJsonString(req *GetJsonStringRequest) (*Text, error) {
func (client *Client) GetJsonString(req *GetJsonStringRequest) (*Text, error) {
return GetJsonString(req)}
type GetThemeParametersJsonStringRequest struct {
// Theme parameters to convert to JSON
Theme *ThemeParameters `json:"theme"`
}
// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously
func GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) {
result, err := Execute(Request{
meta: meta{
Type: "getThemeParametersJsonString",
},
Data: map[string]interface{}{
"theme": req.Theme,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalText(result.Data)
}
// deprecated
// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously
func (client *Client) GetThemeParametersJsonString(req *GetThemeParametersJsonStringRequest) (*Text, error) {
return GetThemeParametersJsonString(req)}
type SetPollAnswerRequest struct {
// Identifier of the chat to which the poll belongs
ChatId int64 `json:"chat_id"`
@ -4230,6 +4261,163 @@ func (client *Client) AnswerInlineQuery(req *AnswerInlineQueryRequest) (*Ok, err
return UnmarshalOk(result.Data)
}
type GetWebAppUrlRequest struct {
// Identifier of the target bot
BotUserId int64 `json:"bot_user_id"`
// The URL from the keyboardButtonTypeWebApp button
Url string `json:"url"`
// Preferred web app theme; pass null to use the default theme
Theme *ThemeParameters `json:"theme"`
}
// Returns an HTTPS URL of a web app to open after keyboardButtonTypeWebApp button is pressed
func (client *Client) GetWebAppUrl(req *GetWebAppUrlRequest) (*HttpUrl, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getWebAppUrl",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"url": req.Url,
"theme": req.Theme,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalHttpUrl(result.Data)
}
type SendWebAppDataRequest struct {
// Identifier of the target bot
BotUserId int64 `json:"bot_user_id"`
// Text of the keyboardButtonTypeWebApp button, which opened the web app
ButtonText string `json:"button_text"`
// Received data
Data string `json:"data"`
}
// Sends data received from a keyboardButtonTypeWebApp web app to a bot
func (client *Client) SendWebAppData(req *SendWebAppDataRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "sendWebAppData",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"button_text": req.ButtonText,
"data": req.Data,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type OpenWebAppRequest struct {
// Identifier of the chat in which the web app is opened. Web apps can be opened only in private chats for now
ChatId int64 `json:"chat_id"`
// Identifier of the bot, providing the web app
BotUserId int64 `json:"bot_user_id"`
// The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
Url string `json:"url"`
// Preferred web app theme; pass null to use the default theme
Theme *ThemeParameters `json:"theme"`
// Identifier of the replied message for the message sent by the web app; 0 if none
ReplyToMessageId int64 `json:"reply_to_message_id"`
}
// Informs TDLib that a web app is being opened from attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert about data sent to the bot must be shown once
func (client *Client) OpenWebApp(req *OpenWebAppRequest) (*WebAppInfo, error) {
result, err := client.Send(Request{
meta: meta{
Type: "openWebApp",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"bot_user_id": req.BotUserId,
"url": req.Url,
"theme": req.Theme,
"reply_to_message_id": req.ReplyToMessageId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalWebAppInfo(result.Data)
}
type CloseWebAppRequest struct {
// Identifier of web app launch, received from openWebApp
WebAppLaunchId JsonInt64 `json:"web_app_launch_id"`
}
// Informs TDLib that a previously opened web app was closed
func (client *Client) CloseWebApp(req *CloseWebAppRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "closeWebApp",
},
Data: map[string]interface{}{
"web_app_launch_id": req.WebAppLaunchId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AnswerWebAppQueryRequest struct {
// Identifier of the web app query
WebAppQueryId string `json:"web_app_query_id"`
// The result of the query
Result InputInlineQueryResult `json:"result"`
}
// Sets the result of interaction with a web app and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only
func (client *Client) AnswerWebAppQuery(req *AnswerWebAppQueryRequest) (*SentWebAppMessage, error) {
result, err := client.Send(Request{
meta: meta{
Type: "answerWebAppQuery",
},
Data: map[string]interface{}{
"web_app_query_id": req.WebAppQueryId,
"result": req.Result,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalSentWebAppMessage(result.Data)
}
type GetCallbackQueryAnswerRequest struct {
// Identifier of the chat with the message
ChatId int64 `json:"chat_id"`
@ -4734,6 +4922,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypeActiveSessions:
return UnmarshalInternalLinkTypeActiveSessions(result.Data)
case TypeInternalLinkTypeAttachmentMenuBot:
return UnmarshalInternalLinkTypeAttachmentMenuBot(result.Data)
case TypeInternalLinkTypeAuthenticationCode:
return UnmarshalInternalLinkTypeAuthenticationCode(result.Data)
@ -4746,6 +4937,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypeBotStartInGroup:
return UnmarshalInternalLinkTypeBotStartInGroup(result.Data)
case TypeInternalLinkTypeBotAddToChannel:
return UnmarshalInternalLinkTypeBotAddToChannel(result.Data)
case TypeInternalLinkTypeChangePhoneNumber:
return UnmarshalInternalLinkTypeChangePhoneNumber(result.Data)
@ -5464,11 +5658,11 @@ func (client *Client) SetChatPhoto(req *SetChatPhotoRequest) (*Ok, error) {
type SetChatMessageTtlRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// New TTL value, in seconds; must be one of 0, 86400, 7 * 86400, or 31 * 86400 unless the chat is secret
// New TTL value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400
Ttl int32 `json:"ttl"`
}
// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)
// Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).
func (client *Client) SetChatMessageTtl(req *SetChatMessageTtlRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -6322,6 +6516,103 @@ func (client *Client) ClearAllDraftMessages(req *ClearAllDraftMessagesRequest) (
return UnmarshalOk(result.Data)
}
type GetSavedNotificationSoundRequest struct {
// Identifier of the notification sound
NotificationSoundId JsonInt64 `json:"notification_sound_id"`
}
// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier
func (client *Client) GetSavedNotificationSound(req *GetSavedNotificationSoundRequest) (*NotificationSounds, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedNotificationSound",
},
Data: map[string]interface{}{
"notification_sound_id": req.NotificationSoundId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalNotificationSounds(result.Data)
}
// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used
func (client *Client) GetSavedNotificationSounds() (*NotificationSounds, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getSavedNotificationSounds",
},
Data: map[string]interface{}{},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalNotificationSounds(result.Data)
}
type AddSavedNotificationSoundRequest struct {
// Notification sound file to add
Sound InputFile `json:"sound"`
}
// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed
func (client *Client) AddSavedNotificationSound(req *AddSavedNotificationSoundRequest) (*NotificationSound, error) {
result, err := client.Send(Request{
meta: meta{
Type: "addSavedNotificationSound",
},
Data: map[string]interface{}{
"sound": req.Sound,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalNotificationSound(result.Data)
}
type RemoveSavedNotificationSoundRequest struct {
// Identifier of the notification sound
NotificationSoundId JsonInt64 `json:"notification_sound_id"`
}
// Removes a notification sound from the list of saved notification sounds
func (client *Client) RemoveSavedNotificationSound(req *RemoveSavedNotificationSoundRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "removeSavedNotificationSound",
},
Data: map[string]interface{}{
"notification_sound_id": req.NotificationSoundId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetChatNotificationSettingsExceptionsRequest struct {
// If specified, only chats from the scope will be returned; pass null to return chats from all scopes
Scope NotificationSettingsScope `json:"scope"`
@ -6406,7 +6697,7 @@ func (client *Client) SetScopeNotificationSettings(req *SetScopeNotificationSett
return UnmarshalOk(result.Data)
}
// Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown
// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown
func (client *Client) ResetAllNotificationSettings() (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -6486,6 +6777,61 @@ func (client *Client) SetPinnedChats(req *SetPinnedChatsRequest) (*Ok, error) {
return UnmarshalOk(result.Data)
}
type GetAttachmentMenuBotRequest struct {
// Bot's user identifier
BotUserId int64 `json:"bot_user_id"`
}
// Returns information about a bot that can be added to attachment menu
func (client *Client) GetAttachmentMenuBot(req *GetAttachmentMenuBotRequest) (*AttachmentMenuBot, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getAttachmentMenuBot",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalAttachmentMenuBot(result.Data)
}
type ToggleBotIsAddedToAttachmentMenuRequest struct {
// Bot's user identifier
BotUserId int64 `json:"bot_user_id"`
// Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu
IsAdded bool `json:"is_added"`
}
// Adds or removes a bot to attachment menu. Bot can be added to attachment menu, only if userTypeBot.can_be_added_to_attachment_menu == true
func (client *Client) ToggleBotIsAddedToAttachmentMenu(req *ToggleBotIsAddedToAttachmentMenuRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "toggleBotIsAddedToAttachmentMenu",
},
Data: map[string]interface{}{
"bot_user_id": req.BotUserId,
"is_added": req.IsAdded,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type DownloadFileRequest struct {
// Identifier of the file to download
FileId int32 `json:"file_id"`
@ -7830,7 +8176,7 @@ func (client *Client) SetVideoChatDefaultParticipant(req *SetVideoChatDefaultPar
}
type CreateVideoChatRequest struct {
// Chat identifier, in which the video chat will be created
// Identifier of a chat in which the video chat will be created
ChatId int64 `json:"chat_id"`
// Group call title; if empty, chat title will be used
Title string `json:"title"`
@ -10214,6 +10560,113 @@ func (client *Client) GetCommands(req *GetCommandsRequest) (*BotCommands, error)
return UnmarshalBotCommands(result.Data)
}
type SetMenuButtonRequest struct {
// Identifier of the user or 0 to set menu button for all users
UserId int64 `json:"user_id"`
// New menu button
MenuButton *BotMenuButton `json:"menu_button"`
}
// Sets menu button for the given user or for all users; for bots only
func (client *Client) SetMenuButton(req *SetMenuButtonRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setMenuButton",
},
Data: map[string]interface{}{
"user_id": req.UserId,
"menu_button": req.MenuButton,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type GetMenuButtonRequest struct {
// Identifier of the user or 0 to get the default menu button
UserId int64 `json:"user_id"`
}
// Returns menu button set by the bot for the given user; for bots only
func (client *Client) GetMenuButton(req *GetMenuButtonRequest) (*BotMenuButton, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getMenuButton",
},
Data: map[string]interface{}{
"user_id": req.UserId,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalBotMenuButton(result.Data)
}
type SetDefaultGroupAdministratorRightsRequest struct {
// Default administrator rights for adding the bot to basic group and supergroup chats; may be null
DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"`
}
// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only
func (client *Client) SetDefaultGroupAdministratorRights(req *SetDefaultGroupAdministratorRightsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setDefaultGroupAdministratorRights",
},
Data: map[string]interface{}{
"default_group_administrator_rights": req.DefaultGroupAdministratorRights,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type SetDefaultChannelAdministratorRightsRequest struct {
// Default administrator rights for adding the bot to channels; may be null
DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"`
}
// Sets default administrator rights for adding the bot to channel chats; for bots only
func (client *Client) SetDefaultChannelAdministratorRights(req *SetDefaultChannelAdministratorRightsRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setDefaultChannelAdministratorRights",
},
Data: map[string]interface{}{
"default_channel_administrator_rights": req.DefaultChannelAdministratorRights,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
// Returns all active sessions of the current user
func (client *Client) GetActiveSessions() (*Sessions, error) {
result, err := client.Send(Request{
@ -10705,7 +11158,7 @@ type GetPaymentFormRequest struct {
// Message identifier
MessageId int64 `json:"message_id"`
// Preferred payment form theme; pass null to use the default theme
Theme *PaymentFormTheme `json:"theme"`
Theme *ThemeParameters `json:"theme"`
}
// Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy
@ -12973,7 +13426,7 @@ type GetMapThumbnailFileRequest struct {
Height int32 `json:"height"`
// Map scale; 1-3
Scale int32 `json:"scale"`
// Identifier of a chat, in which the thumbnail will be shown. Use 0 if unknown
// Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown
ChatId int64 `json:"chat_id"`
}
@ -14015,7 +14468,7 @@ type TestProxyRequest struct {
Port int32 `json:"port"`
// Proxy type
Type ProxyType `json:"type"`
// Identifier of a datacenter, with which to test connection
// Identifier of a datacenter with which to test connection
DcId int32 `json:"dc_id"`
// The maximum overall timeout for the request
Timeout float64 `json:"timeout"`
@ -14313,6 +14766,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateSavedAnimations:
return UnmarshalUpdateSavedAnimations(result.Data)
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(result.Data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(result.Data)
@ -14331,6 +14787,12 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(result.Data)
case TypeUpdateAttachmentMenuBots:
return UnmarshalUpdateAttachmentMenuBots(result.Data)
case TypeUpdateWebAppMessageSent:
return UnmarshalUpdateWebAppMessageSent(result.Data)
case TypeUpdateReactions:
return UnmarshalUpdateReactions(result.Data)

File diff suppressed because it is too large Load diff

View file

@ -938,6 +938,9 @@ func UnmarshalKeyboardButtonType(data json.RawMessage) (KeyboardButtonType, erro
case TypeKeyboardButtonTypeRequestPoll:
return UnmarshalKeyboardButtonTypeRequestPoll(data)
case TypeKeyboardButtonTypeWebApp:
return UnmarshalKeyboardButtonTypeWebApp(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -972,6 +975,9 @@ func UnmarshalInlineKeyboardButtonType(data json.RawMessage) (InlineKeyboardButt
case TypeInlineKeyboardButtonTypeLoginUrl:
return UnmarshalInlineKeyboardButtonTypeLoginUrl(data)
case TypeInlineKeyboardButtonTypeWebApp:
return UnmarshalInlineKeyboardButtonTypeWebApp(data)
case TypeInlineKeyboardButtonTypeCallback:
return UnmarshalInlineKeyboardButtonTypeCallback(data)
@ -1846,6 +1852,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageWebsiteConnected:
return UnmarshalMessageWebsiteConnected(data)
case TypeMessageWebAppDataSent:
return UnmarshalMessageWebAppDataSent(data)
case TypeMessageWebAppDataReceived:
return UnmarshalMessageWebAppDataReceived(data)
case TypeMessagePassportDataSent:
return UnmarshalMessagePassportDataSent(data)
@ -3672,6 +3684,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypeActiveSessions:
return UnmarshalInternalLinkTypeActiveSessions(data)
case TypeInternalLinkTypeAttachmentMenuBot:
return UnmarshalInternalLinkTypeAttachmentMenuBot(data)
case TypeInternalLinkTypeAuthenticationCode:
return UnmarshalInternalLinkTypeAuthenticationCode(data)
@ -3684,6 +3699,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypeBotStartInGroup:
return UnmarshalInternalLinkTypeBotStartInGroup(data)
case TypeInternalLinkTypeBotAddToChannel:
return UnmarshalInternalLinkTypeBotAddToChannel(data)
case TypeInternalLinkTypeChangePhoneNumber:
return UnmarshalInternalLinkTypeChangePhoneNumber(data)
@ -3790,6 +3808,9 @@ func UnmarshalFileType(data json.RawMessage) (FileType, error) {
case TypeFileTypeDocument:
return UnmarshalFileTypeDocument(data)
case TypeFileTypeNotificationSound:
return UnmarshalFileTypeNotificationSound(data)
case TypeFileTypePhoto:
return UnmarshalFileTypePhoto(data)
@ -4565,6 +4586,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateSavedAnimations:
return UnmarshalUpdateSavedAnimations(data)
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(data)
@ -4583,6 +4607,12 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(data)
case TypeUpdateAttachmentMenuBots:
return UnmarshalUpdateAttachmentMenuBots(data)
case TypeUpdateWebAppMessageSent:
return UnmarshalUpdateWebAppMessageSent(data)
case TypeUpdateReactions:
return UnmarshalUpdateReactions(data)
@ -5330,6 +5360,14 @@ func UnmarshalBotCommands(data json.RawMessage) (*BotCommands, error) {
return &resp, err
}
func UnmarshalBotMenuButton(data json.RawMessage) (*BotMenuButton, error) {
var resp BotMenuButton
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatLocation(data json.RawMessage) (*ChatLocation, error) {
var resp ChatLocation
@ -5386,6 +5424,22 @@ func UnmarshalInputChatPhotoAnimation(data json.RawMessage) (*InputChatPhotoAnim
return &resp, err
}
func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) {
var resp ChatPermissions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatAdministratorRights(data json.RawMessage) (*ChatAdministratorRights, error) {
var resp ChatAdministratorRights
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUser(data json.RawMessage) (*User, error) {
var resp User
@ -5394,6 +5448,14 @@ func UnmarshalUser(data json.RawMessage) (*User, error) {
return &resp, err
}
func UnmarshalBotInfo(data json.RawMessage) (*BotInfo, error) {
var resp BotInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUserFullInfo(data json.RawMessage) (*UserFullInfo, error) {
var resp UserFullInfo
@ -5426,14 +5488,6 @@ func UnmarshalChatAdministrators(data json.RawMessage) (*ChatAdministrators, err
return &resp, err
}
func UnmarshalChatPermissions(data json.RawMessage) (*ChatPermissions, error) {
var resp ChatPermissions
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatMemberStatusCreator(data json.RawMessage) (*ChatMemberStatusCreator, error) {
var resp ChatMemberStatusCreator
@ -6282,6 +6336,14 @@ func UnmarshalKeyboardButtonTypeRequestPoll(data json.RawMessage) (*KeyboardButt
return &resp, err
}
func UnmarshalKeyboardButtonTypeWebApp(data json.RawMessage) (*KeyboardButtonTypeWebApp, error) {
var resp KeyboardButtonTypeWebApp
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalKeyboardButton(data json.RawMessage) (*KeyboardButton, error) {
var resp KeyboardButton
@ -6306,6 +6368,14 @@ func UnmarshalInlineKeyboardButtonTypeLoginUrl(data json.RawMessage) (*InlineKey
return &resp, err
}
func UnmarshalInlineKeyboardButtonTypeWebApp(data json.RawMessage) (*InlineKeyboardButtonTypeWebApp, error) {
var resp InlineKeyboardButtonTypeWebApp
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInlineKeyboardButtonTypeCallback(data json.RawMessage) (*InlineKeyboardButtonTypeCallback, error) {
var resp InlineKeyboardButtonTypeCallback
@ -6410,6 +6480,14 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn
return &resp, err
}
func UnmarshalWebAppInfo(data json.RawMessage) (*WebAppInfo, error) {
var resp WebAppInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageThreadInfo(data json.RawMessage) (*MessageThreadInfo, error) {
var resp MessageThreadInfo
@ -6930,6 +7008,14 @@ func UnmarshalAddress(data json.RawMessage) (*Address, error) {
return &resp, err
}
func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) {
var resp ThemeParameters
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalLabeledPricePart(data json.RawMessage) (*LabeledPricePart, error) {
var resp LabeledPricePart
@ -7010,14 +7096,6 @@ func UnmarshalPaymentsProviderStripe(data json.RawMessage) (*PaymentsProviderStr
return &resp, err
}
func UnmarshalPaymentFormTheme(data json.RawMessage) (*PaymentFormTheme, error) {
var resp PaymentFormTheme
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPaymentForm(data json.RawMessage) (*PaymentForm, error) {
var resp PaymentForm
@ -7994,6 +8072,22 @@ func UnmarshalMessageWebsiteConnected(data json.RawMessage) (*MessageWebsiteConn
return &resp, err
}
func UnmarshalMessageWebAppDataSent(data json.RawMessage) (*MessageWebAppDataSent, error) {
var resp MessageWebAppDataSent
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageWebAppDataReceived(data json.RawMessage) (*MessageWebAppDataReceived, error) {
var resp MessageWebAppDataReceived
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessagePassportDataSent(data json.RawMessage) (*MessagePassportDataSent, error) {
var resp MessagePassportDataSent
@ -9074,6 +9168,30 @@ func UnmarshalImportedContacts(data json.RawMessage) (*ImportedContacts, error)
return &resp, err
}
func UnmarshalAttachmentMenuBotColor(data json.RawMessage) (*AttachmentMenuBotColor, error) {
var resp AttachmentMenuBotColor
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalAttachmentMenuBot(data json.RawMessage) (*AttachmentMenuBot, error) {
var resp AttachmentMenuBot
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalSentWebAppMessage(data json.RawMessage) (*SentWebAppMessage, error) {
var resp SentWebAppMessage
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalHttpUrl(data json.RawMessage) (*HttpUrl, error) {
var resp HttpUrl
@ -10330,6 +10448,22 @@ func UnmarshalNotificationGroupTypeCalls(data json.RawMessage) (*NotificationGro
return &resp, err
}
func UnmarshalNotificationSound(data json.RawMessage) (*NotificationSound, error) {
var resp NotificationSound
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalNotificationSounds(data json.RawMessage) (*NotificationSounds, error) {
var resp NotificationSounds
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalNotification(data json.RawMessage) (*Notification, error) {
var resp Notification
@ -10698,6 +10832,14 @@ func UnmarshalInternalLinkTypeActiveSessions(data json.RawMessage) (*InternalLin
return &resp, err
}
func UnmarshalInternalLinkTypeAttachmentMenuBot(data json.RawMessage) (*InternalLinkTypeAttachmentMenuBot, error) {
var resp InternalLinkTypeAttachmentMenuBot
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypeAuthenticationCode(data json.RawMessage) (*InternalLinkTypeAuthenticationCode, error) {
var resp InternalLinkTypeAuthenticationCode
@ -10730,6 +10872,14 @@ func UnmarshalInternalLinkTypeBotStartInGroup(data json.RawMessage) (*InternalLi
return &resp, err
}
func UnmarshalInternalLinkTypeBotAddToChannel(data json.RawMessage) (*InternalLinkTypeBotAddToChannel, error) {
var resp InternalLinkTypeBotAddToChannel
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypeChangePhoneNumber(data json.RawMessage) (*InternalLinkTypeChangePhoneNumber, error) {
var resp InternalLinkTypeChangePhoneNumber
@ -10962,6 +11112,14 @@ func UnmarshalFileTypeDocument(data json.RawMessage) (*FileTypeDocument, error)
return &resp, err
}
func UnmarshalFileTypeNotificationSound(data json.RawMessage) (*FileTypeNotificationSound, error) {
var resp FileTypeNotificationSound
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalFileTypePhoto(data json.RawMessage) (*FileTypePhoto, error) {
var resp FileTypePhoto
@ -12258,6 +12416,14 @@ func UnmarshalUpdateSavedAnimations(data json.RawMessage) (*UpdateSavedAnimation
return &resp, err
}
func UnmarshalUpdateSavedNotificationSounds(data json.RawMessage) (*UpdateSavedNotificationSounds, error) {
var resp UpdateSavedNotificationSounds
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateSelectedBackground(data json.RawMessage) (*UpdateSelectedBackground, error) {
var resp UpdateSelectedBackground
@ -12306,6 +12472,22 @@ func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error
return &resp, err
}
func UnmarshalUpdateAttachmentMenuBots(data json.RawMessage) (*UpdateAttachmentMenuBots, error) {
var resp UpdateAttachmentMenuBots
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateWebAppMessageSent(data json.RawMessage) (*UpdateWebAppMessageSent, error) {
var resp UpdateWebAppMessageSent
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateReactions(data json.RawMessage) (*UpdateReactions, error) {
var resp UpdateReactions
@ -12795,6 +12977,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeBotCommands:
return UnmarshalBotCommands(data)
case TypeBotMenuButton:
return UnmarshalBotMenuButton(data)
case TypeChatLocation:
return UnmarshalChatLocation(data)
@ -12816,9 +13001,18 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInputChatPhotoAnimation:
return UnmarshalInputChatPhotoAnimation(data)
case TypeChatPermissions:
return UnmarshalChatPermissions(data)
case TypeChatAdministratorRights:
return UnmarshalChatAdministratorRights(data)
case TypeUser:
return UnmarshalUser(data)
case TypeBotInfo:
return UnmarshalBotInfo(data)
case TypeUserFullInfo:
return UnmarshalUserFullInfo(data)
@ -12831,9 +13025,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatAdministrators:
return UnmarshalChatAdministrators(data)
case TypeChatPermissions:
return UnmarshalChatPermissions(data)
case TypeChatMemberStatusCreator:
return UnmarshalChatMemberStatusCreator(data)
@ -13152,6 +13343,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeKeyboardButtonTypeRequestPoll:
return UnmarshalKeyboardButtonTypeRequestPoll(data)
case TypeKeyboardButtonTypeWebApp:
return UnmarshalKeyboardButtonTypeWebApp(data)
case TypeKeyboardButton:
return UnmarshalKeyboardButton(data)
@ -13161,6 +13355,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInlineKeyboardButtonTypeLoginUrl:
return UnmarshalInlineKeyboardButtonTypeLoginUrl(data)
case TypeInlineKeyboardButtonTypeWebApp:
return UnmarshalInlineKeyboardButtonTypeWebApp(data)
case TypeInlineKeyboardButtonTypeCallback:
return UnmarshalInlineKeyboardButtonTypeCallback(data)
@ -13200,6 +13397,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeLoginUrlInfoRequestConfirmation:
return UnmarshalLoginUrlInfoRequestConfirmation(data)
case TypeWebAppInfo:
return UnmarshalWebAppInfo(data)
case TypeMessageThreadInfo:
return UnmarshalMessageThreadInfo(data)
@ -13395,6 +13595,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeAddress:
return UnmarshalAddress(data)
case TypeThemeParameters:
return UnmarshalThemeParameters(data)
case TypeLabeledPricePart:
return UnmarshalLabeledPricePart(data)
@ -13425,9 +13628,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePaymentsProviderStripe:
return UnmarshalPaymentsProviderStripe(data)
case TypePaymentFormTheme:
return UnmarshalPaymentFormTheme(data)
case TypePaymentForm:
return UnmarshalPaymentForm(data)
@ -13794,6 +13994,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageWebsiteConnected:
return UnmarshalMessageWebsiteConnected(data)
case TypeMessageWebAppDataSent:
return UnmarshalMessageWebAppDataSent(data)
case TypeMessageWebAppDataReceived:
return UnmarshalMessageWebAppDataReceived(data)
case TypeMessagePassportDataSent:
return UnmarshalMessagePassportDataSent(data)
@ -14199,6 +14405,15 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeImportedContacts:
return UnmarshalImportedContacts(data)
case TypeAttachmentMenuBotColor:
return UnmarshalAttachmentMenuBotColor(data)
case TypeAttachmentMenuBot:
return UnmarshalAttachmentMenuBot(data)
case TypeSentWebAppMessage:
return UnmarshalSentWebAppMessage(data)
case TypeHttpUrl:
return UnmarshalHttpUrl(data)
@ -14670,6 +14885,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeNotificationGroupTypeCalls:
return UnmarshalNotificationGroupTypeCalls(data)
case TypeNotificationSound:
return UnmarshalNotificationSound(data)
case TypeNotificationSounds:
return UnmarshalNotificationSounds(data)
case TypeNotification:
return UnmarshalNotification(data)
@ -14808,6 +15029,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypeActiveSessions:
return UnmarshalInternalLinkTypeActiveSessions(data)
case TypeInternalLinkTypeAttachmentMenuBot:
return UnmarshalInternalLinkTypeAttachmentMenuBot(data)
case TypeInternalLinkTypeAuthenticationCode:
return UnmarshalInternalLinkTypeAuthenticationCode(data)
@ -14820,6 +15044,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypeBotStartInGroup:
return UnmarshalInternalLinkTypeBotStartInGroup(data)
case TypeInternalLinkTypeBotAddToChannel:
return UnmarshalInternalLinkTypeBotAddToChannel(data)
case TypeInternalLinkTypeChangePhoneNumber:
return UnmarshalInternalLinkTypeChangePhoneNumber(data)
@ -14907,6 +15134,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeFileTypeDocument:
return UnmarshalFileTypeDocument(data)
case TypeFileTypeNotificationSound:
return UnmarshalFileTypeNotificationSound(data)
case TypeFileTypePhoto:
return UnmarshalFileTypePhoto(data)
@ -15393,6 +15623,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateSavedAnimations:
return UnmarshalUpdateSavedAnimations(data)
case TypeUpdateSavedNotificationSounds:
return UnmarshalUpdateSavedNotificationSounds(data)
case TypeUpdateSelectedBackground:
return UnmarshalUpdateSelectedBackground(data)
@ -15411,6 +15644,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(data)
case TypeUpdateAttachmentMenuBots:
return UnmarshalUpdateAttachmentMenuBots(data)
case TypeUpdateWebAppMessageSent:
return UnmarshalUpdateWebAppMessageSent(data)
case TypeUpdateReactions:
return UnmarshalUpdateReactions(data)