Update to TDLib 1.8.62

This commit is contained in:
c0re100 2026-03-01 21:05:00 +08:00
parent c9c7701a0d
commit b64a6e63b5
No known key found for this signature in database
GPG key ID: 7C3B3004FE745AAF
4 changed files with 1302 additions and 75 deletions

View file

@ -1505,7 +1505,7 @@ type GetRepliedMessageRequest struct {
MessageId int64 `json:"message_id"`
}
// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist
// Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted, the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined, messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, the message with gift purchase offer for messageUpgradedGiftPurchaseOfferRejected, the message with the request to disable content protection for messageChatHasProtectedContentToggled, and the topic creation message for topic messages without non-bundled replied message. Returns a 404 error if the message doesn't exist
func (client *Client) GetRepliedMessage(req *GetRepliedMessageRequest) (*Message, error) {
result, err := client.Send(Request{
meta: meta{
@ -8286,7 +8286,7 @@ type GetPollVotersRequest struct {
}
// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib
func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders, error) {
func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*PollVoters, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getPollVoters",
@ -8307,7 +8307,7 @@ func (client *Client) GetPollVoters(req *GetPollVotersRequest) (*MessageSenders,
return nil, buildResponseError(result.Data)
}
return UnmarshalMessageSenders(result.Data)
return UnmarshalPollVoters(result.Data)
}
type StopPollRequest struct {
@ -9785,6 +9785,9 @@ func (client *Client) GetInternalLinkType(req *GetInternalLinkTypeRequest) (Inte
case TypeInternalLinkTypeNewStory:
return UnmarshalInternalLinkTypeNewStory(result.Data)
case TypeInternalLinkTypeOauth:
return UnmarshalInternalLinkTypeOauth(result.Data)
case TypeInternalLinkTypePassportDataRequest:
return UnmarshalInternalLinkTypePassportDataRequest(result.Data)
@ -9899,8 +9902,6 @@ type GetExternalLinkRequest struct {
Link string `json:"link"`
// Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to send them messages
AllowWriteAccess bool `json:"allow_write_access"`
// Pass true if the current user allowed the bot that was returned in getExternalLinkInfo, to access their phone number
AllowPhoneNumberAccess bool `json:"allow_phone_number_access"`
}
// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed. May return an empty link if just a toast about successful login has to be shown
@ -9912,6 +9913,98 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er
Data: map[string]interface{}{
"link": req.Link,
"allow_write_access": req.AllowWriteAccess,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalHttpUrl(result.Data)
}
type GetOauthLinkInfoRequest struct {
// URL of the link
Url string `json:"url"`
// Origin of the OAuth request if the request was received from the in-app browser; pass an empty string otherwise
InAppOrigin string `json:"in_app_origin"`
}
// Returns information about an OAuth deep link. Use checkOauthRequestMatchCode, acceptOauthRequest or declineOauthRequest to process the link
func (client *Client) GetOauthLinkInfo(req *GetOauthLinkInfoRequest) (*OauthLinkInfo, error) {
result, err := client.Send(Request{
meta: meta{
Type: "getOauthLinkInfo",
},
Data: map[string]interface{}{
"url": req.Url,
"in_app_origin": req.InAppOrigin,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOauthLinkInfo(result.Data)
}
type CheckOauthRequestMatchCodeRequest struct {
// URL of the OAuth deep link
Url string `json:"url"`
// The matching code chosen by the user
MatchCode string `json:"match_code"`
}
// Checks a match-code for an OAuth authorization request. If fails, then the authorization request has failed. Otherwise, authorization confirmation dialog must be shown and the link must be processed using acceptOauthRequest or declineOauthRequest
func (client *Client) CheckOauthRequestMatchCode(req *CheckOauthRequestMatchCodeRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "checkOauthRequestMatchCode",
},
Data: map[string]interface{}{
"url": req.Url,
"match_code": req.MatchCode,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type AcceptOauthRequestRequest struct {
// URL of the OAuth deep link
Url string `json:"url"`
// The matching code chosen by the user
MatchCode string `json:"match_code"`
// Pass true if the current user allowed the bot that was returned in getOauthLinkInfo, to send them messages
AllowWriteAccess bool `json:"allow_write_access"`
// Pass true if the current user allowed the bot that was returned in getOauthLinkInfo, to access their phone number
AllowPhoneNumberAccess bool `json:"allow_phone_number_access"`
}
// Accepts an OAuth authorization request. Returns an HTTP URL to open after successful authorization. May return an empty link if just a toast about successful login has to be shown
func (client *Client) AcceptOauthRequest(req *AcceptOauthRequestRequest) (*HttpUrl, error) {
result, err := client.Send(Request{
meta: meta{
Type: "acceptOauthRequest",
},
Data: map[string]interface{}{
"url": req.Url,
"match_code": req.MatchCode,
"allow_write_access": req.AllowWriteAccess,
"allow_phone_number_access": req.AllowPhoneNumberAccess,
},
})
@ -9926,6 +10019,32 @@ func (client *Client) GetExternalLink(req *GetExternalLinkRequest) (*HttpUrl, er
return UnmarshalHttpUrl(result.Data)
}
type DeclineOauthRequestRequest struct {
// URL of the OAuth deep link
Url string `json:"url"`
}
// Declines an OAuth authorization request
func (client *Client) DeclineOauthRequest(req *DeclineOauthRequestRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "declineOauthRequest",
},
Data: map[string]interface{}{
"url": req.Url,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ReadAllChatMentionsRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -11246,7 +11365,7 @@ type ToggleChatHasProtectedContentRequest struct {
HasProtectedContent bool `json:"has_protected_content"`
}
// Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
// Changes the ability of users to save, forward, or copy chat content. Requires owner privileges in basic groups, supergroups and channels. Requires Telegram Premium to enable protected content in private chats. Not available in Saved Messages and private chats with bots or support accounts
func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedContentRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -11268,6 +11387,38 @@ func (client *Client) ToggleChatHasProtectedContent(req *ToggleChatHasProtectedC
return UnmarshalOk(result.Data)
}
type ProcessChatHasProtectedContentDisableRequestRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the message with the request. The message must be incoming and has content of the type messageChatHasProtectedContentDisableRequested
RequestMessageId int64 `json:"request_message_id"`
// Pass true to approve the request; pass false to reject the request
Approve bool `json:"approve"`
}
// Processes request to disable has_protected_content in a chat
func (client *Client) ProcessChatHasProtectedContentDisableRequest(req *ProcessChatHasProtectedContentDisableRequestRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "processChatHasProtectedContentDisableRequest",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"request_message_id": req.RequestMessageId,
"approve": req.Approve,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type ToggleChatViewAsTopicsRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -11825,6 +11976,38 @@ func (client *Client) SetChatMemberStatus(req *SetChatMemberStatusRequest) (*Ok,
return UnmarshalOk(result.Data)
}
type SetChatMemberTagRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the user, which tag is changed. Chats can't have member tags
UserId int64 `json:"user_id"`
// The new tag of the member in the chat; 0-16 characters without emoji
Tag string `json:"tag"`
}
// Changes the tag or custom title of a chat member; requires can_manage_tags administrator right to change tag of other users; for basic groups and supergroups only
func (client *Client) SetChatMemberTag(req *SetChatMemberTagRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
Type: "setChatMemberTag",
},
Data: map[string]interface{}{
"chat_id": req.ChatId,
"user_id": req.UserId,
"tag": req.Tag,
},
})
if err != nil {
return nil, err
}
if result.Type == "error" {
return nil, buildResponseError(result.Data)
}
return UnmarshalOk(result.Data)
}
type BanChatMemberRequest struct {
// Chat identifier
ChatId int64 `json:"chat_id"`
@ -11903,7 +12086,7 @@ type TransferChatOwnershipRequest struct {
Password string `json:"password"`
}
// Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
// Changes the owner of a chat; for basic groups, supergroups and channel chats only; requires owner privileges in the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session
func (client *Client) TransferChatOwnership(req *TransferChatOwnershipRequest) (*Ok, error) {
result, err := client.Send(Request{
meta: meta{
@ -11931,7 +12114,7 @@ type GetChatOwnerAfterLeavingRequest struct {
ChatId int64 `json:"chat_id"`
}
// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the chat during that period; requires owner privileges in the chat. Available only for supergroups and channel chats
// Returns the user who will become the owner of the chat after 7 days if the current user does not return to the supergroup or channel during that period or immediately for basic groups; requires owner privileges in the chat. Available only for supergroups and channel chats
func (client *Client) GetChatOwnerAfterLeaving(req *GetChatOwnerAfterLeavingRequest) (*User, error) {
result, err := client.Send(Request{
meta: meta{
@ -15443,7 +15626,7 @@ func (client *Client) DiscardCall(req *DiscardCallRequest) (*Ok, error) {
type SendCallRatingRequest struct {
// Call identifier
CallId int32 `json:"call_id"`
CallId InputCall `json:"call_id"`
// Call rating; 1-5
Rating int32 `json:"rating"`
// An optional user comment if the rating is less than 5
@ -15478,7 +15661,7 @@ func (client *Client) SendCallRating(req *SendCallRatingRequest) (*Ok, error) {
type SendCallDebugInformationRequest struct {
// Call identifier
CallId int32 `json:"call_id"`
CallId InputCall `json:"call_id"`
// Debug information in application-specific format
DebugInformation string `json:"debug_information"`
}
@ -15507,7 +15690,7 @@ func (client *Client) SendCallDebugInformation(req *SendCallDebugInformationRequ
type SendCallLogRequest struct {
// Call identifier
CallId int32 `json:"call_id"`
CallId InputCall `json:"call_id"`
// Call log file. Only inputFileLocal and inputFileGenerated are supported
LogFile InputFile `json:"log_file"`
}
@ -15600,7 +15783,7 @@ type CreateVideoChatRequest struct {
IsRtmpStream bool `json:"is_rtmp_stream"`
}
// Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right
// Creates a video chat (a group call bound to a chat); for basic groups, supergroups and channels only; requires can_manage_video_chats administrator right
func (client *Client) CreateVideoChat(req *CreateVideoChatRequest) (*GroupCallId, error) {
result, err := client.Send(Request{
meta: meta{
@ -22484,7 +22667,7 @@ func (client *Client) BuyGiftUpgrade(req *BuyGiftUpgradeRequest) (*Ok, error) {
}
type CraftGiftRequest struct {
// Identifier of the gifts to use for crafting
// Identifier of the gifts to use for crafting. In the case of a successful craft, the resulting gift will have the number of the first gift. Consequently, the first gift must not have been withdrawn to the TON blockchain as an NFT and must have an empty gift_address
ReceivedGiftIds []string `json:"received_gift_ids"`
}
@ -28522,6 +28705,9 @@ func (client *Client) TestUseUpdate() (Update, error) {
case TypeUpdateServiceNotification:
return UnmarshalUpdateServiceNotification(result.Data)
case TypeUpdateNewOauthRequest:
return UnmarshalUpdateNewOauthRequest(result.Data)
case TypeUpdateFile:
return UnmarshalUpdateFile(result.Data)

View file

@ -101,6 +101,8 @@ const (
ClassPassportElementErrorSource = "PassportElementErrorSource"
ClassInputPassportElementErrorSource = "InputPassportElementErrorSource"
ClassMessageContent = "MessageContent"
ClassDateTimePartPrecision = "DateTimePartPrecision"
ClassDateTimeFormattingType = "DateTimeFormattingType"
ClassTextEntityType = "TextEntityType"
ClassInputPaidMediaType = "InputPaidMediaType"
ClassMessageSchedulingState = "MessageSchedulingState"
@ -125,6 +127,7 @@ const (
ClassResendCodeReason = "ResendCodeReason"
ClassCallDiscardReason = "CallDiscardReason"
ClassCallServerType = "CallServerType"
ClassInputCall = "InputCall"
ClassCallState = "CallState"
ClassGroupCallVideoQuality = "GroupCallVideoQuality"
ClassInviteGroupCallParticipantResult = "InviteGroupCallParticipantResult"
@ -387,6 +390,8 @@ const (
ClassMessageSenders = "MessageSenders"
ClassChatMessageSender = "ChatMessageSender"
ClassChatMessageSenders = "ChatMessageSenders"
ClassPollVoter = "PollVoter"
ClassPollVoters = "PollVoters"
ClassMessageViewer = "MessageViewer"
ClassMessageViewers = "MessageViewers"
ClassForwardSource = "ForwardSource"
@ -453,6 +458,7 @@ const (
ClassAccountInfo = "AccountInfo"
ClassKeyboardButton = "KeyboardButton"
ClassInlineKeyboardButton = "InlineKeyboardButton"
ClassOauthLinkInfo = "OauthLinkInfo"
ClassThemeParameters = "ThemeParameters"
ClassFoundWebApp = "FoundWebApp"
ClassWebAppInfo = "WebAppInfo"
@ -1110,6 +1116,8 @@ const (
TypeMessageSenders = "messageSenders"
TypeChatMessageSender = "chatMessageSender"
TypeChatMessageSenders = "chatMessageSenders"
TypePollVoter = "pollVoter"
TypePollVoters = "pollVoters"
TypeMessageReadDateRead = "messageReadDateRead"
TypeMessageReadDateUnread = "messageReadDateUnread"
TypeMessageReadDateTooOld = "messageReadDateTooOld"
@ -1272,6 +1280,7 @@ const (
TypeReplyMarkupInlineKeyboard = "replyMarkupInlineKeyboard"
TypeLoginUrlInfoOpen = "loginUrlInfoOpen"
TypeLoginUrlInfoRequestConfirmation = "loginUrlInfoRequestConfirmation"
TypeOauthLinkInfo = "oauthLinkInfo"
TypeThemeParameters = "themeParameters"
TypeWebAppOpenModeCompact = "webAppOpenModeCompact"
TypeWebAppOpenModeFullSize = "webAppOpenModeFullSize"
@ -1548,6 +1557,8 @@ const (
TypeMessageChatDeletePhoto = "messageChatDeletePhoto"
TypeMessageChatOwnerLeft = "messageChatOwnerLeft"
TypeMessageChatOwnerChanged = "messageChatOwnerChanged"
TypeMessageChatHasProtectedContentToggled = "messageChatHasProtectedContentToggled"
TypeMessageChatHasProtectedContentDisableRequested = "messageChatHasProtectedContentDisableRequested"
TypeMessageChatAddMembers = "messageChatAddMembers"
TypeMessageChatJoinByLink = "messageChatJoinByLink"
TypeMessageChatJoinByRequest = "messageChatJoinByRequest"
@ -1605,6 +1616,11 @@ const (
TypeMessagePassportDataReceived = "messagePassportDataReceived"
TypeMessageProximityAlertTriggered = "messageProximityAlertTriggered"
TypeMessageUnsupported = "messageUnsupported"
TypeDateTimePartPrecisionNone = "dateTimePartPrecisionNone"
TypeDateTimePartPrecisionShort = "dateTimePartPrecisionShort"
TypeDateTimePartPrecisionLong = "dateTimePartPrecisionLong"
TypeDateTimeFormattingTypeRelative = "dateTimeFormattingTypeRelative"
TypeDateTimeFormattingTypeAbsolute = "dateTimeFormattingTypeAbsolute"
TypeTextEntityTypeMention = "textEntityTypeMention"
TypeTextEntityTypeHashtag = "textEntityTypeHashtag"
TypeTextEntityTypeCashtag = "textEntityTypeCashtag"
@ -1627,6 +1643,7 @@ const (
TypeTextEntityTypeMentionName = "textEntityTypeMentionName"
TypeTextEntityTypeCustomEmoji = "textEntityTypeCustomEmoji"
TypeTextEntityTypeMediaTimestamp = "textEntityTypeMediaTimestamp"
TypeTextEntityTypeDateTime = "textEntityTypeDateTime"
TypeInputThumbnail = "inputThumbnail"
TypeInputPaidMediaTypePhoto = "inputPaidMediaTypePhoto"
TypeInputPaidMediaTypeVideo = "inputPaidMediaTypeVideo"
@ -1801,6 +1818,8 @@ const (
TypeCallServer = "callServer"
TypeCallId = "callId"
TypeGroupCallId = "groupCallId"
TypeInputCallDiscarded = "inputCallDiscarded"
TypeInputCallFromMessage = "inputCallFromMessage"
TypeCallStatePending = "callStatePending"
TypeCallStateExchangingKeys = "callStateExchangingKeys"
TypeCallStateReady = "callStateReady"
@ -1922,6 +1941,7 @@ const (
TypeChatEventMemberLeft = "chatEventMemberLeft"
TypeChatEventMemberPromoted = "chatEventMemberPromoted"
TypeChatEventMemberRestricted = "chatEventMemberRestricted"
TypeChatEventMemberTagChanged = "chatEventMemberTagChanged"
TypeChatEventMemberSubscriptionExtended = "chatEventMemberSubscriptionExtended"
TypeChatEventAvailableReactionsChanged = "chatEventAvailableReactionsChanged"
TypeChatEventBackgroundChanged = "chatEventBackgroundChanged"
@ -2017,6 +2037,7 @@ const (
TypePremiumFeatureMessageEffects = "premiumFeatureMessageEffects"
TypePremiumFeatureChecklists = "premiumFeatureChecklists"
TypePremiumFeaturePaidMessages = "premiumFeaturePaidMessages"
TypePremiumFeatureProtectPrivateChatContent = "premiumFeatureProtectPrivateChatContent"
TypeBusinessFeatureLocation = "businessFeatureLocation"
TypeBusinessFeatureOpeningHours = "businessFeatureOpeningHours"
TypeBusinessFeatureQuickReplies = "businessFeatureQuickReplies"
@ -2322,6 +2343,7 @@ const (
TypeInternalLinkTypeNewGroupChat = "internalLinkTypeNewGroupChat"
TypeInternalLinkTypeNewPrivateChat = "internalLinkTypeNewPrivateChat"
TypeInternalLinkTypeNewStory = "internalLinkTypeNewStory"
TypeInternalLinkTypeOauth = "internalLinkTypeOauth"
TypeInternalLinkTypePassportDataRequest = "internalLinkTypePassportDataRequest"
TypeInternalLinkTypePhoneNumberConfirmation = "internalLinkTypePhoneNumberConfirmation"
TypeInternalLinkTypePremiumFeaturesPage = "internalLinkTypePremiumFeaturesPage"
@ -2573,6 +2595,7 @@ const (
TypeUpdateBasicGroupFullInfo = "updateBasicGroupFullInfo"
TypeUpdateSupergroupFullInfo = "updateSupergroupFullInfo"
TypeUpdateServiceNotification = "updateServiceNotification"
TypeUpdateNewOauthRequest = "updateNewOauthRequest"
TypeUpdateFile = "updateFile"
TypeUpdateFileGenerationStart = "updateFileGenerationStart"
TypeUpdateFileGenerationStop = "updateFileGenerationStop"
@ -3039,7 +3062,7 @@ type ReplyMarkup interface {
ReplyMarkupType() string
}
// Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl
// Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl or an external link
type LoginUrlInfo interface {
LoginUrlInfoType() string
}
@ -3154,6 +3177,16 @@ type MessageContent interface {
MessageContentType() string
}
// Describes precision with which to show a date or a time
type DateTimePartPrecision interface {
DateTimePartPrecisionType() string
}
// Describes date and time formatting
type DateTimeFormattingType interface {
DateTimeFormattingTypeType() string
}
// Represents a part of the text which must be formatted differently
type TextEntityType interface {
TextEntityTypeType() string
@ -3274,6 +3307,11 @@ type CallServerType interface {
CallServerTypeType() string
}
// Describes a call
type InputCall interface {
InputCallType() string
}
// Describes the current call state
type CallState interface {
CallStateType() string
@ -8485,6 +8523,8 @@ type ChatPermissions struct {
CanUseInlineBots bool `json:"can_use_inline_bots"`
// True, if the user may add a link preview to their messages
CanAddLinkPreviews bool `json:"can_add_link_previews"`
// True, if the user may change the tag of self
CanEditTag bool `json:"can_edit_tag"`
// True, if the user can change the chat title, photo, and other settings
CanChangeInfo bool `json:"can_change_info"`
// True, if the user can invite new users to the chat
@ -8544,6 +8584,8 @@ type ChatAdministratorRights struct {
CanDeleteStories bool `json:"can_delete_stories"`
// True, if the administrator can answer to channel direct messages; applicable to channels only
CanManageDirectMessages bool `json:"can_manage_direct_messages"`
// True, if the administrator can change tags of other users; applicable to basic groups and supergroups only
CanManageTags bool `json:"can_manage_tags"`
// True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
IsAnonymous bool `json:"is_anonymous"`
}
@ -15602,8 +15644,6 @@ func (*ChatAdministrators) GetType() string {
// The user is the owner of the chat and has all the administrator privileges
type ChatMemberStatusCreator struct {
meta
// A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only
CustomTitle string `json:"custom_title"`
// True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
IsAnonymous bool `json:"is_anonymous"`
// True, if the user is a member of the chat
@ -15633,8 +15673,6 @@ func (*ChatMemberStatusCreator) ChatMemberStatusType() string {
// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges
type ChatMemberStatusAdministrator struct {
meta
// A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only
CustomTitle string `json:"custom_title"`
// True, if the current user can edit the administrator privileges for the called user
CanBeEdited bool `json:"can_be_edited"`
// Rights of the administrator
@ -15776,6 +15814,8 @@ type ChatMember struct {
meta
// Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels
MemberId MessageSender `json:"member_id"`
// Tag of the chat member or its custom title if the member is an administrator of the chat; 0-16 characters without emoji; applicable to basic groups and supergroups only
Tag string `json:"tag"`
// Identifier of a user who invited/promoted/banned this member in the chat; 0 if unknown
InviterUserId int64 `json:"inviter_user_id"`
// Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
@ -15803,6 +15843,7 @@ func (*ChatMember) GetType() string {
func (chatMember *ChatMember) UnmarshalJSON(data []byte) error {
var tmp struct {
MemberId json.RawMessage `json:"member_id"`
Tag string `json:"tag"`
InviterUserId int64 `json:"inviter_user_id"`
JoinedChatDate int32 `json:"joined_chat_date"`
Status json.RawMessage `json:"status"`
@ -15813,6 +15854,7 @@ func (chatMember *ChatMember) UnmarshalJSON(data []byte) error {
return err
}
chatMember.Tag = tmp.Tag
chatMember.InviterUserId = tmp.InviterUserId
chatMember.JoinedChatDate = tmp.JoinedChatDate
@ -16823,7 +16865,7 @@ type Supergroup struct {
Usernames *Usernames `json:"usernames"`
// Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
Date int32 `json:"date"`
// Status of the current user in the supergroup or channel; custom title will always be empty
// Status of the current user in the supergroup or channel
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, getChatsToPostStories, 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"`
@ -17373,7 +17415,7 @@ func (*MessageSenderChat) MessageSenderType() string {
// Represents a list of message senders
type MessageSenders struct {
meta
// Approximate total number of messages senders found
// Approximate total number of message senders found
TotalCount int32 `json:"total_count"`
// List of message senders
Senders []MessageSender `json:"senders"`
@ -17481,6 +17523,75 @@ func (*ChatMessageSenders) GetType() string {
return TypeChatMessageSenders
}
// Represents a poll voter
type PollVoter struct {
meta
// The voter identifier
VoterId MessageSender `json:"voter_id"`
// Point in time (Unix timestamp) when the vote was added
Date int32 `json:"date"`
}
func (entity *PollVoter) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PollVoter
return json.Marshal((*stub)(entity))
}
func (*PollVoter) GetClass() string {
return ClassPollVoter
}
func (*PollVoter) GetType() string {
return TypePollVoter
}
func (pollVoter *PollVoter) UnmarshalJSON(data []byte) error {
var tmp struct {
VoterId json.RawMessage `json:"voter_id"`
Date int32 `json:"date"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
pollVoter.Date = tmp.Date
fieldVoterId, _ := UnmarshalMessageSender(tmp.VoterId)
pollVoter.VoterId = fieldVoterId
return nil
}
// Represents a list of poll voters
type PollVoters struct {
meta
// Approximate total number of poll voters found
TotalCount int32 `json:"total_count"`
// List of poll voters
Voters []*PollVoter `json:"voters"`
}
func (entity *PollVoters) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PollVoters
return json.Marshal((*stub)(entity))
}
func (*PollVoters) GetClass() string {
return ClassPollVoters
}
func (*PollVoters) GetType() string {
return TypePollVoters
}
// Contains read date of the message
type MessageReadDateRead struct {
meta
@ -18986,6 +19097,8 @@ type Message struct {
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
// Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead
SenderBoostCount int32 `json:"sender_boost_count"`
// Tag of the sender of the message in the supergroup at the time the message was sent; may be empty if none or unknown. For messages sent in basic groups or supergroup administrators, the current custom title or tag must be used instead
SenderTag string `json:"sender_tag"`
// The number of Telegram Stars the sender paid to send the message
PaidMessageStarCount int64 `json:"paid_message_star_count"`
// For channel posts and anonymous group messages, optional author signature
@ -19052,6 +19165,7 @@ func (message *Message) UnmarshalJSON(data []byte) error {
ViaBotUserId int64 `json:"via_bot_user_id"`
SenderBusinessBotUserId int64 `json:"sender_business_bot_user_id"`
SenderBoostCount int32 `json:"sender_boost_count"`
SenderTag string `json:"sender_tag"`
PaidMessageStarCount int64 `json:"paid_message_star_count"`
AuthorSignature string `json:"author_signature"`
MediaAlbumId JsonInt64 `json:"media_album_id"`
@ -19091,6 +19205,7 @@ func (message *Message) UnmarshalJSON(data []byte) error {
message.ViaBotUserId = tmp.ViaBotUserId
message.SenderBusinessBotUserId = tmp.SenderBusinessBotUserId
message.SenderBoostCount = tmp.SenderBoostCount
message.SenderTag = tmp.SenderTag
message.PaidMessageStarCount = tmp.PaidMessageStarCount
message.AuthorSignature = tmp.AuthorSignature
message.MediaAlbumId = tmp.MediaAlbumId
@ -21419,7 +21534,7 @@ type Chat struct {
VideoChat *VideoChat `json:"video_chat"`
// Information about pending join requests; may be null if none
PendingJoinRequests *ChatJoinRequestsInfo `json:"pending_join_requests"`
// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
// Identifier of the message from which reply markup needs to be used; 0 if there is no reply markup in the chat
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
// A draft of a message in the chat; may be null if none
DraftMessage *DraftMessage `json:"draft_message"`
@ -22621,7 +22736,7 @@ func (inlineKeyboardButton *InlineKeyboardButton) UnmarshalJSON(data []byte) err
return nil
}
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent
// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with reply_markup_message == null will be sent
type ReplyMarkupRemoveKeyboard struct {
meta
// True, if the keyboard is removed only for the mentioned users or the target user of a reply
@ -22781,16 +22896,6 @@ type LoginUrlInfoRequestConfirmation struct {
BotUserId int64 `json:"bot_user_id"`
// True, if the user must be asked for the permission to the bot to send them messages
RequestWriteAccess bool `json:"request_write_access"`
// True, if the user must be asked for the permission to share their phone number
RequestPhoneNumberAccess bool `json:"request_phone_number_access"`
// The version of a browser used for the authorization; may be empty if irrelevant
Browser string `json:"browser"`
// Operating system the browser is running on; may be empty if irrelevant
Platform string `json:"platform"`
// IP address from which the authorization is performed, in human-readable format; may be empty if irrelevant
IpAddress string `json:"ip_address"`
// Human-readable description of a country and a region from which the authorization is performed, based on the IP address; may be empty if irrelevant
Location string `json:"location"`
}
func (entity *LoginUrlInfoRequestConfirmation) MarshalJSON() ([]byte, error) {
@ -22813,6 +22918,51 @@ func (*LoginUrlInfoRequestConfirmation) LoginUrlInfoType() string {
return TypeLoginUrlInfoRequestConfirmation
}
// Information about the OAuth authorization
type OauthLinkInfo struct {
meta
// Identifier of the user for which the link was generated; may be 0 if unknown. The corresponding user may be unknown. If the user is logged in the app, then they must be chosen for authorization by default
UserId int64 `json:"user_id"`
// An HTTP URL where the user authorizes
Url string `json:"url"`
// A domain of the URL
Domain string `json:"domain"`
// User identifier of a bot linked with the website
BotUserId int64 `json:"bot_user_id"`
// True, if the user must be asked for the permission to the bot to send them messages
RequestWriteAccess bool `json:"request_write_access"`
// True, if the user must be asked for the permission to share their phone number
RequestPhoneNumberAccess bool `json:"request_phone_number_access"`
// The version of a browser used for the authorization
Browser string `json:"browser"`
// Operating system the browser is running on
Platform string `json:"platform"`
// IP address from which the authorization is performed, in human-readable format
IpAddress string `json:"ip_address"`
// Human-readable description of a country and a region from which the authorization is performed, based on the IP address
Location string `json:"location"`
// True, if code matching dialog must be shown first and checkOauthRequestMatchCode must be called before acceptOauthRequest. Otherwise, checkOauthRequestMatchCode must not be called
MatchCodeFirst bool `json:"match_code_first"`
// The list of codes to match; may be empty if irrelevant
MatchCodes []string `json:"match_codes"`
}
func (entity *OauthLinkInfo) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub OauthLinkInfo
return json.Marshal((*stub)(entity))
}
func (*OauthLinkInfo) GetClass() string {
return ClassOauthLinkInfo
}
func (*OauthLinkInfo) GetType() string {
return TypeOauthLinkInfo
}
// Contains parameters of the application theme
type ThemeParameters struct {
meta
@ -26509,6 +26659,8 @@ type LinkPreviewTypeEmbeddedAnimationPlayer struct {
meta
// URL of the external animation player
Url string `json:"url"`
// The cached animation; may be null if unknown
Animation *Animation `json:"animation"`
// Thumbnail of the animation; may be null if unknown
Thumbnail *Photo `json:"thumbnail"`
// Duration of the animation, in seconds
@ -26544,6 +26696,8 @@ type LinkPreviewTypeEmbeddedAudioPlayer struct {
meta
// URL of the external audio player
Url string `json:"url"`
// The cached audio; may be null if unknown
Audio *Audio `json:"audio"`
// Thumbnail of the audio; may be null if unknown
Thumbnail *Photo `json:"thumbnail"`
// Duration of the audio, in seconds
@ -26579,6 +26733,8 @@ type LinkPreviewTypeEmbeddedVideoPlayer struct {
meta
// URL of the external video player
Url string `json:"url"`
// The cached video; may be null if unknown
Video *Video `json:"video"`
// Thumbnail of the video; may be null if unknown
Thumbnail *Photo `json:"thumbnail"`
// Duration of the video, in seconds
@ -31682,6 +31838,8 @@ func (messageInvoice *MessageInvoice) UnmarshalJSON(data []byte) error {
// A message with information about an ended call
type MessageCall struct {
meta
// Persistent unique call identifier; 0 for calls from other devices, which can't be passed as inputCallFromMessage
UniqueId JsonInt64 `json:"unique_id"`
// True, if the call was a video call
IsVideo bool `json:"is_video"`
// Reason why the call was discarded
@ -31712,6 +31870,7 @@ func (*MessageCall) MessageContentType() string {
func (messageCall *MessageCall) UnmarshalJSON(data []byte) error {
var tmp struct {
UniqueId JsonInt64 `json:"unique_id"`
IsVideo bool `json:"is_video"`
DiscardReason json.RawMessage `json:"discard_reason"`
Duration int32 `json:"duration"`
@ -31722,6 +31881,7 @@ func (messageCall *MessageCall) UnmarshalJSON(data []byte) error {
return err
}
messageCall.UniqueId = tmp.UniqueId
messageCall.IsVideo = tmp.IsVideo
messageCall.Duration = tmp.Duration
@ -32096,6 +32256,64 @@ func (*MessageChatOwnerChanged) MessageContentType() string {
return TypeMessageChatOwnerChanged
}
// Chat has_protected_content setting was changed or request to change it was rejected
type MessageChatHasProtectedContentToggled struct {
meta
// Identifier of the message with the request to change the setting; can be an identifier of a deleted message or 0
RequestMessageId int64 `json:"request_message_id"`
// Previous value of the setting
OldHasProtectedContent bool `json:"old_has_protected_content"`
// New value of the setting
NewHasProtectedContent bool `json:"new_has_protected_content"`
}
func (entity *MessageChatHasProtectedContentToggled) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageChatHasProtectedContentToggled
return json.Marshal((*stub)(entity))
}
func (*MessageChatHasProtectedContentToggled) GetClass() string {
return ClassMessageContent
}
func (*MessageChatHasProtectedContentToggled) GetType() string {
return TypeMessageChatHasProtectedContentToggled
}
func (*MessageChatHasProtectedContentToggled) MessageContentType() string {
return TypeMessageChatHasProtectedContentToggled
}
// Chat has_protected_content setting was requested to be disabled
type MessageChatHasProtectedContentDisableRequested struct {
meta
// True, if the request has expired
IsExpired bool `json:"is_expired"`
}
func (entity *MessageChatHasProtectedContentDisableRequested) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub MessageChatHasProtectedContentDisableRequested
return json.Marshal((*stub)(entity))
}
func (*MessageChatHasProtectedContentDisableRequested) GetClass() string {
return ClassMessageContent
}
func (*MessageChatHasProtectedContentDisableRequested) GetType() string {
return TypeMessageChatHasProtectedContentDisableRequested
}
func (*MessageChatHasProtectedContentDisableRequested) MessageContentType() string {
return TypeMessageChatHasProtectedContentDisableRequested
}
// New chat members were added
type MessageChatAddMembers struct {
meta
@ -34342,6 +34560,160 @@ func (*MessageUnsupported) MessageContentType() string {
return TypeMessageUnsupported
}
// Don't show the date or time
type DateTimePartPrecisionNone struct{
meta
}
func (entity *DateTimePartPrecisionNone) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateTimePartPrecisionNone
return json.Marshal((*stub)(entity))
}
func (*DateTimePartPrecisionNone) GetClass() string {
return ClassDateTimePartPrecision
}
func (*DateTimePartPrecisionNone) GetType() string {
return TypeDateTimePartPrecisionNone
}
func (*DateTimePartPrecisionNone) DateTimePartPrecisionType() string {
return TypeDateTimePartPrecisionNone
}
// Show the date or time in a short way (17.03.22 or 22:45)
type DateTimePartPrecisionShort struct{
meta
}
func (entity *DateTimePartPrecisionShort) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateTimePartPrecisionShort
return json.Marshal((*stub)(entity))
}
func (*DateTimePartPrecisionShort) GetClass() string {
return ClassDateTimePartPrecision
}
func (*DateTimePartPrecisionShort) GetType() string {
return TypeDateTimePartPrecisionShort
}
func (*DateTimePartPrecisionShort) DateTimePartPrecisionType() string {
return TypeDateTimePartPrecisionShort
}
// Show the date or time in a long way (March 17, 2022 or 22:45:00)
type DateTimePartPrecisionLong struct{
meta
}
func (entity *DateTimePartPrecisionLong) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateTimePartPrecisionLong
return json.Marshal((*stub)(entity))
}
func (*DateTimePartPrecisionLong) GetClass() string {
return ClassDateTimePartPrecision
}
func (*DateTimePartPrecisionLong) GetType() string {
return TypeDateTimePartPrecisionLong
}
func (*DateTimePartPrecisionLong) DateTimePartPrecisionType() string {
return TypeDateTimePartPrecisionLong
}
// The time must be shown relative to the current time ([in ] X seconds, minutes, hours, days, months, years [ago])
type DateTimeFormattingTypeRelative struct{
meta
}
func (entity *DateTimeFormattingTypeRelative) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateTimeFormattingTypeRelative
return json.Marshal((*stub)(entity))
}
func (*DateTimeFormattingTypeRelative) GetClass() string {
return ClassDateTimeFormattingType
}
func (*DateTimeFormattingTypeRelative) GetType() string {
return TypeDateTimeFormattingTypeRelative
}
func (*DateTimeFormattingTypeRelative) DateTimeFormattingTypeType() string {
return TypeDateTimeFormattingTypeRelative
}
// The date and time must be shown as absolute timestamps
type DateTimeFormattingTypeAbsolute struct {
meta
// The precision with which hours, minutes and seconds are shown
TimePrecision DateTimePartPrecision `json:"time_precision"`
// The precision with which the date is shown
DatePrecision DateTimePartPrecision `json:"date_precision"`
// True, if the day of week must be shown
ShowDayOfWeek bool `json:"show_day_of_week"`
}
func (entity *DateTimeFormattingTypeAbsolute) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub DateTimeFormattingTypeAbsolute
return json.Marshal((*stub)(entity))
}
func (*DateTimeFormattingTypeAbsolute) GetClass() string {
return ClassDateTimeFormattingType
}
func (*DateTimeFormattingTypeAbsolute) GetType() string {
return TypeDateTimeFormattingTypeAbsolute
}
func (*DateTimeFormattingTypeAbsolute) DateTimeFormattingTypeType() string {
return TypeDateTimeFormattingTypeAbsolute
}
func (dateTimeFormattingTypeAbsolute *DateTimeFormattingTypeAbsolute) UnmarshalJSON(data []byte) error {
var tmp struct {
TimePrecision json.RawMessage `json:"time_precision"`
DatePrecision json.RawMessage `json:"date_precision"`
ShowDayOfWeek bool `json:"show_day_of_week"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
dateTimeFormattingTypeAbsolute.ShowDayOfWeek = tmp.ShowDayOfWeek
fieldTimePrecision, _ := UnmarshalDateTimePartPrecision(tmp.TimePrecision)
dateTimeFormattingTypeAbsolute.TimePrecision = fieldTimePrecision
fieldDatePrecision, _ := UnmarshalDateTimePartPrecision(tmp.DatePrecision)
dateTimeFormattingTypeAbsolute.DatePrecision = fieldDatePrecision
return nil
}
// A mention of a user, a supergroup, or a channel by their username
type TextEntityTypeMention struct{
meta
@ -34902,6 +35274,54 @@ func (*TextEntityTypeMediaTimestamp) TextEntityTypeType() string {
return TypeTextEntityTypeMediaTimestamp
}
// A data and time
type TextEntityTypeDateTime struct {
meta
// Point in time (Unix timestamp) representing the data and time
UnixTime int32 `json:"unix_time"`
// Date and time formatting type; may be null if none and the original text must not be changed
FormattingType DateTimeFormattingType `json:"formatting_type"`
}
func (entity *TextEntityTypeDateTime) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub TextEntityTypeDateTime
return json.Marshal((*stub)(entity))
}
func (*TextEntityTypeDateTime) GetClass() string {
return ClassTextEntityType
}
func (*TextEntityTypeDateTime) GetType() string {
return TypeTextEntityTypeDateTime
}
func (*TextEntityTypeDateTime) TextEntityTypeType() string {
return TypeTextEntityTypeDateTime
}
func (textEntityTypeDateTime *TextEntityTypeDateTime) UnmarshalJSON(data []byte) error {
var tmp struct {
UnixTime int32 `json:"unix_time"`
FormattingType json.RawMessage `json:"formatting_type"`
}
err := json.Unmarshal(data, &tmp)
if err != nil {
return err
}
textEntityTypeDateTime.UnixTime = tmp.UnixTime
fieldFormattingType, _ := UnmarshalDateTimeFormattingType(tmp.FormattingType)
textEntityTypeDateTime.FormattingType = fieldFormattingType
return nil
}
// A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size
type InputThumbnail struct {
meta
@ -36414,6 +36834,10 @@ type MessageProperties struct {
CanReportSupergroupSpam bool `json:"can_report_supergroup_spam"`
// True, if fact check for the message can be changed through setMessageFactCheck
CanSetFactCheck bool `json:"can_set_fact_check"`
// True, if content of the message can't be saved locally, because it is protected by the current user; if true, then can_be_saved is false
HasProtectedContentByCurrentUser bool `json:"has_protected_content_by_current_user"`
// True, if content of the message can't be saved locally, because it is protected by the other user; if true, then can_be_saved is false
HasProtectedContentByOtherUser bool `json:"has_protected_content_by_other_user"`
// True, if message statistics must be available from context menu of the message
NeedShowStatistics bool `json:"need_show_statistics"`
}
@ -40920,6 +41344,62 @@ func (*GroupCallId) GetType() string {
return TypeGroupCallId
}
// A just ended call
type InputCallDiscarded struct {
meta
// Identifier of the call
CallId int32 `json:"call_id"`
}
func (entity *InputCallDiscarded) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputCallDiscarded
return json.Marshal((*stub)(entity))
}
func (*InputCallDiscarded) GetClass() string {
return ClassInputCall
}
func (*InputCallDiscarded) GetType() string {
return TypeInputCallDiscarded
}
func (*InputCallDiscarded) InputCallType() string {
return TypeInputCallDiscarded
}
// A call from a message of the type messageCall with non-zero messageCall.unique_id
type InputCallFromMessage struct {
meta
// Chat identifier of the message
ChatId int64 `json:"chat_id"`
// Message identifier
MessageId int64 `json:"message_id"`
}
func (entity *InputCallFromMessage) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InputCallFromMessage
return json.Marshal((*stub)(entity))
}
func (*InputCallFromMessage) GetClass() string {
return ClassInputCall
}
func (*InputCallFromMessage) GetType() string {
return TypeInputCallFromMessage
}
func (*InputCallFromMessage) InputCallType() string {
return TypeInputCallFromMessage
}
// The call is pending, waiting to be accepted by a user
type CallStatePending struct {
meta
@ -45445,6 +45925,37 @@ func (chatEventMemberRestricted *ChatEventMemberRestricted) UnmarshalJSON(data [
return nil
}
// A chat member tag has been changed
type ChatEventMemberTagChanged struct {
meta
// Affected chat member user identifier
UserId int64 `json:"user_id"`
// Previous tag of the chat member
OldTag string `json:"old_tag"`
// New tag of the chat member
NewTag string `json:"new_tag"`
}
func (entity *ChatEventMemberTagChanged) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub ChatEventMemberTagChanged
return json.Marshal((*stub)(entity))
}
func (*ChatEventMemberTagChanged) GetClass() string {
return ClassChatEventAction
}
func (*ChatEventMemberTagChanged) GetType() string {
return TypeChatEventMemberTagChanged
}
func (*ChatEventMemberTagChanged) ChatEventActionType() string {
return TypeChatEventMemberTagChanged
}
// A chat member extended their subscription to the chat
type ChatEventMemberSubscriptionExtended struct {
meta
@ -46758,6 +47269,8 @@ type ChatEventLogFilters struct {
MemberPromotions bool `json:"member_promotions"`
// True, if member restricted/unrestricted/banned/unbanned events need to be returned
MemberRestrictions bool `json:"member_restrictions"`
// True, if member tag and custom title change events need to be returned
MemberTagChanges bool `json:"member_tag_changes"`
// True, if changes in chat information need to be returned
InfoChanges bool `json:"info_changes"`
// True, if changes in chat settings need to be returned
@ -48139,6 +48652,31 @@ func (*PremiumFeaturePaidMessages) PremiumFeatureType() string {
return TypePremiumFeaturePaidMessages
}
// The ability to enable content protection in private chats
type PremiumFeatureProtectPrivateChatContent struct{
meta
}
func (entity *PremiumFeatureProtectPrivateChatContent) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub PremiumFeatureProtectPrivateChatContent
return json.Marshal((*stub)(entity))
}
func (*PremiumFeatureProtectPrivateChatContent) GetClass() string {
return ClassPremiumFeature
}
func (*PremiumFeatureProtectPrivateChatContent) GetType() string {
return TypePremiumFeatureProtectPrivateChatContent
}
func (*PremiumFeatureProtectPrivateChatContent) PremiumFeatureType() string {
return TypePremiumFeatureProtectPrivateChatContent
}
// The ability to set location
type BusinessFeatureLocation struct{
meta
@ -56894,6 +57432,33 @@ func (internalLinkTypeNewStory *InternalLinkTypeNewStory) UnmarshalJSON(data []b
return nil
}
// The link is an OAuth link. Call getOauthLinkInfo with the given URL to process the link if the link was received from outside of the application; otherwise, ignore it. After getOauthLinkInfo, show the user confirmation dialog and process it with checkOauthRequestMatchCode, acceptOauthRequest or declineOauthRequest
type InternalLinkTypeOauth struct {
meta
// URL to be passed to getOauthLinkInfo
Url string `json:"url"`
}
func (entity *InternalLinkTypeOauth) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub InternalLinkTypeOauth
return json.Marshal((*stub)(entity))
}
func (*InternalLinkTypeOauth) GetClass() string {
return ClassInternalLinkType
}
func (*InternalLinkTypeOauth) GetType() string {
return TypeInternalLinkTypeOauth
}
func (*InternalLinkTypeOauth) InternalLinkTypeType() string {
return TypeInternalLinkTypeOauth
}
// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it
type InternalLinkTypePassportDataRequest struct {
meta
@ -63263,13 +63828,13 @@ func (*UpdateChatPendingJoinRequests) UpdateType() string {
return TypeUpdateChatPendingJoinRequests
}
// The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
// The chat reply markup was changed
type UpdateChatReplyMarkup struct {
meta
// Chat identifier
ChatId int64 `json:"chat_id"`
// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
ReplyMarkupMessageId int64 `json:"reply_markup_message_id"`
// The message from which the reply markup must be used; may be null if there is no default reply markup in the chat
ReplyMarkupMessage *Message `json:"reply_markup_message"`
}
func (entity *UpdateChatReplyMarkup) MarshalJSON() ([]byte, error) {
@ -64700,6 +65265,37 @@ func (updateServiceNotification *UpdateServiceNotification) UnmarshalJSON(data [
return nil
}
// An OAuth authorization request was received
type UpdateNewOauthRequest struct {
meta
// A domain of the URL where the user authorizes
Domain string `json:"domain"`
// Human-readable description of a country and a region from which the authorization is performed, based on the IP address
Location string `json:"location"`
// The URL to pass to getOauthLinkInfo; the link is valid for 60 seconds
Url string `json:"url"`
}
func (entity *UpdateNewOauthRequest) MarshalJSON() ([]byte, error) {
entity.meta.Type = entity.GetType()
type stub UpdateNewOauthRequest
return json.Marshal((*stub)(entity))
}
func (*UpdateNewOauthRequest) GetClass() string {
return ClassUpdate
}
func (*UpdateNewOauthRequest) GetType() string {
return TypeUpdateNewOauthRequest
}
func (*UpdateNewOauthRequest) UpdateType() string {
return TypeUpdateNewOauthRequest
}
// Information about a file was updated
type UpdateFile struct {
meta

View file

@ -4243,6 +4243,12 @@ func UnmarshalMessageContent(data json.RawMessage) (MessageContent, error) {
case TypeMessageChatOwnerChanged:
return UnmarshalMessageChatOwnerChanged(data)
case TypeMessageChatHasProtectedContentToggled:
return UnmarshalMessageChatHasProtectedContentToggled(data)
case TypeMessageChatHasProtectedContentDisableRequested:
return UnmarshalMessageChatHasProtectedContentDisableRequested(data)
case TypeMessageChatAddMembers:
return UnmarshalMessageChatAddMembers(data)
@ -4433,6 +4439,77 @@ func UnmarshalListOfMessageContent(dataList []json.RawMessage) ([]MessageContent
return list, nil
}
func UnmarshalDateTimePartPrecision(data json.RawMessage) (DateTimePartPrecision, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeDateTimePartPrecisionNone:
return UnmarshalDateTimePartPrecisionNone(data)
case TypeDateTimePartPrecisionShort:
return UnmarshalDateTimePartPrecisionShort(data)
case TypeDateTimePartPrecisionLong:
return UnmarshalDateTimePartPrecisionLong(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfDateTimePartPrecision(dataList []json.RawMessage) ([]DateTimePartPrecision, error) {
list := []DateTimePartPrecision{}
for _, data := range dataList {
entity, err := UnmarshalDateTimePartPrecision(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalDateTimeFormattingType(data json.RawMessage) (DateTimeFormattingType, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeDateTimeFormattingTypeRelative:
return UnmarshalDateTimeFormattingTypeRelative(data)
case TypeDateTimeFormattingTypeAbsolute:
return UnmarshalDateTimeFormattingTypeAbsolute(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfDateTimeFormattingType(dataList []json.RawMessage) ([]DateTimeFormattingType, error) {
list := []DateTimeFormattingType{}
for _, data := range dataList {
entity, err := UnmarshalDateTimeFormattingType(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) {
var meta meta
@ -4508,6 +4585,9 @@ func UnmarshalTextEntityType(data json.RawMessage) (TextEntityType, error) {
case TypeTextEntityTypeMediaTimestamp:
return UnmarshalTextEntityTypeMediaTimestamp(data)
case TypeTextEntityTypeDateTime:
return UnmarshalTextEntityTypeDateTime(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -5537,6 +5617,40 @@ func UnmarshalListOfCallServerType(dataList []json.RawMessage) ([]CallServerType
return list, nil
}
func UnmarshalInputCall(data json.RawMessage) (InputCall, error) {
var meta meta
err := json.Unmarshal(data, &meta)
if err != nil {
return nil, err
}
switch meta.Type {
case TypeInputCallDiscarded:
return UnmarshalInputCallDiscarded(data)
case TypeInputCallFromMessage:
return UnmarshalInputCallFromMessage(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
}
func UnmarshalListOfInputCall(dataList []json.RawMessage) ([]InputCall, error) {
list := []InputCall{}
for _, data := range dataList {
entity, err := UnmarshalInputCall(data)
if err != nil {
return nil, err
}
list = append(list, entity)
}
return list, nil
}
func UnmarshalCallState(data json.RawMessage) (CallState, error) {
var meta meta
@ -6243,6 +6357,9 @@ func UnmarshalChatEventAction(data json.RawMessage) (ChatEventAction, error) {
case TypeChatEventMemberRestricted:
return UnmarshalChatEventMemberRestricted(data)
case TypeChatEventMemberTagChanged:
return UnmarshalChatEventMemberTagChanged(data)
case TypeChatEventMemberSubscriptionExtended:
return UnmarshalChatEventMemberSubscriptionExtended(data)
@ -6591,6 +6708,9 @@ func UnmarshalPremiumFeature(data json.RawMessage) (PremiumFeature, error) {
case TypePremiumFeaturePaidMessages:
return UnmarshalPremiumFeaturePaidMessages(data)
case TypePremiumFeatureProtectPrivateChatContent:
return UnmarshalPremiumFeatureProtectPrivateChatContent(data)
default:
return nil, fmt.Errorf("Error unmarshaling. Unknown type: " + meta.Type)
}
@ -8371,6 +8491,9 @@ func UnmarshalInternalLinkType(data json.RawMessage) (InternalLinkType, error) {
case TypeInternalLinkTypeNewStory:
return UnmarshalInternalLinkTypeNewStory(data)
case TypeInternalLinkTypeOauth:
return UnmarshalInternalLinkTypeOauth(data)
case TypeInternalLinkTypePassportDataRequest:
return UnmarshalInternalLinkTypePassportDataRequest(data)
@ -9543,6 +9666,9 @@ func UnmarshalUpdate(data json.RawMessage) (Update, error) {
case TypeUpdateServiceNotification:
return UnmarshalUpdateServiceNotification(data)
case TypeUpdateNewOauthRequest:
return UnmarshalUpdateNewOauthRequest(data)
case TypeUpdateFile:
return UnmarshalUpdateFile(data)
@ -13188,6 +13314,22 @@ func UnmarshalChatMessageSenders(data json.RawMessage) (*ChatMessageSenders, err
return &resp, err
}
func UnmarshalPollVoter(data json.RawMessage) (*PollVoter, error) {
var resp PollVoter
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalPollVoters(data json.RawMessage) (*PollVoters, error) {
var resp PollVoters
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageReadDateRead(data json.RawMessage) (*MessageReadDateRead, error) {
var resp MessageReadDateRead
@ -14484,6 +14626,14 @@ func UnmarshalLoginUrlInfoRequestConfirmation(data json.RawMessage) (*LoginUrlIn
return &resp, err
}
func UnmarshalOauthLinkInfo(data json.RawMessage) (*OauthLinkInfo, error) {
var resp OauthLinkInfo
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalThemeParameters(data json.RawMessage) (*ThemeParameters, error) {
var resp ThemeParameters
@ -16692,6 +16842,22 @@ func UnmarshalMessageChatOwnerChanged(data json.RawMessage) (*MessageChatOwnerCh
return &resp, err
}
func UnmarshalMessageChatHasProtectedContentToggled(data json.RawMessage) (*MessageChatHasProtectedContentToggled, error) {
var resp MessageChatHasProtectedContentToggled
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageChatHasProtectedContentDisableRequested(data json.RawMessage) (*MessageChatHasProtectedContentDisableRequested, error) {
var resp MessageChatHasProtectedContentDisableRequested
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalMessageChatAddMembers(data json.RawMessage) (*MessageChatAddMembers, error) {
var resp MessageChatAddMembers
@ -17148,6 +17314,46 @@ func UnmarshalMessageUnsupported(data json.RawMessage) (*MessageUnsupported, err
return &resp, err
}
func UnmarshalDateTimePartPrecisionNone(data json.RawMessage) (*DateTimePartPrecisionNone, error) {
var resp DateTimePartPrecisionNone
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDateTimePartPrecisionShort(data json.RawMessage) (*DateTimePartPrecisionShort, error) {
var resp DateTimePartPrecisionShort
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDateTimePartPrecisionLong(data json.RawMessage) (*DateTimePartPrecisionLong, error) {
var resp DateTimePartPrecisionLong
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDateTimeFormattingTypeRelative(data json.RawMessage) (*DateTimeFormattingTypeRelative, error) {
var resp DateTimeFormattingTypeRelative
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalDateTimeFormattingTypeAbsolute(data json.RawMessage) (*DateTimeFormattingTypeAbsolute, error) {
var resp DateTimeFormattingTypeAbsolute
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalTextEntityTypeMention(data json.RawMessage) (*TextEntityTypeMention, error) {
var resp TextEntityTypeMention
@ -17324,6 +17530,14 @@ func UnmarshalTextEntityTypeMediaTimestamp(data json.RawMessage) (*TextEntityTyp
return &resp, err
}
func UnmarshalTextEntityTypeDateTime(data json.RawMessage) (*TextEntityTypeDateTime, error) {
var resp TextEntityTypeDateTime
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputThumbnail(data json.RawMessage) (*InputThumbnail, error) {
var resp InputThumbnail
@ -18716,6 +18930,22 @@ func UnmarshalGroupCallId(data json.RawMessage) (*GroupCallId, error) {
return &resp, err
}
func UnmarshalInputCallDiscarded(data json.RawMessage) (*InputCallDiscarded, error) {
var resp InputCallDiscarded
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInputCallFromMessage(data json.RawMessage) (*InputCallFromMessage, error) {
var resp InputCallFromMessage
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalCallStatePending(data json.RawMessage) (*CallStatePending, error) {
var resp CallStatePending
@ -19684,6 +19914,14 @@ func UnmarshalChatEventMemberRestricted(data json.RawMessage) (*ChatEventMemberR
return &resp, err
}
func UnmarshalChatEventMemberTagChanged(data json.RawMessage) (*ChatEventMemberTagChanged, error) {
var resp ChatEventMemberTagChanged
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalChatEventMemberSubscriptionExtended(data json.RawMessage) (*ChatEventMemberSubscriptionExtended, error) {
var resp ChatEventMemberSubscriptionExtended
@ -20444,6 +20682,14 @@ func UnmarshalPremiumFeaturePaidMessages(data json.RawMessage) (*PremiumFeatureP
return &resp, err
}
func UnmarshalPremiumFeatureProtectPrivateChatContent(data json.RawMessage) (*PremiumFeatureProtectPrivateChatContent, error) {
var resp PremiumFeatureProtectPrivateChatContent
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalBusinessFeatureLocation(data json.RawMessage) (*BusinessFeatureLocation, error) {
var resp BusinessFeatureLocation
@ -22884,6 +23130,14 @@ func UnmarshalInternalLinkTypeNewStory(data json.RawMessage) (*InternalLinkTypeN
return &resp, err
}
func UnmarshalInternalLinkTypeOauth(data json.RawMessage) (*InternalLinkTypeOauth, error) {
var resp InternalLinkTypeOauth
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalInternalLinkTypePassportDataRequest(data json.RawMessage) (*InternalLinkTypePassportDataRequest, error) {
var resp InternalLinkTypePassportDataRequest
@ -24892,6 +25146,14 @@ func UnmarshalUpdateServiceNotification(data json.RawMessage) (*UpdateServiceNot
return &resp, err
}
func UnmarshalUpdateNewOauthRequest(data json.RawMessage) (*UpdateNewOauthRequest, error) {
var resp UpdateNewOauthRequest
err := json.Unmarshal(data, &resp)
return &resp, err
}
func UnmarshalUpdateFile(data json.RawMessage) (*UpdateFile, error) {
var resp UpdateFile
@ -27012,6 +27274,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatMessageSenders:
return UnmarshalChatMessageSenders(data)
case TypePollVoter:
return UnmarshalPollVoter(data)
case TypePollVoters:
return UnmarshalPollVoters(data)
case TypeMessageReadDateRead:
return UnmarshalMessageReadDateRead(data)
@ -27498,6 +27766,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeLoginUrlInfoRequestConfirmation:
return UnmarshalLoginUrlInfoRequestConfirmation(data)
case TypeOauthLinkInfo:
return UnmarshalOauthLinkInfo(data)
case TypeThemeParameters:
return UnmarshalThemeParameters(data)
@ -28326,6 +28597,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageChatOwnerChanged:
return UnmarshalMessageChatOwnerChanged(data)
case TypeMessageChatHasProtectedContentToggled:
return UnmarshalMessageChatHasProtectedContentToggled(data)
case TypeMessageChatHasProtectedContentDisableRequested:
return UnmarshalMessageChatHasProtectedContentDisableRequested(data)
case TypeMessageChatAddMembers:
return UnmarshalMessageChatAddMembers(data)
@ -28497,6 +28774,21 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeMessageUnsupported:
return UnmarshalMessageUnsupported(data)
case TypeDateTimePartPrecisionNone:
return UnmarshalDateTimePartPrecisionNone(data)
case TypeDateTimePartPrecisionShort:
return UnmarshalDateTimePartPrecisionShort(data)
case TypeDateTimePartPrecisionLong:
return UnmarshalDateTimePartPrecisionLong(data)
case TypeDateTimeFormattingTypeRelative:
return UnmarshalDateTimeFormattingTypeRelative(data)
case TypeDateTimeFormattingTypeAbsolute:
return UnmarshalDateTimeFormattingTypeAbsolute(data)
case TypeTextEntityTypeMention:
return UnmarshalTextEntityTypeMention(data)
@ -28563,6 +28855,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeTextEntityTypeMediaTimestamp:
return UnmarshalTextEntityTypeMediaTimestamp(data)
case TypeTextEntityTypeDateTime:
return UnmarshalTextEntityTypeDateTime(data)
case TypeInputThumbnail:
return UnmarshalInputThumbnail(data)
@ -29085,6 +29380,12 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeGroupCallId:
return UnmarshalGroupCallId(data)
case TypeInputCallDiscarded:
return UnmarshalInputCallDiscarded(data)
case TypeInputCallFromMessage:
return UnmarshalInputCallFromMessage(data)
case TypeCallStatePending:
return UnmarshalCallStatePending(data)
@ -29448,6 +29749,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeChatEventMemberRestricted:
return UnmarshalChatEventMemberRestricted(data)
case TypeChatEventMemberTagChanged:
return UnmarshalChatEventMemberTagChanged(data)
case TypeChatEventMemberSubscriptionExtended:
return UnmarshalChatEventMemberSubscriptionExtended(data)
@ -29733,6 +30037,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypePremiumFeaturePaidMessages:
return UnmarshalPremiumFeaturePaidMessages(data)
case TypePremiumFeatureProtectPrivateChatContent:
return UnmarshalPremiumFeatureProtectPrivateChatContent(data)
case TypeBusinessFeatureLocation:
return UnmarshalBusinessFeatureLocation(data)
@ -30648,6 +30955,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeInternalLinkTypeNewStory:
return UnmarshalInternalLinkTypeNewStory(data)
case TypeInternalLinkTypeOauth:
return UnmarshalInternalLinkTypeOauth(data)
case TypeInternalLinkTypePassportDataRequest:
return UnmarshalInternalLinkTypePassportDataRequest(data)
@ -31401,6 +31711,9 @@ func UnmarshalType(data json.RawMessage) (Type, error) {
case TypeUpdateServiceNotification:
return UnmarshalUpdateServiceNotification(data)
case TypeUpdateNewOauthRequest:
return UnmarshalUpdateNewOauthRequest(data)
case TypeUpdateFile:
return UnmarshalUpdateFile(data)