Update to TDLib 1.8.39

This commit is contained in:
c0re100 2024-11-01 06:19:36 +08:00
parent 8454bd8c86
commit 4330cb2fa1
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 325 additions and 417 deletions

View file

@ -1828,32 +1828,6 @@ func (client *Client) SearchChatsOnServer(req *SearchChatsOnServerRequest) (*Cha
return UnmarshalChats(result.Data)
}
type SearchChatsNearbyRequest struct {
// Current user location
Location *Location `json:"location"`
}
// Returns a list of users and location-based supergroups nearby. The method was disabled and returns an empty list of chats now
func (client *Client) SearchChatsNearby(req *SearchChatsNearbyRequest) (*ChatsNearby, error) {
result, err := client.Send(Request{
meta: meta{
Type: "searchChatsNearby",
},
Data: map[string]interface{}{
"location": req.Location,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalChatsNearby(result.Data)
}
// Returns a list of channel chats recommended to the current user
func (client *Client) GetRecommendedChats() (*Chats, error) {
result, err := client.Send(Request{
@ -2939,6 +2913,8 @@ func (client *Client) SearchPublicMessagesByTag(req *SearchPublicMessagesByTagRe
}
type SearchPublicStoriesByTagRequest struct {
// Identifier of the chat that posted the stories to search for; pass 0 to search stories in all chats
StorySenderChatId int64 `json:"story_sender_chat_id"`
// Hashtag or cashtag to search for
Tag string `json:"tag"`
// Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
@ -2954,6 +2930,7 @@ func (client *Client) SearchPublicStoriesByTag(req *SearchPublicStoriesByTagRequ
Type: "searchPublicStoriesByTag",
},
Data: map[string]interface{}{
"story_sender_chat_id": req.StorySenderChatId,
"tag": req.Tag,
"offset": req.Offset,
"limit": req.Limit,
@ -3379,7 +3356,7 @@ type GetChatSponsoredMessagesRequest struct {
ChatId int64 `json:"chat_id"`
}
// Returns sponsored messages to be shown in a chat; for channel chats only
// Returns sponsored messages to be shown in a chat; for channel chats and chats with bots only
func (client *Client) GetChatSponsoredMessages(req *GetChatSponsoredMessagesRequest) (*SponsoredMessages, error) {
result, err := client.Send(Request{
meta: meta{
@ -3982,7 +3959,7 @@ type ForwardMessagesRequest struct {
MessageIds []int64 `json:"message_ids"`
// Options to be used to send the messages; pass null to use default options
Options *MessageSendOptions `json:"options"`
// Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local
// Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
SendCopy bool `json:"send_copy"`
// Pass true to remove media captions of message copies. Ignored if send_copy is false
RemoveCaption bool `json:"remove_caption"`
@ -4321,7 +4298,7 @@ func (client *Client) EditMessageLiveLocation(req *EditMessageLiveLocationReques
type EditMessageMediaRequest struct {
// The chat the message belongs to
ChatId int64 `json:"chat_id"`
// Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited
// Identifier of the message. Use messageProperties.can_edit_media to check whether the message can be edited
MessageId int64 `json:"message_id"`
// The new message reply markup; pass null if none; for bots only
ReplyMarkup ReplyMarkup `json:"reply_markup"`
@ -4329,7 +4306,7 @@ type EditMessageMediaRequest struct {
InputMessageContent InputMessageContent `json:"input_message_content"`
}
// Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side
// Edits the media content of a message, including message caption. If only the caption needs to be edited, use editMessageCaption instead. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side
func (client *Client) EditMessageMedia(req *EditMessageMediaRequest) (*Message, error) {
result, err := client.Send(Request{
meta: meta{
@ -4505,7 +4482,7 @@ type EditInlineMessageMediaRequest struct {
InputMessageContent InputMessageContent `json:"input_message_content"`
}
// Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
// Edits the media content of a message with a text, an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
func (client *Client) EditInlineMessageMedia(req *EditInlineMessageMediaRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -4597,7 +4574,7 @@ type EditMessageSchedulingStateRequest struct {
ChatId int64 `json:"chat_id"`
// Identifier of the message. Use messageProperties.can_edit_scheduling_state to check whether the message is suitable
MessageId int64 `json:"message_id"`
// The new message scheduling state; pass null to send the message immediately
// The new message scheduling state; pass null to send the message immediately. Must be null for messages in the state messageSchedulingStateSendWhenVideoProcessed
SchedulingState MessageSchedulingState `json:"scheduling_state"`
}
@ -4845,7 +4822,7 @@ type EditBusinessMessageMediaRequest struct {
InputMessageContent InputMessageContent `json:"input_message_content"`
}
// Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on behalf of a business account; for bots only
// Edits the media content of a message with a text, an animation, an audio, a document, a photo or a video in a message sent on behalf of a business account; for bots only
func (client *Client) EditBusinessMessageMedia(req *EditBusinessMessageMediaRequest) (*BusinessMessage, error) {
result, err := client.Send(Request{
meta: meta{
@ -5342,7 +5319,7 @@ type EditQuickReplyMessageRequest struct {
InputMessageContent InputMessageContent `json:"input_message_content"`
}
// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Text message can be edited only to a text message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa
// Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check whether a message can be edited. Media message can be edited only to a media message. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa
func (client *Client) EditQuickReplyMessage(req *EditQuickReplyMessageRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -6035,7 +6012,7 @@ type SetMessageReactionsRequest struct {
ChatId int64 `json:"chat_id"`
// Identifier of the message
MessageId int64 `json:"message_id"`
// Types of the reaction to set
// Types of the reaction to set; pass an empty list to remove the reactions
ReactionTypes []ReactionType `json:"reaction_types"`
// Pass true if the reactions are added with a big animation
IsBig bool `json:"is_big"`
@ -14932,6 +14909,8 @@ func (client *Client) GetStickerSetName(req *GetStickerSetNameRequest) (*Text, e
type SearchStickerSetRequest struct {
// Name of the sticker set
Name string `json:"name"`
// Pass true to ignore local cache of sticker sets and always send a network request
IgnoreCache bool `json:"ignore_cache"`
}
// Searches for a sticker set by its name
@ -14942,6 +14921,7 @@ func (client *Client) SearchStickerSet(req *SearchStickerSetRequest) (*StickerSe
},
Data: map[string]interface{}{
"name": req.Name,
"ignore_cache": req.IgnoreCache,
},
})
if err != nil {
@ -16059,32 +16039,6 @@ func (client *Client) SetEmojiStatus(req *SetEmojiStatusRequest) (*Ok, error) {
return UnmarshalOk(result.Data)
}
type SetLocationRequest struct {
// The new location of the user
Location *Location `json:"location"`
}
// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer. Must not be called if the user has a business location
func (client *Client) SetLocation(req *SetLocationRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setLocation",
},
Data: map[string]interface{}{
"location": req.Location,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ToggleHasSponsoredMessagesEnabledRequest struct {
// Pass true to enable sponsored messages for the current user; false to disable them
HasSponsoredMessagesEnabled bool `json:"has_sponsored_messages_enabled"`
@ -18513,7 +18467,7 @@ type SendGiftRequest struct {
IsPrivate bool `json:"is_private"`
}
// Send a gift to another user
// Sends a gift to another user. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out
func (client *Client) SendGift(req *SendGiftRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -19773,7 +19727,7 @@ type GetChatRevenueStatisticsRequest struct {
IsDark bool `json:"is_dark"`
}
// Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true
// Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true or bots if userFullInfo.bot_info.can_get_revenue_statistics == true
func (client *Client) GetChatRevenueStatistics(req *GetChatRevenueStatisticsRequest) (*ChatRevenueStatistics, error) {
result, err := client.Send(Request{
meta: meta{
@ -19802,7 +19756,7 @@ type GetChatRevenueWithdrawalUrlRequest struct {
Password string `json:"password"`
}
// Returns a URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue")
// Returns a URL for chat revenue withdrawal; requires owner privileges in the channel chat or the bot. Currently, this method can be used only if getOption("can_withdraw_chat_revenue") for channels with supergroupFullInfo.can_get_revenue_statistics == true or bots with userFullInfo.bot_info.can_get_revenue_statistics == true
func (client *Client) GetChatRevenueWithdrawalUrl(req *GetChatRevenueWithdrawalUrlRequest) (*HttpUrl, error) {
result, err := client.Send(Request{
meta: meta{
@ -19833,7 +19787,7 @@ type GetChatRevenueTransactionsRequest struct {
Limit int32 `json:"limit"`
}
// Returns the list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true
// Returns the list of revenue transactions for a chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true or bots if userFullInfo.bot_info.can_get_revenue_statistics == true
func (client *Client) GetChatRevenueTransactions(req *GetChatRevenueTransactionsRequest) (*ChatRevenueTransactions, error) {
result, err := client.Send(Request{
meta: meta{
@ -23331,6 +23285,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateMessageLiveLocationViewed:
return UnmarshalUpdateMessageLiveLocationViewed(result.Data)
case TypeUpdateVideoPublished:
return UnmarshalUpdateVideoPublished(result.Data)
case TypeUpdateNewChat:
return UnmarshalUpdateNewChat(result.Data)
@ -23619,9 +23576,6 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateTermsOfService:
return UnmarshalUpdateTermsOfService(result.Data)
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(result.Data)
case TypeUpdateUnconfirmedSession:
return UnmarshalUpdateUnconfirmedSession(result.Data)

View file

@ -344,8 +344,6 @@ const (
ClassFailedToAddMember = "FailedToAddMember"
ClassFailedToAddMembers = "FailedToAddMembers"
ClassCreatedBasicGroupChat = "CreatedBasicGroupChat"
ClassChatNearby = "ChatNearby"
ClassChatsNearby = "ChatsNearby"
ClassKeyboardButton = "KeyboardButton"
ClassInlineKeyboardButton = "InlineKeyboardButton"
ClassFoundWebApp = "FoundWebApp"
@ -741,6 +739,7 @@ const (
TypeStarTransactionPartnerGooglePlay = "starTransactionPartnerGooglePlay"
TypeStarTransactionPartnerFragment = "starTransactionPartnerFragment"
TypeStarTransactionPartnerTelegramAds = "starTransactionPartnerTelegramAds"
TypeStarTransactionPartnerTelegramApi = "starTransactionPartnerTelegramApi"
TypeStarTransactionPartnerBot = "starTransactionPartnerBot"
TypeStarTransactionPartnerBusiness = "starTransactionPartnerBusiness"
TypeStarTransactionPartnerChat = "starTransactionPartnerChat"
@ -929,12 +928,9 @@ const (
TypeFailedToAddMember = "failedToAddMember"
TypeFailedToAddMembers = "failedToAddMembers"
TypeCreatedBasicGroupChat = "createdBasicGroupChat"
TypeChatNearby = "chatNearby"
TypeChatsNearby = "chatsNearby"
TypePublicChatTypeHasUsername = "publicChatTypeHasUsername"
TypePublicChatTypeIsLocationBased = "publicChatTypeIsLocationBased"
TypeChatActionBarReportSpam = "chatActionBarReportSpam"
TypeChatActionBarReportUnrelatedLocation = "chatActionBarReportUnrelatedLocation"
TypeChatActionBarInviteMembers = "chatActionBarInviteMembers"
TypeChatActionBarReportAddBlock = "chatActionBarReportAddBlock"
TypeChatActionBarAddContact = "chatActionBarAddContact"
@ -1287,6 +1283,7 @@ const (
TypeInputPaidMedia = "inputPaidMedia"
TypeMessageSchedulingStateSendAtDate = "messageSchedulingStateSendAtDate"
TypeMessageSchedulingStateSendWhenOnline = "messageSchedulingStateSendWhenOnline"
TypeMessageSchedulingStateSendWhenVideoProcessed = "messageSchedulingStateSendWhenVideoProcessed"
TypeMessageSelfDestructTypeTimer = "messageSelfDestructTypeTimer"
TypeMessageSelfDestructTypeImmediately = "messageSelfDestructTypeImmediately"
TypeMessageSendOptions = "messageSendOptions"
@ -1663,7 +1660,6 @@ const (
TypeBusinessFeaturePromotionAnimation = "businessFeaturePromotionAnimation"
TypePremiumState = "premiumState"
TypeStorePaymentPurposePremiumSubscription = "storePaymentPurposePremiumSubscription"
TypeStorePaymentPurposeGiftedPremium = "storePaymentPurposeGiftedPremium"
TypeStorePaymentPurposePremiumGiftCodes = "storePaymentPurposePremiumGiftCodes"
TypeStorePaymentPurposePremiumGiveaway = "storePaymentPurposePremiumGiveaway"
TypeStorePaymentPurposeStarGiveaway = "storePaymentPurposeStarGiveaway"
@ -2054,6 +2050,7 @@ const (
TypeUpdateMessageUnreadReactions = "updateMessageUnreadReactions"
TypeUpdateMessageFactCheck = "updateMessageFactCheck"
TypeUpdateMessageLiveLocationViewed = "updateMessageLiveLocationViewed"
TypeUpdateVideoPublished = "updateVideoPublished"
TypeUpdateNewChat = "updateNewChat"
TypeUpdateChatTitle = "updateChatTitle"
TypeUpdateChatPhoto = "updateChatPhoto"
@ -2150,7 +2147,6 @@ const (
TypeUpdateLanguagePackStrings = "updateLanguagePackStrings"
TypeUpdateConnectionState = "updateConnectionState"
TypeUpdateTermsOfService = "updateTermsOfService"
TypeUpdateUsersNearby = "updateUsersNearby"
TypeUpdateUnconfirmedSession = "updateUnconfirmedSession"
TypeUpdateAttachmentMenuBots = "updateAttachmentMenuBots"
TypeUpdateWebAppMessageSent = "updateWebAppMessageSent"
@ -7317,7 +7313,7 @@ type StarSubscriptions struct {
meta
// The amount of owned Telegram Stars
StarCount int64 `json:"star_count"`
// List of subbscriptions for Telegram Stars
// List of subscriptions for Telegram Stars
Subscriptions []*StarSubscription `json:"subscriptions"`
// The number of Telegram Stars required to buy to extend subscriptions expiring soon
RequiredStarCount int64 `json:"required_star_count"`
@ -7464,6 +7460,8 @@ type PremiumGiftCodePaymentOption struct {
Currency string `json:"currency"`
// The amount to pay, in the smallest units of the currency
Amount int64 `json:"amount"`
// The discount associated with this option, as a percentage
DiscountPercentage int32 `json:"discount_percentage"`
// Number of users which will be able to activate the gift codes
WinnerCount int32 `json:"winner_count"`
// Number of months the Telegram Premium subscription will be active
@ -7472,6 +7470,8 @@ type PremiumGiftCodePaymentOption struct {
StoreProductId string `json:"store_product_id"`
// Number of times the store product must be paid
StoreProductQuantity int32 `json:"store_product_quantity"`
// A sticker to be shown along with the gift code; may be null if unknown
Sticker *Sticker `json:"sticker"`
}
func (entity *PremiumGiftCodePaymentOption) MarshalJSON() ([]byte, error) {
@ -7729,10 +7729,14 @@ type Gift struct {
StarCount int64 `json:"star_count"`
// Number of Telegram Stars that can be claimed by the receiver instead of the gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed
DefaultSellStarCount int64 `json:"default_sell_star_count"`
// Number of remaining times the gift can be purchased by all users; 0 if not limited
// Number of remaining times the gift can be purchased by all users; 0 if not limited or the gift was sold out
RemainingCount int32 `json:"remaining_count"`
// Number of total times the gift can be purchased by all users; 0 if not limited
TotalCount int32 `json:"total_count"`
// Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only
FirstSendDate int32 `json:"first_send_date"`
// Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only
LastSendDate int32 `json:"last_send_date"`
}
func (entity *Gift) MarshalJSON() ([]byte, error) {
@ -7891,7 +7895,7 @@ func (*StarTransactionDirectionOutgoing) StarTransactionDirectionType() string {
// Paid media were bought
type BotTransactionPurposePaidMedia struct {
meta
// The bought media if the trancastion wasn't refunded
// The bought media if the transaction wasn't refunded
Media []PaidMedia `json:"media"`
// Bot-provided payload; for bots only
Payload string `json:"payload"`
@ -7970,7 +7974,7 @@ type ChatTransactionPurposePaidMedia struct {
meta
// Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message
MessageId int64 `json:"message_id"`
// The bought media if the trancastion wasn't refunded
// The bought media if the transaction wasn't refunded
Media []PaidMedia `json:"media"`
}
@ -8253,7 +8257,7 @@ func (*StarTransactionPartnerGooglePlay) StarTransactionPartnerType() string {
// The transaction is a transaction with Fragment
type StarTransactionPartnerFragment struct {
meta
// State of the withdrawal; may be null for refunds from Fragment
// State of the withdrawal; may be null for refunds from Fragment or for Telegram Stars bought on Fragment
WithdrawalState RevenueWithdrawalState `json:"withdrawal_state"`
}
@ -8318,6 +8322,33 @@ func (*StarTransactionPartnerTelegramAds) StarTransactionPartnerType() string {
return TypeStarTransactionPartnerTelegramAds
}
// The transaction is a transaction with Telegram for API usage
type StarTransactionPartnerTelegramApi struct {
meta
// The number of billed requests
RequestCount int32 `json:"request_count"`
}
func (entity *StarTransactionPartnerTelegramApi) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StarTransactionPartnerTelegramApi
return json.Marshal((*stub)(entity))
}
func (*StarTransactionPartnerTelegramApi) GetClass() string {
return ClassStarTransactionPartner
}
func (*StarTransactionPartnerTelegramApi) GetType() string {
return TypeStarTransactionPartnerTelegramApi
}
func (*StarTransactionPartnerTelegramApi) StarTransactionPartnerType() string {
return TypeStarTransactionPartnerTelegramApi
}
// The transaction is a transaction with a bot
type StarTransactionPartnerBot struct {
meta
@ -8371,7 +8402,7 @@ type StarTransactionPartnerBusiness struct {
meta
// Identifier of the business account user
UserId int64 `json:"user_id"`
// The bought media if the trancastion wasn't refunded
// The bought media if the transaction wasn't refunded
Media []PaidMedia `json:"media"`
}
@ -8462,7 +8493,7 @@ func (starTransactionPartnerChat *StarTransactionPartnerChat) UnmarshalJSON(data
return nil
}
// The transaction is a transcation with another user
// The transaction is a transaction with another user
type StarTransactionPartnerUser struct {
meta
// Identifier of the user; 0 if the user was anonymous
@ -9235,6 +9266,8 @@ type BotInfo struct {
DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"`
// Default administrator rights for adding the bot to channels; may be null
DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"`
// True, if the bot's revenue statistics are available
CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"`
// True, if the bot has media previews
HasMediaPreviews bool `json:"has_media_previews"`
// The internal link, which can be used to edit bot commands; may be null
@ -9274,6 +9307,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error {
PrivacyPolicyUrl string `json:"privacy_policy_url"`
DefaultGroupAdministratorRights *ChatAdministratorRights `json:"default_group_administrator_rights"`
DefaultChannelAdministratorRights *ChatAdministratorRights `json:"default_channel_administrator_rights"`
CanGetRevenueStatistics bool `json:"can_get_revenue_statistics"`
HasMediaPreviews bool `json:"has_media_previews"`
EditCommandsLink json.RawMessage `json:"edit_commands_link"`
EditDescriptionLink json.RawMessage `json:"edit_description_link"`
@ -9295,6 +9329,7 @@ func (botInfo *BotInfo) UnmarshalJSON(data []byte) error {
botInfo.PrivacyPolicyUrl = tmp.PrivacyPolicyUrl
botInfo.DefaultGroupAdministratorRights = tmp.DefaultGroupAdministratorRights
botInfo.DefaultChannelAdministratorRights = tmp.DefaultChannelAdministratorRights
botInfo.CanGetRevenueStatistics = tmp.CanGetRevenueStatistics
botInfo.HasMediaPreviews = tmp.HasMediaPreviews
fieldEditCommandsLink, _ := UnmarshalInternalLinkType(tmp.EditCommandsLink)
@ -9347,8 +9382,6 @@ type UserFullInfo struct {
Birthdate *Birthdate `json:"birthdate"`
// Identifier of the personal chat of the user; 0 if none
PersonalChatId int64 `json:"personal_chat_id"`
// The list of available options for gifting Telegram Premium to the user
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
// Number of gifts saved to profile by the user
GiftCount int32 `json:"gift_count"`
// Number of group chats where both the other user and the current user are a member; 0 for the current user
@ -9393,7 +9426,6 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
Bio *FormattedText `json:"bio"`
Birthdate *Birthdate `json:"birthdate"`
PersonalChatId int64 `json:"personal_chat_id"`
PremiumGiftOptions []*PremiumPaymentOption `json:"premium_gift_options"`
GiftCount int32 `json:"gift_count"`
GroupInCommonCount int32 `json:"group_in_common_count"`
BusinessInfo *BusinessInfo `json:"business_info"`
@ -9420,7 +9452,6 @@ func (userFullInfo *UserFullInfo) UnmarshalJSON(data []byte) error {
userFullInfo.Bio = tmp.Bio
userFullInfo.Birthdate = tmp.Birthdate
userFullInfo.PersonalChatId = tmp.PersonalChatId
userFullInfo.PremiumGiftOptions = tmp.PremiumGiftOptions
userFullInfo.GiftCount = tmp.GiftCount
userFullInfo.GroupInCommonCount = tmp.GroupInCommonCount
userFullInfo.BusinessInfo = tmp.BusinessInfo
@ -10735,7 +10766,7 @@ type Supergroup struct {
Date int32 `json:"date"`
// Status of the current user in the supergroup or channel; custom title will always be empty
Status ChatMemberStatus `json:"status"`
// Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories
// Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories
MemberCount int32 `json:"member_count"`
// Approximate boost level for the chat
BoostLevel int32 `json:"boost_level"`
@ -12492,9 +12523,9 @@ type Message struct {
IsTopicMessage bool `json:"is_topic_message"`
// True, if the message contains an unread mention for the current user
ContainsUnreadMention bool `json:"contains_unread_mention"`
// Point in time (Unix timestamp) when the message was sent
// Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages
Date int32 `json:"date"`
// Point in time (Unix timestamp) when the message was last edited
// Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages
EditDate int32 `json:"edit_date"`
// Information about the initial message sender; may be null if none or unknown
ForwardInfo *MessageForwardInfo `json:"forward_info"`
@ -14979,56 +15010,6 @@ func (*CreatedBasicGroupChat) GetType() string {
return TypeCreatedBasicGroupChat
}
// Describes a chat located nearby
type ChatNearby struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Distance to the chat location, in meters
Distance int32 `json:"distance"`
}
func (entity *ChatNearby) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatNearby
return json.Marshal((*stub)(entity))
}
func (*ChatNearby) GetClass() string {
return ClassChatNearby
}
func (*ChatNearby) GetType() string {
return TypeChatNearby
}
// Represents a list of chats located nearby
type ChatsNearby struct {
meta
// List of users nearby
UsersNearby []*ChatNearby `json:"users_nearby"`
// List of location-based supergroups nearby
SupergroupsNearby []*ChatNearby `json:"supergroups_nearby"`
}
func (entity *ChatsNearby) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatsNearby
return json.Marshal((*stub)(entity))
}
func (*ChatsNearby) GetClass() string {
return ClassChatsNearby
}
func (*ChatsNearby) GetType() string {
return TypeChatsNearby
}
// The chat is public, because it has an active username
type PublicChatTypeHasUsername struct{
meta
@ -15079,7 +15060,7 @@ func (*PublicChatTypeIsLocationBased) PublicChatTypeType() string {
return TypePublicChatTypeIsLocationBased
}
// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
// The chat can be reported as spam using the method reportChat with an empty option_id and message_ids. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
type ChatActionBarReportSpam struct {
meta
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
@ -15106,31 +15087,6 @@ func (*ChatActionBarReportSpam) ChatActionBarType() string {
return TypeChatActionBarReportSpam
}
// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation
type ChatActionBarReportUnrelatedLocation struct{
meta
}
func (entity *ChatActionBarReportUnrelatedLocation) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatActionBarReportUnrelatedLocation
return json.Marshal((*stub)(entity))
}
func (*ChatActionBarReportUnrelatedLocation) GetClass() string {
return ClassChatActionBar
}
func (*ChatActionBarReportUnrelatedLocation) GetType() string {
return TypeChatActionBarReportUnrelatedLocation
}
func (*ChatActionBarReportUnrelatedLocation) ChatActionBarType() string {
return TypeChatActionBarReportUnrelatedLocation
}
// The chat is a recently created group chat to which new members can be invited
type ChatActionBarInviteMembers struct{
meta
@ -15161,8 +15117,6 @@ type ChatActionBarReportAddBlock struct {
meta
// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
CanUnarchive bool `json:"can_unarchive"`
// If non-negative, the current user was found by the other user through searchChatsNearby and this is the distance between the users
Distance int32 `json:"distance"`
}
func (entity *ChatActionBarReportAddBlock) MarshalJSON() ([]byte, error) {
@ -19711,7 +19665,7 @@ type LinkPreviewTypeTheme struct {
meta
// The list of files with theme description
Documents []*Document `json:"documents"`
// Settings for the cloud theme
// Settings for the cloud theme; may be null if unknown
Settings *ThemeSettings `json:"settings"`
}
@ -19902,7 +19856,7 @@ func (*LinkPreviewTypeVoiceNote) LinkPreviewTypeType() string {
// The link is a link to a Web App
type LinkPreviewTypeWebApp struct {
meta
// Web App photo
// Web App photo; may be null if none
Photo *Photo `json:"photo"`
}
@ -20299,35 +20253,35 @@ func (*LocationAddress) GetType() string {
// Contains parameters of the application theme
type ThemeParameters struct {
meta
// A color of the background in the RGB24 format
// A color of the background in the RGB format
BackgroundColor int32 `json:"background_color"`
// A secondary color for the background in the RGB24 format
// A secondary color for the background in the RGB format
SecondaryBackgroundColor int32 `json:"secondary_background_color"`
// A color of the header background in the RGB24 format
// A color of the header background in the RGB format
HeaderBackgroundColor int32 `json:"header_background_color"`
// A color of the bottom bar background in the RGB24 format
// A color of the bottom bar background in the RGB format
BottomBarBackgroundColor int32 `json:"bottom_bar_background_color"`
// A color of the section background in the RGB24 format
// A color of the section background in the RGB format
SectionBackgroundColor int32 `json:"section_background_color"`
// A color of the section separator in the RGB24 format
// A color of the section separator in the RGB format
SectionSeparatorColor int32 `json:"section_separator_color"`
// A color of text in the RGB24 format
// A color of text in the RGB format
TextColor int32 `json:"text_color"`
// An accent color of the text in the RGB24 format
// An accent color of the text in the RGB format
AccentTextColor int32 `json:"accent_text_color"`
// A color of text on the section headers in the RGB24 format
// A color of text on the section headers in the RGB format
SectionHeaderTextColor int32 `json:"section_header_text_color"`
// A color of the subtitle text in the RGB24 format
// A color of the subtitle text in the RGB format
SubtitleTextColor int32 `json:"subtitle_text_color"`
// A color of the text for destructive actions in the RGB24 format
// A color of the text for destructive actions in the RGB format
DestructiveTextColor int32 `json:"destructive_text_color"`
// A color of hints in the RGB24 format
// A color of hints in the RGB format
HintColor int32 `json:"hint_color"`
// A color of links in the RGB24 format
// A color of links in the RGB format
LinkColor int32 `json:"link_color"`
// A color of the buttons in the RGB24 format
// A color of the buttons in the RGB format
ButtonColor int32 `json:"button_color"`
// A color of text on the buttons in the RGB24 format
// A color of text on the buttons in the RGB format
ButtonTextColor int32 `json:"button_text_color"`
}
@ -21050,7 +21004,7 @@ type InputInvoiceMessage struct {
meta
// Chat identifier of the message
ChatId int64 `json:"chat_id"`
// Message identifier
// Message identifier. Use messageProperties.can_be_paid to check whether the message can be used in the method
MessageId int64 `json:"message_id"`
}
@ -25201,6 +25155,8 @@ type MessageGiftedPremium struct {
GifterUserId int64 `json:"gifter_user_id"`
// The identifier of a user that received Telegram Premium; 0 if the gift is incoming
ReceiverUserId int64 `json:"receiver_user_id"`
// Message added to the gifted Telegram Premium by the sender
Text *FormattedText `json:"text"`
// Currency for the paid amount
Currency string `json:"currency"`
// The paid amount, in the smallest units of the currency
@ -25240,6 +25196,8 @@ type MessagePremiumGiftCode struct {
meta
// Identifier of a chat or a user that created the gift code; may be null if unknown
CreatorId MessageSender `json:"creator_id"`
// Message added to the gift
Text *FormattedText `json:"text"`
// True, if the gift code was created for a giveaway
IsFromGiveaway bool `json:"is_from_giveaway"`
// True, if the winner for the corresponding Telegram Premium subscription wasn't chosen
@ -25283,6 +25241,7 @@ func (*MessagePremiumGiftCode) MessageContentType() string {
func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte) error {
var tmp struct {
CreatorId json.RawMessage `json:"creator_id"`
Text *FormattedText `json:"text"`
IsFromGiveaway bool `json:"is_from_giveaway"`
IsUnclaimed bool `json:"is_unclaimed"`
Currency string `json:"currency"`
@ -25299,6 +25258,7 @@ func (messagePremiumGiftCode *MessagePremiumGiftCode) UnmarshalJSON(data []byte)
return err
}
messagePremiumGiftCode.Text = tmp.Text
messagePremiumGiftCode.IsFromGiveaway = tmp.IsFromGiveaway
messagePremiumGiftCode.IsUnclaimed = tmp.IsUnclaimed
messagePremiumGiftCode.Currency = tmp.Currency
@ -25990,7 +25950,7 @@ func (*TextEntityTypeMention) TextEntityTypeType() string {
return TypeTextEntityTypeMention
}
// A hashtag text, beginning with "#"
// A hashtag text, beginning with "#" and optionally containing a chat username at the end
type TextEntityTypeHashtag struct{
meta
}
@ -26015,7 +25975,7 @@ func (*TextEntityTypeHashtag) TextEntityTypeType() string {
return TypeTextEntityTypeHashtag
}
// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD")
// A cashtag text, beginning with "$", consisting of capital English letters (e.g., "$USD"), and optionally containing a chat username at the end
type TextEntityTypeCashtag struct{
meta
}
@ -26741,6 +26701,33 @@ func (*MessageSchedulingStateSendWhenOnline) MessageSchedulingStateType() string
return TypeMessageSchedulingStateSendWhenOnline
}
// The message will be sent when the video in the message is converted and optimized; can be used only by the server
type MessageSchedulingStateSendWhenVideoProcessed struct {
meta
// Approximate point in time (Unix timestamp) when the message is expected to be sent
SendDate int32 `json:"send_date"`
}
func (entity *MessageSchedulingStateSendWhenVideoProcessed) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageSchedulingStateSendWhenVideoProcessed
return json.Marshal((*stub)(entity))
}
func (*MessageSchedulingStateSendWhenVideoProcessed) GetClass() string {
return ClassMessageSchedulingState
}
func (*MessageSchedulingStateSendWhenVideoProcessed) GetType() string {
return TypeMessageSchedulingStateSendWhenVideoProcessed
}
func (*MessageSchedulingStateSendWhenVideoProcessed) MessageSchedulingStateType() string {
return TypeMessageSchedulingStateSendWhenVideoProcessed
}
// The message will be self-destructed in the specified time after its content was opened
type MessageSelfDestructTypeTimer struct {
meta
@ -26802,6 +26789,8 @@ type MessageSendOptions struct {
FromBackground bool `json:"from_background"`
// Pass true if the content of the message must be protected from forwarding and saving; for bots only
ProtectContent bool `json:"protect_content"`
// Pass true to allow the message to ignore regular broadcast limits for a small fee; for bots only
AllowPaidBroadcast bool `json:"allow_paid_broadcast"`
// Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum
UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"`
// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
@ -26835,6 +26824,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
DisableNotification bool `json:"disable_notification"`
FromBackground bool `json:"from_background"`
ProtectContent bool `json:"protect_content"`
AllowPaidBroadcast bool `json:"allow_paid_broadcast"`
UpdateOrderOfInstalledStickerSets bool `json:"update_order_of_installed_sticker_sets"`
SchedulingState json.RawMessage `json:"scheduling_state"`
EffectId JsonInt64 `json:"effect_id"`
@ -26850,6 +26840,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
messageSendOptions.DisableNotification = tmp.DisableNotification
messageSendOptions.FromBackground = tmp.FromBackground
messageSendOptions.ProtectContent = tmp.ProtectContent
messageSendOptions.AllowPaidBroadcast = tmp.AllowPaidBroadcast
messageSendOptions.UpdateOrderOfInstalledStickerSets = tmp.UpdateOrderOfInstalledStickerSets
messageSendOptions.EffectId = tmp.EffectId
messageSendOptions.SendingId = tmp.SendingId
@ -26864,7 +26855,7 @@ func (messageSendOptions *MessageSendOptions) UnmarshalJSON(data []byte) error {
// Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can't be copied
type MessageCopyOptions struct {
meta
// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local
// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_saved and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable
SendCopy bool `json:"send_copy"`
// True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
ReplaceCaption bool `json:"replace_caption"`
@ -27379,7 +27370,7 @@ func (inputMessageVideo *InputMessageVideo) UnmarshalJSON(data []byte) error {
// A video note message
type InputMessageVideoNote struct {
meta
// Video note to be sent
// Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle
VideoNote InputFile `json:"video_note"`
// Video thumbnail; may be null if empty; pass null to skip thumbnail uploading
Thumbnail *InputThumbnail `json:"thumbnail"`
@ -27835,7 +27826,7 @@ type MessageProperties struct {
CanBeDeletedOnlyForSelf bool `json:"can_be_deleted_only_for_self"`
// True, if the message can be deleted for all users using the method deleteMessages with revoke == true
CanBeDeletedForAllUsers bool `json:"can_be_deleted_for_all_users"`
// True, if the message can be edited using the methods editMessageText, editMessageMedia, editMessageCaption, or editMessageReplyMarkup. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message
// True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message
CanBeEdited bool `json:"can_be_edited"`
// True, if the message can be forwarded using inputMessageForwarded or forwardMessages
CanBeForwarded bool `json:"can_be_forwarded"`
@ -27851,6 +27842,8 @@ type MessageProperties struct {
CanBeSaved bool `json:"can_be_saved"`
// True, if the message can be shared in a story using inputStoryAreaTypeMessage
CanBeSharedInStory bool `json:"can_be_shared_in_story"`
// True, if the message can be edited using the method editMessageMedia
CanEditMedia bool `json:"can_edit_media"`
// True, if scheduling state of the message can be edited
CanEditSchedulingState bool `json:"can_edit_scheduling_state"`
// True, if code for message embedding can be received using getMessageEmbeddingCode
@ -33544,9 +33537,9 @@ func (*BusinessConnection) GetType() string {
// Describes a color to highlight a bot added to attachment menu
type AttachmentMenuBotColor struct {
meta
// Color in the RGB24 format for light themes
// Color in the RGB format for light themes
LightColor int32 `json:"light_color"`
// Color in the RGB24 format for dark themes
// Color in the RGB format for dark themes
DarkColor int32 `json:"dark_color"`
}
@ -39389,37 +39382,6 @@ func (*StorePaymentPurposePremiumSubscription) StorePaymentPurposeType() string
return TypeStorePaymentPurposePremiumSubscription
}
// The user gifting Telegram Premium to another user
type StorePaymentPurposeGiftedPremium struct {
meta
// Identifier of the user to which Telegram Premium is gifted
UserId int64 `json:"user_id"`
// ISO 4217 currency code of the payment currency
Currency string `json:"currency"`
// Paid amount, in the smallest units of the currency
Amount int64 `json:"amount"`
}
func (entity *StorePaymentPurposeGiftedPremium) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub StorePaymentPurposeGiftedPremium
return json.Marshal((*stub)(entity))
}
func (*StorePaymentPurposeGiftedPremium) GetClass() string {
return ClassStorePaymentPurpose
}
func (*StorePaymentPurposeGiftedPremium) GetType() string {
return TypeStorePaymentPurposeGiftedPremium
}
func (*StorePaymentPurposeGiftedPremium) StorePaymentPurposeType() string {
return TypeStorePaymentPurposeGiftedPremium
}
// The user creating Telegram Premium gift codes for other users
type StorePaymentPurposePremiumGiftCodes struct {
meta
@ -39431,6 +39393,8 @@ type StorePaymentPurposePremiumGiftCodes struct {
Amount int64 `json:"amount"`
// Identifiers of the users which can activate the gift codes
UserIds []int64 `json:"user_ids"`
// Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
Text *FormattedText `json:"text"`
}
func (entity *StorePaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) {
@ -39596,6 +39560,8 @@ type TelegramPaymentPurposePremiumGiftCodes struct {
UserIds []int64 `json:"user_ids"`
// Number of months the Telegram Premium subscription will be active for the users
MonthCount int32 `json:"month_count"`
// Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
Text *FormattedText `json:"text"`
}
func (entity *TelegramPaymentPurposePremiumGiftCodes) MarshalJSON() ([]byte, error) {
@ -40143,7 +40109,7 @@ func (*PushReceiverId) GetType() string {
// Describes a solid fill of a background
type BackgroundFillSolid struct {
meta
// A color of the background in the RGB24 format
// A color of the background in the RGB format
Color int32 `json:"color"`
}
@ -40170,9 +40136,9 @@ func (*BackgroundFillSolid) BackgroundFillType() string {
// Describes a gradient fill of a background
type BackgroundFillGradient struct {
meta
// A top color of the background in the RGB24 format
// A top color of the background in the RGB format
TopColor int32 `json:"top_color"`
// A bottom color of the background in the RGB24 format
// A bottom color of the background in the RGB format
BottomColor int32 `json:"bottom_color"`
// Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45
RotationAngle int32 `json:"rotation_angle"`
@ -40201,7 +40167,7 @@ func (*BackgroundFillGradient) BackgroundFillType() string {
// Describes a freeform gradient fill of a background
type BackgroundFillFreeformGradient struct {
meta
// A list of 3 or 4 colors of the freeform gradient in the RGB24 format
// A list of 3 or 4 colors of the freeform gradient in the RGB format
Colors []int32 `json:"colors"`
}
@ -45783,7 +45749,7 @@ func (*InternalLinkTypePremiumFeatures) InternalLinkTypeType() string {
return TypeInternalLinkTypePremiumFeatures
}
// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram payments or in-store purchases
// The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGiftCodes payments or in-store purchases
type InternalLinkTypePremiumGift struct {
meta
// Referrer specified in the link
@ -50477,7 +50443,7 @@ func (*UpdateMessageSendAcknowledged) UpdateType() string {
// A message has been successfully sent
type UpdateMessageSendSucceeded struct {
meta
// The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
// The sent message. Almost any field of the new message can be different from the corresponding field of the original message. For example, the field scheduling_state may change, making the message scheduled, or non-scheduled
Message *Message `json:"message"`
// The previous temporary message identifier
OldMessageId int64 `json:"old_message_id"`
@ -50857,6 +50823,35 @@ func (*UpdateMessageLiveLocationViewed) UpdateType() string {
return TypeUpdateMessageLiveLocationViewed
}
// An automatically scheduled message with video has been successfully sent after conversion
type UpdateVideoPublished struct {
meta
// Identifier of the chat with the message
ChatId int64 `json:"chat_id"`
// Identifier of the sent message
MessageId int64 `json:"message_id"`
}
func (entity *UpdateVideoPublished) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateVideoPublished
return json.Marshal((*stub)(entity))
}
func (*UpdateVideoPublished) GetClass() string {
return ClassUpdate
}
func (*UpdateVideoPublished) GetType() string {
return TypeUpdateVideoPublished
}
func (*UpdateVideoPublished) UpdateType() string {
return TypeUpdateVideoPublished
}
// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates
type UpdateNewChat struct {
meta
@ -54060,33 +54055,6 @@ func (*UpdateTermsOfService) UpdateType() string {
return TypeUpdateTermsOfService
}
// The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request
type UpdateUsersNearby struct {
meta
// The new list of users nearby
UsersNearby []*ChatNearby `json:"users_nearby"`
}
func (entity *UpdateUsersNearby) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateUsersNearby
return json.Marshal((*stub)(entity))
}
func (*UpdateUsersNearby) GetClass() string {
return ClassUpdate
}
func (*UpdateUsersNearby) GetType() string {
return TypeUpdateUsersNearby
}
func (*UpdateUsersNearby) UpdateType() string {
return TypeUpdateUsersNearby
}
// The first unconfirmed session has changed
type UpdateUnconfirmedSession struct {
meta

View file

@ -828,6 +828,9 @@ func UnmarshalStarTransactionPartner(data json.RawMessage) (StarTransactionPartn
case TypeStarTransactionPartnerTelegramAds:
return UnmarshalStarTransactionPartnerTelegramAds(data)
case TypeStarTransactionPartnerTelegramApi:
return UnmarshalStarTransactionPartnerTelegramApi(data)
case TypeStarTransactionPartnerBot:
return UnmarshalStarTransactionPartnerBot(data)
@ -1853,9 +1856,6 @@ func UnmarshalChatActionBar(data json.RawMessage) (ChatActionBar, error) {
case TypeChatActionBarReportSpam:
return UnmarshalChatActionBarReportSpam(data)
case TypeChatActionBarReportUnrelatedLocation:
return UnmarshalChatActionBarReportUnrelatedLocation(data)
case TypeChatActionBarInviteMembers:
return UnmarshalChatActionBarInviteMembers(data)
@ -3491,6 +3491,9 @@ func UnmarshalMessageSchedulingState(data json.RawMessage) (MessageSchedulingSta
case TypeMessageSchedulingStateSendWhenOnline:
return UnmarshalMessageSchedulingStateSendWhenOnline(data)
case TypeMessageSchedulingStateSendWhenVideoProcessed:
return UnmarshalMessageSchedulingStateSendWhenVideoProcessed(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -5441,9 +5444,6 @@ func UnmarshalStorePaymentPurpose(data json.RawMessage) (StorePaymentPurpose, er
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposeGiftedPremium:
return UnmarshalStorePaymentPurposeGiftedPremium(data)
case TypeStorePaymentPurposePremiumGiftCodes:
return UnmarshalStorePaymentPurposePremiumGiftCodes(data)
@ -7713,6 +7713,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateMessageLiveLocationViewed:
return UnmarshalUpdateMessageLiveLocationViewed(data)
case TypeUpdateVideoPublished:
return UnmarshalUpdateVideoPublished(data)
case TypeUpdateNewChat:
return UnmarshalUpdateNewChat(data)
@ -8001,9 +8004,6 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateTermsOfService:
return UnmarshalUpdateTermsOfService(data)
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(data)
case TypeUpdateUnconfirmedSession:
return UnmarshalUpdateUnconfirmedSession(data)
@ -9532,6 +9532,14 @@ func UnmarshalStarTransactionPartnerTelegramAds(data json.RawMessage) (*StarTran
return &resp, err
}
func UnmarshalStarTransactionPartnerTelegramApi(data json.RawMessage) (*StarTransactionPartnerTelegramApi, error) {
var resp StarTransactionPartnerTelegramApi
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStarTransactionPartnerBot(data json.RawMessage) (*StarTransactionPartnerBot, error) {
var resp StarTransactionPartnerBot
@ -11036,22 +11044,6 @@ func UnmarshalCreatedBasicGroupChat(data json.RawMessage) (*CreatedBasicGroupCha
return &resp, err
}
func UnmarshalChatNearby(data json.RawMessage) (*ChatNearby, error) {
var resp ChatNearby
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatsNearby(data json.RawMessage) (*ChatsNearby, error) {
var resp ChatsNearby
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPublicChatTypeHasUsername(data json.RawMessage) (*PublicChatTypeHasUsername, error) {
var resp PublicChatTypeHasUsername
@ -11076,14 +11068,6 @@ func UnmarshalChatActionBarReportSpam(data json.RawMessage) (*ChatActionBarRepor
return &resp, err
}
func UnmarshalChatActionBarReportUnrelatedLocation(data json.RawMessage) (*ChatActionBarReportUnrelatedLocation, error) {
var resp ChatActionBarReportUnrelatedLocation
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatActionBarInviteMembers(data json.RawMessage) (*ChatActionBarInviteMembers, error) {
var resp ChatActionBarInviteMembers
@ -13900,6 +13884,14 @@ func UnmarshalMessageSchedulingStateSendWhenOnline(data json.RawMessage) (*Messa
return &resp, err
}
func UnmarshalMessageSchedulingStateSendWhenVideoProcessed(data json.RawMessage) (*MessageSchedulingStateSendWhenVideoProcessed, error) {
var resp MessageSchedulingStateSendWhenVideoProcessed
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageSelfDestructTypeTimer(data json.RawMessage) (*MessageSelfDestructTypeTimer, error) {
var resp MessageSelfDestructTypeTimer
@ -16908,14 +16900,6 @@ func UnmarshalStorePaymentPurposePremiumSubscription(data json.RawMessage) (*Sto
return &resp, err
}
func UnmarshalStorePaymentPurposeGiftedPremium(data json.RawMessage) (*StorePaymentPurposeGiftedPremium, error) {
var resp StorePaymentPurposeGiftedPremium
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalStorePaymentPurposePremiumGiftCodes(data json.RawMessage) (*StorePaymentPurposePremiumGiftCodes, error) {
var resp StorePaymentPurposePremiumGiftCodes
@ -20036,6 +20020,14 @@ func UnmarshalUpdateMessageLiveLocationViewed(data json.RawMessage) (*UpdateMess
return &resp, err
}
func UnmarshalUpdateVideoPublished(data json.RawMessage) (*UpdateVideoPublished, error) {
var resp UpdateVideoPublished
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateNewChat(data json.RawMessage) (*UpdateNewChat, error) {
var resp UpdateNewChat
@ -20804,14 +20796,6 @@ func UnmarshalUpdateTermsOfService(data json.RawMessage) (*UpdateTermsOfService,
return &resp, err
}
func UnmarshalUpdateUsersNearby(data json.RawMessage) (*UpdateUsersNearby, error) {
var resp UpdateUsersNearby
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateUnconfirmedSession(data json.RawMessage) (*UpdateUnconfirmedSession, error) {
var resp UpdateUnconfirmedSession
@ -21760,6 +21744,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStarTransactionPartnerTelegramAds:
return UnmarshalStarTransactionPartnerTelegramAds(data)
case TypeStarTransactionPartnerTelegramApi:
return UnmarshalStarTransactionPartnerTelegramApi(data)
case TypeStarTransactionPartnerBot:
return UnmarshalStarTransactionPartnerBot(data)
@ -22324,12 +22311,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeCreatedBasicGroupChat:
return UnmarshalCreatedBasicGroupChat(data)
case TypeChatNearby:
return UnmarshalChatNearby(data)
case TypeChatsNearby:
return UnmarshalChatsNearby(data)
case TypePublicChatTypeHasUsername:
return UnmarshalPublicChatTypeHasUsername(data)
@ -22339,9 +22320,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatActionBarReportSpam:
return UnmarshalChatActionBarReportSpam(data)
case TypeChatActionBarReportUnrelatedLocation:
return UnmarshalChatActionBarReportUnrelatedLocation(data)
case TypeChatActionBarInviteMembers:
return UnmarshalChatActionBarInviteMembers(data)
@ -23398,6 +23376,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageSchedulingStateSendWhenOnline:
return UnmarshalMessageSchedulingStateSendWhenOnline(data)
case TypeMessageSchedulingStateSendWhenVideoProcessed:
return UnmarshalMessageSchedulingStateSendWhenVideoProcessed(data)
case TypeMessageSelfDestructTypeTimer:
return UnmarshalMessageSelfDestructTypeTimer(data)
@ -24526,9 +24507,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeStorePaymentPurposePremiumSubscription:
return UnmarshalStorePaymentPurposePremiumSubscription(data)
case TypeStorePaymentPurposeGiftedPremium:
return UnmarshalStorePaymentPurposeGiftedPremium(data)
case TypeStorePaymentPurposePremiumGiftCodes:
return UnmarshalStorePaymentPurposePremiumGiftCodes(data)
@ -25699,6 +25677,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateMessageLiveLocationViewed:
return UnmarshalUpdateMessageLiveLocationViewed(data)
case TypeUpdateVideoPublished:
return UnmarshalUpdateVideoPublished(data)
case TypeUpdateNewChat:
return UnmarshalUpdateNewChat(data)
@ -25987,9 +25968,6 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateTermsOfService:
return UnmarshalUpdateTermsOfService(data)
case TypeUpdateUsersNearby:
return UnmarshalUpdateUsersNearby(data)
case TypeUpdateUnconfirmedSession:
return UnmarshalUpdateUnconfirmedSession(data)